Intel® ISA Extensions
Use hardware-based isolation and memory encryption to provide more code protection in your solutions.
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.

fabs() and SIMD

threethazz
Beginner
160 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
160 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