SSE SIMD enhanced code 4x slower than regular code

Boris Hollas borish@gmx.de
Fri Jan 20 17:30:00 GMT 2012


>Maybe use at least -O2 ?

no difference.

> You may want to try _mm_shuffle_pd or __builtin_shuffle.

indeed, this reduces the runtime by 2 s. Still 3x slower than iter1.

>Did you take a look at the generated code (use flag -S and read the 
>generated t.s)? Going back and forth between packed and unpacked through a 
>union often generates plenty of mov instructions. If you manually use 
>_mm_cvtsd_f64 and _mm_unpackhi_pd you may be able to save a bit. Note that 
>with the latest gcc, you can use the [] notation directly on your __m128d.

yes, there are lots of move-instructions. It seems this adds a lot of
runtime.

> I'd be surprised if you managed any gain on this thanks to __m128d.

well, maybe SIMD isn't very well suited for these calculations. So, I'll use
iter1 until I have a better idea.

thanks for your hints!

-Boris
-- 
View this message in context: http://old.nabble.com/SSE-SIMD-enhanced-code-4x-slower-than-regular-code-tp33159404p33161396.html
Sent from the gcc - Help mailing list archive at Nabble.com.



More information about the Gcc-help mailing list