Jump to content
  • Advertisement
Sign in to follow this  
Dirk Gregorius

SIMD Shuffle

This topic is 2611 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am seeing lately that some projects prefer for simple splatting

_mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128( v ), _MM_SHUFFLE(0,0,0,0)))

over

_mm_shuffle_ps( v, v, _MM_SHUFFLE(0,0,0,0) ). I

Is there any reason why one should prefer this variant?

Share this post


Link to post
Share on other sites
Advertisement
There is only one reason: The author of the code has read through some timing tables, and noticed that an integer MMX shuffle is half the speed of a float SSE shuffle, and has therefore (incorrectly) assumed that using shuffle_epi32 is twice as fast as shuffle_ps.

Of course, I'm probably now going to have egg on my face as someone describes some quirky member of the 0x86 family where that is indeed true..... (although I highly doubt that's going to happen)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!