Thread.getStackTop: use ldc.intrinsics.llvm_frameaddress?

Kai Nacke kai at redstar.de
Tue May 14 20:30:11 PDT 2013


Hi!

LLVM for PPC64 does not feature an inline assembler yet.

In a few places this hurts. One place is Thread.getStackTop(). 
Here inline assembler is used to return the stack pointer of the 
current function.

I rewrote this to use ldc.intrinsics.llvm_frameaddress for PPC64.
Now I wonder if this should not be the default implementation for 
LDC, e.g.

version (LDC)
     return ldc.intrinsics.llvm_frameaddress(0);

Does anyone have an argument against this approach?

Thanks!

Regards
Kai


More information about the digitalmars-d-ldc mailing list