Bug 16697 – Extend IsExpression to accept __vector as a TypeSpecialization
Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-11-17T00:50:00Z
Last change time
2017-03-22T12:21:21Z
Keywords
bootcamp, SIMD
Assigned to
nobody
Creator
bugzilla
Comments
Comment #0 by bugzilla — 2016-11-17T00:50:35Z
https://dlang.org/spec/expression.html#TypeSpecialization
Add __vector to the list of TypeSpecialization's. When used:
is (__vector(float[4]) == __vector)
will return true,
is (__vector(float[4]) A == __vector)
will set A to float[4].
This can be done with:
is (__vector(float[4]) == __vector(T[N]), T, size_t N)
alias A = T[N];
but is a bit noisy. The need for this comes up with templates specialized to work with vectors.