Intel® C++ Compiler XE 13.1 User and Reference Guides

Absolute Value Intrinsics

These Supplemental Streaming SIMD Extensions 3 (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.

extern __m128i _mm_abs_epi8 (__m128i a);

Computes absolute value of signed bytes.

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);

Computes 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]);
}

extern __m128i _mm_abs_epi32 (__m128i a);

Computes absolute value of signed doublewords.

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);

Computes 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]);
}

extern __m64 _mm_abs_pi16 (__m64 a);

Computes absolute value of signed words.

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);

Computes absolute value of signed doublewords.

Interpreting a and r as arrays of signed 32-bit integers:

for (i = 0; i < 2; i++) {
r[i] = abs(a[i]);
}

Submit feedback on this help topic