DMD floating point performance.

Walter Bright newshound at digitalmars.com
Sun Nov 12 11:12:58 PST 2006


Dave wrote:
> If you look at the DMD asm, the problem is that each operation is 
> wrapped by a load/store.. Why wouldn't val and sum be kept in fp 
> registers inside the loop?

The issue isn't with D, it's with the back end code generator. You'll 
see the same thing with the C and C++ compiler.

Because the FPU is a 'stack' machine rather than a register machine, 
it's hard to write a code generator that enregisters floating point 
variables. It's also problematical because every function call must 
empty the FPU stack anyway, and so a lot of register spill logic must be 
in place for it to be very useful.

Not impossible, just a lot of tricky work. How does GDC do with this?



More information about the Digitalmars-d mailing list