vec_sl
Purpose
Performs a left shift for each element of a vector.
Note: This built-in function is valid only when you specify the -qaltivec option
and include the
altivec.h
file.Syntax
d=vec_sl(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 signed short | vector signed 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 signed long long | vector signed 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 left 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 zeroes.