Intel® C++ Compiler Classic Developer Guide and Reference

ID 767249
Date 3/31/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

Concatenate Intrinsics

These Supplemental Streaming SIMD Extensions 3 (SSSE3) intrinsics are used concatenation. The prototypes for these intrinsics are in tmmintrin.h.

To use these intrinsics, include the immintrin.h file as follows:

#include <immintrin.h>

_mm_alignr_epi8

extern __m128i _mm_alignr_epi8(__m128i a, __m128i b, int n);

Concatenates a and b, extracts byte-aligned result shifted to the right by n.

Interpreting t1 as 256-bit unsigned integer, a, b, and r as 128-bit unsigned integers:

t1[255:128] = a;
t1[127:0] = b;
t1[255:0] = t1[255:0] >> (8 * n); // unsigned shift
r[127:0] = t1[127:0];

_mm_alignr_pi8

extern __m64 _mm_alignr_pi8(__m64 a, __m64 b, int n);

Concatenates a and b, extracts byte-aligned result shifted to the right by n.

Interpreting t1 as 128-bit unsigned integer, a, b, and r as 64-bit unsigned integers:

t1[127:64] = a;
t1[63:0] = b;
t1[127:0] = t1[127:0] >> (8 * n); // unsigned shift
r[63:0] = t1[63:0];