The code below has me slightly perplexed:
function(__m128 foo)
{
__m128 bar = _mm_shuffle_ps(foo, foo, _MM_SHUFFLE(2,2,2,2))
}
Is it just taking the 2nd word of foo and pasting it 4 times into bar or does it do something else as well?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I don’t know if
_mm_shuffleexists. It should rather be_mm_shuffle_ps, given the__m128arguments.In this case it does exactly what you think. It copies the 3rd (not the 2nd, counting starts at 0, from the right, so it’s indeed the 2nd from the left) 32-bit word of
foointo all 4 32-bit words ofbar. What else should it do?