Inline assembler in D and LDC, round 2

Walter Bright newshound1 at digitalmars.com
Thu Feb 5 18:51:39 PST 2009


Frits van Bommel wrote:
> His approach depends on DMD directly emitting x86 machine code, so it 
> can just emit 'RET' and be done with it.
> 
> LDC on the other hand needs to emit LLVM asm, which requires it to 
> specify an explicit return value. My approach is a way to extract that 
> return value from the inline asm, allowing it to emulate DMD behavior 
> within the LLVM IR.

Ok, so why not, for a function that returns an int, simply have the 
compiler silently tack on the LLVM equivalent of "return EAX"?



More information about the Digitalmars-d mailing list