fabs() and SIMD

fabs() and SIMD

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.

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

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

Leave a Comment

Please sign in to add a comment. Not a member? Join today