Re: Support for gcc vector attributes, SIMD builtins

2011-02-06 Thread Brad Roberts
On 2/6/2011 2:58 PM, Iain Buclaw wrote: > == Quote from Brad Roberts (bra...@puremagic.com)'s article >> I'd be happy to have gcc finding vectorization opportunities, but there's no > need to add this sort of thing to the >> language. This already has a hook to call a library function: >> float[4]

Re: Support for gcc vector attributes, SIMD builtins

2011-02-06 Thread Mike Farnsworth
On 02/06/2011 02:58 PM, Iain Buclaw wrote: > == Quote from Brad Roberts (bra...@puremagic.com)'s article >> I'd be happy to have gcc finding vectorization opportunities, but there's no > need to add this sort of thing to the >> language. This already has a hook to call a library function: >> float

Re: Support for gcc vector attributes, SIMD builtins

2011-02-06 Thread Iain Buclaw
== Quote from Brad Roberts (bra...@puremagic.com)'s article > I'd be happy to have gcc finding vectorization opportunities, but there's no need to add this sort of thing to the > language. This already has a hook to call a library function: > float[4] a = [1,2,3,4], b = [5,6,7,8], c; > c[] = a[] +

Re: Support for gcc vector attributes, SIMD builtins

2011-02-06 Thread Brad Roberts
On 2/6/2011 4:15 AM, Iain Buclaw wrote: > == Quote from Mike Farnsworth (mike.farnswo...@gmail.com)'s article >> On 02/01/2011 10:38 AM, Iain Buclaw wrote: >>> I haven't given it much thought on how internal representation could be, >>> but I'd >>> lean on using unions in D code for usage in the l

Re: Support for gcc vector attributes, SIMD builtins

2011-02-06 Thread Iain Buclaw
== Quote from Iain Buclaw (ibuc...@ubuntu.com)'s article > == Quote from Mike Farnsworth (mike.farnswo...@gmail.com)'s article > > On 02/01/2011 10:38 AM, Iain Buclaw wrote: > > > I haven't given it much thought on how internal representation could be, > > > but I'd > > > lean on using unions in D

Re: Support for gcc vector attributes, SIMD builtins

2011-02-06 Thread Iain Buclaw
== Quote from Mike Farnsworth (mike.farnswo...@gmail.com)'s article > On 02/01/2011 10:38 AM, Iain Buclaw wrote: > > I haven't given it much thought on how internal representation could be, > > but I'd > > lean on using unions in D code for usage in the language. As its probably > > most > > port

Re: Support for gcc vector attributes, SIMD builtins

2011-02-06 Thread Jacob Carlborg
On 2011-02-06 07:24, Mike Farnsworth wrote: On 02/01/2011 10:38 AM, Iain Buclaw wrote: I haven't given it much thought on how internal representation could be, but I'd lean on using unions in D code for usage in the language. As its probably most portable. For example, one of the older 'hello v

Re: Support for gcc vector attributes, SIMD builtins

2011-02-05 Thread Mike Farnsworth
On 02/01/2011 10:38 AM, Iain Buclaw wrote: > I haven't given it much thought on how internal representation could be, but > I'd > lean on using unions in D code for usage in the language. As its probably most > portable. > > For example, one of the older 'hello vectors' I know of: > > import std

Re: Support for gcc vector attributes, SIMD builtins

2011-02-01 Thread Mike Farnsworth
Iain Buclaw Wrote: > == Quote from Jerry Quinn (jlqu...@optonline.net)'s article > > Iain Buclaw Wrote: > > > == Quote from Mike Farnsworth (mike.farnswo...@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

Re: Support for gcc vector attributes, SIMD builtins

2011-02-01 Thread Iain Buclaw
== Quote from Mike Farnsworth (mike.farnswo...@gmail.com)'s article > Iain Buclaw Wrote: > > Interestingly enough, this particular example actually ICEs the compiler. It > > appears that while *explicit* casting is done in the code, DMDFE actually > > *ignores* this, which is terrible on DMD's part

Re: Support for gcc vector attributes, SIMD builtins

2011-02-01 Thread Iain Buclaw
== Quote from Jerry Quinn (jlqu...@optonline.net)'s article > Iain Buclaw Wrote: > > == Quote from Mike Farnsworth (mike.farnswo...@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 opti

Re: Support for gcc vector attributes, SIMD builtins

2011-02-01 Thread Mike Farnsworth
Iain Buclaw Wrote: > == Quote from Mike Farnsworth (mike.farnswo...@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 partia

Re: Support for gcc vector attributes, SIMD builtins

2011-02-01 Thread Mike Farnsworth
Daniel Gibson Wrote: > I'm not sure if that'll help at all, but you may try something like > alias float[4] vec4; // or whatever type you're using > /Maybe/ SSE optimizations work better on arrays than on structs. > Of course, such a type isn't as handy because it'll be vec4[0] instead > of vec4.x

Re: Support for gcc vector attributes, SIMD builtins

2011-02-01 Thread Jerry Quinn
Iain Buclaw Wrote: > == Quote from Mike Farnsworth (mike.farnswo...@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 partia

Re: Support for gcc vector attributes, SIMD builtins

2011-02-01 Thread Iain Buclaw
== Quote from Mike Farnsworth (mike.farnswo...@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 > register

Re: Support for gcc vector attributes, SIMD builtins

2011-02-01 Thread Daniel Gibson
Am 01.02.2011 09:10, schrieb Mike Farnsworth: 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

Support for gcc vector attributes, SIMD builtins

2011-02-01 Thread Mike Farnsworth
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