gfxgfx
 
Please login or register.

Login with username, password and session length
 
gfx gfx
gfx
1519 Posts in 504 Topics by 735 Members - Latest Member: Rosy December 02, 2020, 08:02:44 AM
*
gfx* Home | Help | Search | Login | Register | gfx
gfx
Absoft User Forum  |  Support  |  General  |  use of cpu registers under absoft
gfx
gfxgfx
 

Author Topic: use of cpu registers under absoft  (Read 9108 times)

ColinC

  • Newbie
  • *
  • Posts: 5
use of cpu registers under absoft
« on: July 23, 2007, 03:28:32 PM »
Does anybody know how absoft handles the following:
In C one can 'hint' that the compiler ought to consider storing a value in a register only - not in RAM nor stack.
If a do loop index is used 'once only' within the loop, it is stored only in a register (or at least it was in the old days and ought to be).

To give a 'hint' to the absoft compiler, is it better to
(a) declare a temp variable and only use it over a few lines, and whenever one needs another temp variable to
declare another temporary variable, temp2;
or
(b) just using the same variable, temp, for all uses, will be okay.

Or does the Absoft compiler ignore such 'opportunities' to save RAM/cache and time?
Thanks for any ideas.
Colin

mecej4

  • Jr. Member
  • **
  • Posts: 66
Re: use of cpu registers under absoft
« Reply #1 on: May 02, 2008, 06:33:38 PM »
How temporaries are handled is up to the compiler and may vary with the options given to the compiler.

When floating point quantities are involved in mixed mode expressions, older X86 CPUs had to store integer values into memory and load the memory contents into the FPU stack.

You can produce an .obj file and look at the disassembly to see the code emitted by a specific compiler.

Jeremy

  • Guest
Re: use of cpu registers under absoft
« Reply #2 on: May 20, 2008, 02:47:23 PM »
For Absoft Pro Fortran, option (b) is the best.  Absoft Pro Fortran's optimizers will automatically determine the best place for variables will stored.

Absoft User Forum  |  Support  |  General  |  use of cpu registers under absoft
 

gfxgfx
gfx gfx
Powered by MySQL Powered by PHP Valid XHTML 1.0! Valid CSS!