LLVM asm with constraints, and 2 operands

Guillaume Piolat first.name at domain.tld
Sun Jul 18 11:42:24 UTC 2021


Is anyone versed in LLVM inline asm?

I know how to generate SIMD unary op with:

     return __asm!int4("pmovsxwd $1,$0","=x,x",a);

but I struggle to generate 2-operands SIMD ops like:

     return __asm!int4("paddd $1,$0","=x,x",a, b);

If you know how to do it => https://d.godbolt.org/z/ccM38bfMT  it 
would probably help build speed of SIMD heavy code, also -O0 
performance
Also generating the right instruction is good but it must resist 
optimization too, so proper LLVM constraints is needed. It would 
be really helpful if someone has understood the cryptic rules of 
LLVM assembly constraints.


More information about the Digitalmars-d-learn mailing list