vec_sll

Purpose

Left shifts a vector by a given number of bits.

This built-in function is valid only when you include the altivec.h file.

Syntax

d=vec_sll(a, b)

Result and argument types

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

Table 1. Types of the returned value and function arguments
d a b1
The same type as argument a vector bool char Any of the following types:

vector unsigned char
vector unsigned short
vector unsigned int

vector signed char
vector unsigned char
vector bool short
vector signed short
vector unsigned short
vector bool int
vector signed int
vector unsigned int
vector pixel
Note:
  1. The least significant three bits of all byte elements in b must be the same.

Result value

The result is produced by shifting the contents of a left by the number of bits specified by the last three bits of the last element of b. The bits that are shifted out are replaced by zeroes.



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