Guest User

Untitled

a guest
Jan 20th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. __m128 foo (__m128 value) {
  2. const __m128 zero = _mm_set_ps1 (0.0f);
  3.  
  4. __m128 positives = _mm_and_ps(_mm_cmpgt_ps (value, zero), _mm_set_ps1(1.0f));
  5. __m128 negatives = _mm_and_ps(_mm_cmplt_ps (value, zero), _mm_set_ps1(-1.0f));
  6.  
  7. return _mm_or_ps(positives, negatives);
  8. }
Add Comment
Please, Sign In to add comment