Developer Guide and Reference

Contents

_mm256_sign_epi8/16/32

Changes the sign of elements in one source vector depending on the sign of corresponding element in other source vector. The corresponding Intel® AVX2 instruction is
VPSIGNB, VPSIGNW, or VPSIGND.

Syntax

extern __m256i _mm256_sign_epi8(__m256i s1, __m256i s2);
extern __m256i _mm256_sign_epi16(__m256i s1, __m256i s2);
extern __m256i _mm256_sign_epi32(__m256i s1, __m256i s2);
Arguments
s1
integer source vector used for the operation
s2
integer source vector used for the operation
Description
Modifies the sign of data elements in the source vector
s1
depending on the sign of corresponding element in vector
s2
as follows:
  • If sign of data element in
    s2
    vector is < 0 then the sign of corresponding data element in vector
    s1
    is made negative.
  • If sign of data element in
    s2
    vector is > 0 then the sign of corresponding data element in vector
    s1
    is left unchanged.
  • If the data element in
    s2
    vector is = 0 then the corresponding data element in vector
    s1
    is set to 0.
The
_mm256_sign_epi8
intrinsic operates on 8-bit signed bytes. The
_mm256_sign_epi16
intrinsic operates on 16-bit signed words. The
_mm256_sign_epi32
intrinsic operates on 32-bit signed integers.
Returns
Result of the operation.

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