The Intel® Streaming SIMD Extensions 2 (Intel® SSE2) intrinsics for miscellaneous operations are listed in the following table followed by descriptions.
The prototypes for Intel® SSE2 intrinsics are in the emmintrin.h header file.
Intrinsic |
Operation |
Corresponding Intel® SSE 2 Instruction |
---|---|---|
_mm_packs_epi16 |
Packed Saturation |
PACKSSWB |
_mm_packs_epi32 |
Packed Saturation |
PACKSSDW |
_mm_packus_epi16 |
Packed Saturation |
PACKUSWB |
_mm_extract_epi16 |
Extraction |
PEXTRW |
_mm_insert_epi16 |
Insertion |
PINSRW |
_mm_movemask_epi8 |
Mask Creation |
PMOVMSKB |
_mm_shuffle_epi32 |
Shuffle |
PSHUFD |
_mm_shufflehi_epi16 |
Shuffle |
PSHUFHW |
_mm_shufflelo_epi16 |
Shuffle |
PSHUFLW |
_mm_unpackhi_epi8 |
Interleave |
PUNPCKHBW |
_mm_unpackhi_epi16 |
Interleave |
PUNPCKHWD |
_mm_unpackhi_epi32 |
Interleave |
PUNPCKHDQ |
_mm_unpackhi_epi64 |
Interleave |
PUNPCKHQDQ |
_mm_unpacklo_epi8 |
Interleave |
PUNPCKLBW |
_mm_unpacklo_epi16 |
Interleave |
PUNPCKLWD |
_mm_unpacklo_epi32 |
Interleave |
PUNPCKLDQ |
_mm_unpacklo_epi64 |
Interleave |
PUNPCKLQDQ |
_mm_movepi64_pi64 |
Move |
MOVDQ2Q |
_mm_movpi64_epi64 |
Move |
MOVDQ2Q |
_mm_move_epi64 |
Move |
MOVQ |
_mm_unpackhi_pd |
Interleave |
UNPCKHPD |
_mm_unpacklo_pd |
Interleave |
UNPCKLPD |
_mm_movemask_pd |
Create mask |
MOVMSKPD |
_mm_shuffle_pd |
Select values |
SHUFPD |
__m128i _mm_packs_epi16(__m128i a, __m128i b)
Packs the 16 signed 16-bit integers from a and b into 8-bit integers and saturates.
__m128i _mm_packs_epi32(__m128i a, __m128i b)
Packs the 8 signed 32-bit integers from a and b into signed 16-bit integers and saturates.
__m128i _mm_packus_epi16(__m128i a, __m128i b)
Packs the 16 signed 16-bit integers from a and b into 8-bit unsigned integers and saturates.
R0 |
... |
R7 |
R8 |
... |
R15 |
---|---|---|---|---|---|
Unsigned Saturate(a0) |
... |
Unsigned Saturate(a7) |
Unsigned Saturate(b0) |
... |
Unsigned Saturate(b15) |
int _mm_extract_epi16(__m128i a, int imm)
Extracts the selected signed or unsigned 16-bit integer from a and zero extends. The selector imm must be an immediate.
__m128i _mm_insert_epi16(__m128i a, int b, int imm)
Inserts the least significant 16 bits of b into the selected 16-bit integer of a. The selector imm must be an immediate.
int _mm_movemask_epi8(__m128i a)
Creates a 16-bit mask from the most significant bits of the 16 signed or unsigned 8-bit integers in a and zero extends the upper bits.
__m128i _mm_shuffle_epi32(__m128i a, int imm)
Shuffles the 4 signed or unsigned 32-bit integers in a as specified by imm. The shuffle value, imm, must be an immediate. See Macro Function for Shuffle for a description of shuffle semantics.
__m128i _mm_shufflehi_epi16(__m128i a, int imm)
Shuffles the upper 4 signed or unsigned 16-bit integers in a as specified by imm. The shuffle value, imm, must be an immediate. See Macro Function for Shuffle for a description of shuffle semantics.
__m128i _mm_shufflelo_epi16(__m128i a, int imm)
Shuffles the lower 4 signed or unsigned 16-bit integers in a as specified by imm. The shuffle value, imm, must be an immediate. See Macro Function for Shuffle for a description of shuffle semantics.
__m128i _mm_unpackhi_epi8(__m128i a, __m128i b)
Interleaves the upper 8 signed or unsigned 8-bit integers in a with the upper 8 signed or unsigned 8-bit integers in b.
__m128i _mm_unpackhi_epi16(__m128i a, __m128i b)
Interleaves the upper 4 signed or unsigned 16-bit integers in a with the upper 4 signed or unsigned 16-bit integers in b.
__m128i _mm_unpackhi_epi32(__m128i a, __m128i b)
Interleaves the upper 2 signed or unsigned 32-bit integers in a with the upper 2 signed or unsigned 32-bit integers in b.
__m128i _mm_unpackhi_epi64(__m128i a, __m128i b)
Interleaves the upper signed or unsigned 64-bit integer in a with the upper signed or unsigned 64-bit integer in b.
__m128i _mm_unpacklo_epi8(__m128i a, __m128i b)
Interleaves the lower 8 signed or unsigned 8-bit integers in a with the lower 8 signed or unsigned 8-bit integers in b.
__m128i _mm_unpacklo_epi16(__m128i a, __m128i b)
Interleaves the lower 4 signed or unsigned 16-bit integers in a with the lower 4 signed or unsigned 16-bit integers in b.
__m128i _mm_unpacklo_epi32(__m128i a, __m128i b)
Interleaves the lower 2 signed or unsigned 32-bit integers in a with the lower 2 signed or unsigned 32-bit integers in b.
__m128i _mm_unpacklo_epi64(__m128i a, __m128i b)
Interleaves the lower signed or unsigned 64-bit integer in a with the lower signed or unsigned 64-bit integer in b.
__m128i _mm_movpi64_pi64(__m64 a)
Moves the 64 bits of a to the lower 64 bits of the result, zeroing the upper bits.
__m128i _mm_move_epi64(__m128i a)
Moves the lower 64 bits of a to the lower 64 bits of the result, zeroing the upper bits.
int _mm_movemask_pd(__m128d a)
Creates a two-bit mask from the sign bits of the two DP FP values of a.
Copyright © 1996-2010, Intel Corporation. All rights reserved.