Bug 24189 – Result of float-vector comparison has inconsistent type

Status
NEW
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
All
Creation time
2023-10-15T07:41:20Z
Last change time
2024-12-13T19:31:09Z
Assigned to
No Owner
Creator
KytoDragon
Moved to GitHub: dmd#20340 →

Comments

Comment #0 by kytodragon — 2023-10-15T07:41:20Z
If two float-vectors are compared (using ==, <, >, <=, >=) the result cannot be used for further vector-operations, unless the intermediate value is stored in a variable or cast to its own type. Example: import core.simd; void foo() { float4 value1 = 0; float4 value2 = 1; // Error: incompatible types for '(value1 == value2) & (value1 < value2)': '__vector(uint[4])' and '__vector(uint[4])' uint4 mask = ((value1 == value2) & (value1 < value2)); // works, even though the same types are used uint4 equal = (value1 == value2); uint4 less = (value1 < value2); uint4 mask2 = (equal & less); uint4 mask3 = (cast(uint4)(value1 == value2) & cast(uint4)(value1 < value2)); } Tested on DMD v2.105.2.
Comment #1 by robert.schadek — 2024-12-13T19:31:09Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/20340 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB