Intel® C++ Compiler Classic Developer Guide and Reference

ID 767249
Date 12/16/2022
Public

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

Document Table of Contents

<span class='option'>_mm_srav_epi32 </span>

Arithmetic shift of doubleword elements to right according variable values. The corresponding Intel® AVX2 instruction is VPSRAVD.

Syntax

extern __m128i _mm_srav_epi32(__m128i s1, __m128i s2);

Arguments

s1

128-bit integer source vector used for the operation

s2

128-bit integer source vector providing variable values for shift operation

Description

Performs an arithmetic shift of the 32 bits (doublewords) in the individual data elements in source vector s1 to the right by the count value of corresponding data elements in source vector s2. As the bits in the data elements are shifted right, the empty high-order bits are filled with the initial value of the sign bit.

The count values are specified individually in each data element of the second source vector. If the unsigned integer value specified in the respective data element of the second source vector is greater than 31 (for a doubleword), then the destination data elements are filled with the initial value of the sign bit.

Returns

Result of the right-shift operation.