Support for gcc vector attributes, SIMD builtins

Jerry Quinn jlquinn at optonline.net
Tue Feb 1 09:31:35 PST 2011


Iain Buclaw Wrote:

> == Quote from Mike Farnsworth (mike.farnsworth at gmail.com)'s article
> > I built gdc from tip on Fedora 13 (x86-64) and started playing around
> > with creating a vector struct (x,y,z,w) to see what kind of optimization
> > the code generator did with it.  It was able to partially drop into SSE
> > registers and instructions, but not as well as I had hoped from writing
> > "regular" D code.
> > I poked through the builtins that get pulled into d-builtins.c /
> > d-builtins2.cc but I don't see anything that might be pulling in
> > definitions such as __builtin_ia32_* for SSE, for example.
> > How hard would it be to get some sort of vector attribute attached to a
> > type (or just plain indroduce v4sf, __m128, or something like that) and
> > get those SIMD builtins available?

> 
> Saying that, workaround is to use array types.
> typedef float[4] __m128;
> typedef float[4] __v4sf;
> 
> 
> All the more reason to show you that pragma(attribute) is still very incomplete to
> use. Any ideas to improve it are welcome though. :)

The workaround actually looks like a cleaner way to define types for vector intrinsics.  How hard would it be to export vector intrinsics so the API expects float[4], for example?




More information about the D.gnu mailing list