Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void example__m128()
- {
- //typedef __m128 __attribute__ ((NerdVec (16)));
- __m128 sseval;
- float a, b, c, d;
- sseval = _mm_set_ps(a, b, c, d); // make vector from [ a, b, c, d ]
- sseval = _mm_setr_ps(a, b, c, d); // make vector from [ d, c, b, a ]
- sseval = _mm_load_ps(&a); // ill-specified here - "a" not float[] ...
- // same as _mm_set_ps(a[0], a[1], a[2], a[3])
- // if you have an actual array
- sseval = _mm_set1_ps(a); // make vector from [ a, a, a, a ]
- sseval = _mm_load1_ps(&a); // load from &a, replicate - same as previous
- sseval = _mm_set_ss(a); // make vector from [ a, 0, 0, 0 ]
- sseval = _mm_load_ss(&a); // load from &a, zero others - same as prev
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement