__vector equality compare: LDC vs {GDC, DMD}

Bruce Carneal bcarneal at gmail.com
Wed Jul 27 03:50:50 UTC 2022


LDC produces a boolean from a comparison of __vector(s), (v0 == 
v1).

GDC and DMD error out on that, requiring (v0.array == v1.array) 
to get the boolean.

I've already updated the few dependencies, all in unittest code, 
that I had on this LDC-unique behavior, with very little effort.  
I suspect this would, at most, be a minor portability issue for 
other SIMD coders as well since you're usually looking for masks 
or cmov-like functionality out of your conditionals, not scalar 
booleans.

That said, I am curious: is this behavior intentional or 
accidental?

A small argument for adopting the DMD/GDC behavior is that any 
future useful SIMD relOp DIP would probably have to call out a 
breaking change if you don't.





More information about the digitalmars-d-ldc mailing list