_mm_alignr_pi8
Microsoft Specific
Emits the Supplemental Streaming SIMD Extensions 3 (SSSE3) instruction palignr. This instruction extracts a 64-bit byte aligned value from the concatenation of the input parameters.
__m64 _mm_alignr_pi8( __m64 a, __m64 b, const int ralign );
r is the 64-bit result value.
CONCAT(a, b) is the 128-bit unsigned intermediate value that is formed by concatenating parameters a and b. The result value is the rightmost 64 bits after shifting this intermediate result right by ralign bytes.
If ralign > 16, the result value is zero.
Before using this intrinsic, software must ensure that the processor supports the instruction.
// _mm_alignr_pi8
#include <stdio.h>
#include <tmmintrin.h>
int main () {
__m64 a, b;
a.m64_u32[1] = 0x01234567;
a.m64_u32[0] = 0x89ABCDEF;
b.m64_u32[1] = 0xFFDDEECC;
b.m64_u32[0] = 0xBBAA9988;
// A right align value of four should remove the lowest 4 bytes of "b"
__m64 res = _mm_alignr_pi8( a, b, 4 );
printf_s("Original a: 0x%016I64x\nOriginal b: 0x%016I64x\n",
a.m64_u64, b.m64_u64);
printf_s("Result res: 0x%016I64x\n",
res.m64_u64);
_mm_empty();
return 0;
}