D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7414 - Vector literal assignment doesn't work in global scope
Summary: Vector literal assignment doesn't work in global scope
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords: SIMD
Depends on:
Blocks:
 
Reported: 2012-01-31 11:12 UTC by Manu
Modified: 2012-05-01 14:05 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Manu 2012-01-31 11:12:22 UTC
This causes the same error with or without 'immutable', but works fine within functions.

// create some global constants
private
{
	immutable ulong2 signMask2 = 0x8000_0000_0000_0000;
	immutable uint4 signMask4 = 0x8000_0000;
	immutable ushort8 signMask8 = 0x8000;
	immutable ubyte16 signMask16 = 0x80;
}



$ /opt/gdc/bin/gdc test.d -O2 -S -msse2
test.d:101: Error: non-constant expression cast(immutable(__vector(ulong[2u])))9223372036854775808LU
test.d:102: Error: non-constant expression cast(immutable(__vector(uint[4u])))-2147483648u
test.d:103: Error: non-constant expression cast(immutable(__vector(ushort[8u])))32768
test.d:104: Error: non-constant expression cast(immutable(__vector(ubyte[16u])))128
Comment 1 SomeDude 2012-04-21 05:35:27 UTC
See also issue 7413
Comment 2 github-bugzilla 2012-05-01 14:04:34 UTC
Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/545c0e187dee1cde236b88523d3389d39dee7f8c
fix Issue 7414 - Vector literal assignment doesn't work in global scope