Intel® ISA Extensions
Use hardware-based isolation and memory encryption to provide more code protection in your solutions.

fabs() and SIMD

threethazz
Beginner
151 Views
Hello, I've been seaching over the web and also intel foruns and I cannot find a version of fabs() function in SIMD....

I have a __m128 x variable and I want to get the absolute value of the 4 float values in x.

Sorry if this is a re-post, but I cannot really find anything concerning this topic.

thank you in advance,
threethazz.
0 Kudos
1 Reply
neni
New Contributor II
151 Views
sign bit in single prec FP is in bit 31, all you need to do is clearthis bitusing andps with a predefined mask of 4 x 0x7fffffff values

Reply