Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- __m128 foo (__m128 value) {
- const __m128 zero = _mm_set_ps1 (0.0f);
- __m128 positives = _mm_and_ps(_mm_cmpgt_ps (value, zero), _mm_set_ps1(1.0f));
- __m128 negatives = _mm_and_ps(_mm_cmplt_ps (value, zero), _mm_set_ps1(-1.0f));
- return _mm_or_ps(positives, negatives);
- }
Add Comment
Please, Sign In to add comment