Using YMM registers causes an undefined label error

kinke noone at nowhere.com
Sat Mar 6 12:12:57 UTC 2021


On Friday, 5 March 2021 at 12:57:43 UTC, z wrote:
> XMM registers work, but as soon as they are changed into YMM 
> DMD outputs "bad type/size of operands %s" and LDC outputs an 
> "label YMM0 is undefined" error. Are they not supported?
> To illutrate : https://run.dlang.io/is/IqDHlK

LDC's support for DMD-style inline asm is limited; GDC-style 
inline asm is the preferred way (e.g., not restricted to x86[_64] 
and no need to worry about calling convention details).

Your example can be reduced to a trivial:

import core.simd;
ubyte32 complement32(ubyte32 a, ubyte32 b)
{
     return a ^ b;
}

which yields the following asm with `ldc2 -mattr=avx -O` (see 
https://d.godbolt.org/z/ex7YE7):

_D7example12complement32FNhG32hQgZQj:
         vxorps  ymm0, ymm1, ymm0
         ret


More information about the Digitalmars-d-learn mailing list