Bug 17758 – assignment of different vector types should require cast

Status
NEW
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2017-08-17T10:52:56Z
Last change time
2024-12-13T18:54:06Z
Assigned to
No Owner
Creator
Martin Nowak
Moved to GitHub: dmd#19302 →

Comments

Comment #0 by code — 2017-08-17T10:52:56Z
cat > bug.d << CODE void test() { __vector(float[4]) f4; __vector(uint[4]) u4; __vector(void[16]) v16; f4 = cast(typeof(f4)) u4; // OK f4 = u4; // should fail v16 = f4; // OK f4 = v16; // should fail f4 = cast(typeof(f4)) v16; // OK } CODE dmd -c bug It's somewhat broken that vectors of different types can be assigned without any casting. This is OK for implicit conversions to void16 vectors, but not for conversions from void16.
Comment #1 by bitter.taste — 2018-03-18T16:27:18Z
The specification states the following about the implicit conversion between vectors > Vector types of the same size can be implicitly converted among each other.
Comment #2 by robert.schadek — 2024-12-13T18:54:06Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19302 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB