vec_sra

Purpose

Performs an algebraic right shift for each element of a vector.

Syntax

d=vec_sra(a, b)

Result and argument types

The following table describes the types of the returned value and the function arguments.

d a b
vector signed char vector signed char vector unsigned char
vector unsigned char vector unsigned char vector unsigned char
vector signed short vector signed short vector unsigned short
vector unsigned short vector unsigned short vector unsigned short
vector signed int vector signed int vector unsigned int
vector unsigned int vector unsigned int vector unsigned int
vector signed long long vector signed long long vector unsigned long long
vector unsigned long long vector unsigned long long vector unsigned long long

Result value

Each element of the result vector is the result of algebraically right shifting the corresponding element of a by the number of bits specified by the value of the corresponding element of b, modulo the number of bits in the element. The bits that are shifted out are replaced by copies of the most significant bit of the element of a.



Voice your opinion on getting help information Ask IBM compiler experts a technical question in the IBM XL compilers forum Reach out to us