Lionello Lunesu wrote:
"Frits van Bommel" <fvbom...@remwovexcapss.nl> wrote in message
news:gmeqbr$137...@digitalmars.com...
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.
Sorry, perhaps I'm missing something: Why should you have to deduct that
from the asm? Doesn't the function prototype give enough information? If
the function returns "int/uint/...", assume "eax"; if it returns
"float/double/..." assume "st(0)", etc....
LLVM IR doesn't know about hardware registers, except when dealing with
inline asm. So if you need to know the value a hardware register has at
the end of some inline asm, you need to tell that asm to "return" it
into a virtual register that you can actually use in regular IR (such as
returning it from a function).