Developer Guide and Reference

Contents

Negation Intrinsics

These Supplemental Streaming SIMD Extensions 3 (SSSE3) intrinsics are used for negation. The prototypes for these intrinsics are in
tmmintrin.h
.
To use these intrinsics, include the
immintrin.h
file as follows:
#include <immintrin.h>

_mm_sign_epi8

extern __m128i _mm_sign_epi8(__m128i a, __m128i b);
Negates packed bytes in
a
if corresponding sign in
b
is less than zero.
Interpreting
a
,
b
, and
r
as arrays of signed 8-bit integers:
for (i = 0; i < 16; i++){ if (b[i] < 0){ r[i] = -a[i]; } else if (b[i] == 0){ r[i] = 0; } else { r[i] = a[i]; } }

_mm_sign_epi16

extern __m128i _mm_sign_epi16(__m128i a, __m128i b);
Negates packed words in
a
if corresponding sign in
b
is less than zero.
Interpreting
a
,
b
, and
r
as arrays of signed 16-bit integers:
for (i = 0; i < 8; i++){ if (b[i] < 0){ r[i] = -a[i]; } else if (b[i] == 0){ r[i] = 0; } else { r[i] = a[i]; } }

_mm_sign_epi32

extern __m128i _mm_sign_epi32(__m128i a, __m128i b);
Negates packed doublewords in
a
if corresponding sign in
b
is less than zero.
Interpreting
a
,
b
, and
r
as arrays of signed 32-bit integers:
for (i = 0; i < 4; i++){ if (b[i] < 0){ r[i] = -a[i]; } else if (b[i] == 0){ r[i] = 0; } else { r[i] = a[i]; } }

_mm_sign_pi8

extern __m64 _mm_sign_pi8(__m64 a, __m64 b);
Negates packed bytes in
a
if corresponding sign in
b
is less than zero.
Interpreting
a
,
b
, and
r
as arrays of signed 8-bit integers:
for (i = 0; i < 16; i++){ if (b[i] < 0){ r[i] = -a[i]; } else if (b[i] == 0){ r[i] = 0; } else { r[i] = a[i]; } }

_mm_sign_pi16

extern __m64 _mm_sign_pi16(__m64 a, __m64 b);
Negates packed words in
a
if corresponding sign in
b
is less than zero.
Interpreting
a
,
b
, and
r
as arrays of signed 16-bit integers:
for (i = 0; i < 8; i++){ if (b[i] < 0){ r[i] = -a[i]; } else if (b[i] == 0){ r[i] = 0; } else { r[i] = a[i]; } }

_mm_sign_pi32

extern __m64 _mm_sign_pi32(__m64 a, __m64 b);
Negates packed doublewords in
a
if corresponding sign in
b
is less than zero.
Interpreting
a
,
b
, and
r
as arrays of signed 32-bit integers:
for (i = 0; i < 2; i++){ if (b[i] < 0){ r[i] = -a[i]; } else if (b[i] == 0){ r[i] = 0; } else { r[i] = a[i]; } }

Product and Performance Information

1

Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804