KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I recently noticed that _m128 m = _mm_set_ps(0,1,2,3); puts the 4 floats into reverse order when cast to a float array: (float*) p = (float*)(&m); // p[0] == 3 // p[1] == 2 // p[2] == 1 // p[3] == 0 The same happens with a union { _m128 m; float[4] a; } also. Why do SSE operations use this ordering? It's not a big deal but slightly confusing. And a follow-up question: When accessing elements in the array by index, should one access in the order 0..3 or the order 3..0 ?
Tags (comma-separated)
Save Edits
Cancel