Small Vectors Proposal
Mikola Lysenko
mclysenk at mtu.edu
Tue Jan 30 12:37:23 PST 2007
Oskar Linde wrote:
> For discussion, here is a not very thought out counter proposal:
>
> 1. Make the D 2.0 static array pass-by-value instead of it's
> inconsistent and strange pseudo-reference/value type heritage from C.
> (Pass by reference could be retained for extern(C) functions only).
>
> 2. Define ABIs for SSE2, SSE3, etc platforms so that small static arrays
> can be allocated and passed in SIMD registers.
>
> 3. Implement vector operations for static arrays.
>
After thinking about it some more, I believe this approach would
probably work just as well. Another possibility is to simply restrict
vectors to floating point types only:
ie, float2, float3, float4, double2, double3, double4, real2, real3, real4.
This makes the number of new types only 9 instead of 57. The
disadvantage is that it is no longer easy to use the MMX extensions
which are specially tailored for integer vectors. Overall, I guess I'd
be happy with either situation.
More information about the Digitalmars-d
mailing list