These Intel® Supplemental Streaming SIMD Extensions 3 (Intel® SSSE3) intrinsics are used to compute absolute values. The prototypes for these intrinsics are in tmmintrin.h. You can also use the ia32intrin.h header file for these intrinsics.
Interpreting a and r as arrays of signed 8-bit integers:
for (i = 0; i < 16; i++) {
r[i] = abs(a[i]);
}
extern __m128i _mm_abs_epi16 (__m128i a);
Compute absolute value of signed words.
Interpreting a and r as arrays of signed 16-bit integers:
for (i = 0; i < 8; i++) {
r[i] = abs(a[i]);
}
Interpreting a and r as arrays of signed 32-bit integers:
for (i = 0; i < 4; i++) {
r[i] = abs(a[i]);
}
extern __m64 _mm_abs_pi8 (__m64 a);
Compute absolute value of signed bytes.
Interpreting a and r as arrays of signed 8-bit integers:
for (i = 0; i < 8; i++) {
r[i] = abs(a[i]);
}
Interpreting a and r as arrays of signed 16-bit integers:
for (i = 0; i < 4; i++) {
r[i] = abs(a[i]);
}
extern __m64 _mm_abs_pi32 (__m64 a);
Compute absolute value of signed dwords.
Interpreting a and r as arrays of signed 32-bit integers:
for (i = 0; i < 2; i++) {
r[i] = abs(a[i]);
}
Copyright © 1996-2011, Intel Corporation. All rights reserved.