LLVM asm with constraints, and 2 operands

kinke noone at nowhere.com
Mon Jul 19 16:13:20 UTC 2021


On Monday, 19 July 2021 at 11:39:02 UTC, Basile B. wrote:
> And what about the `extern(C)` issue ? Does it make sense to be 
> used when the parameters are int4 ?

The original inline asm was buggy and only 'worked' by accident 
(not using the 2nd input operand at all...) with extern(D) 
reversed parameters. At least for Posix x64, the C calling 
convention is well-defined for vectors and equivalent to 
extern(D) (except for the latter's parameter reversal). Windows 
and 32-bit x86 are different; for Windows, extern(D) pays off, as 
LDC's ABI is similar to the MSVC++ __vectorcall calling 
convention (passing vectors in SIMD registers).


More information about the Digitalmars-d-learn mailing list