SIMD c = a op b

Cecil Ward cecil at cecilward.com
Sun Jun 18 04:54:08 UTC 2023


Is it true that this doesn’t work (in either branch)?

float4 a,b;
static if (__traits(compiles, a/b))
     c = a / b;
else
     c[] = a[] / b[];

I tried it with 4 x 64-bit ulongs in a 256-bit vector instead.
Hoping I have done things correctly, I got an error message about 
requiring a destination variable as in c = a op b where I tried 
simply "return a / b;" In the else branch, I got a type 
conversion error. Is that because a[] is an array of 256-bit 
vectors, in the else case, not an array of ulongs?


More information about the Digitalmars-d-learn mailing list