System programming in D (Was: The God Language)

bearophile bearophileHUGS at lycos.com
Thu Dec 29 04:39:47 PST 2011


Vladimir Panteleev:

> One example of this is inlining functions containing 
> asm blocks - IIRC DMD does not support this. The compiler should 
> fail the build if it can't inline a function tagged with 
> @forceinline, instead of shrugging it off and failing silently, 
> forcing users to check the disassembly every time.

Right.


> You may have noticed that GCC has some ridiculously complicated 
> assembler facilities. However, they also open the way to the 
> possibilities of writing optimal code - for example, creating 
> custom calling conventions, or inlining assembler functions 
> without restricting the caller's register allocation with a 
> predetermined calling convention. In contrast, DMD is very 
> conservative when it comes to mixing D and assembler. One time I 
> found that putting an asm block in a function turned what were 
> single instructions into blocks of 6 instructions each.

LDC has a mean to inline functions with asm, and asm expressions. DMD too should have both. I am saying this since two or three years.

Bye,
bearophile


More information about the Digitalmars-d mailing list