OpenPOWER Library

 A.1. Vector Built-In Functions

Table A.2, “Vector Built-In Functions” summarizes the built-in vector functions for the Power SIMD vector programming API. In addition to these core functions, Section A.6, “Deprecated Compatibility Functions” and Section A.7, “Deprecated Functions” describe functions that correspond to deprecated interfaces of previous versions of the Power SIMD API and the Altivec APIs.

Functions are listed alphabetically; supported prototypes are provided for each function. Prototypes are grouped by integer and floating-point types. Within each group, types are sorted alphabetically, first by type name and then by modifier. Prototypes are first sorted by the built-in result type, which is the output argument. Then, prototypes are sorted by the input arguments; ARG1, ARG2, and ARG3; in order. Table A.1, “Format of Prototypes” shows the format of the prototypes and provides an example.

 

Table A.1. Format of Prototypes

Output Argument

Function

Input Arguments

ARG1

ARG2

ARG3

Modifier

Type

Modifier

Type

Modifier

Type

Modifier

Type

Sort 3

Sort 2

Sort 1

Sort 5

Sort 4

Sort 7

Sort 6

Sort 9

Sort 8

vector unsigned

char

vec_insert

unsigned

char

vector bool

char

signed

int


 

Table A.2. Vector Built-In Functions

Group

Description of Vector Built-In Functions (with Prototypes)

VEC_ABS (ARG1)

Purpose:

Returns a vector that contains the absolute values of the contents of the given vector.

Result value:

The value of each element of the result is the absolute value of the corresponding element of ARG1. For integer vectors, the arithmetic is modular.

vector signed char vec_abs (vector signed char);

vector signed int vec_abs (vector signed int);

vector signed long long vec_abs (vector signed long long);

vector signed short vec_abs (vector signed short);

vector double vec_abs (vector double);

vector float vec_abs (vector float);

VEC_ABSD (ARG1, ARG2)

POWER ISA 3.0

Purpose:

Computes the absolute difference.

Result value:

Each element of the result contains the absolute difference of the corresponding input elements using modulo arithmetic.

POWER ISA 3.0

vector unsigned char vec_absd (vector unsigned char, vector unsigned char);

POWER ISA 3.0

vector unsigned int vec_absd (vector unsigned int, vector unsigned int);

POWER ISA 3.0

vector unsigned short vec_absd (vector unsigned short, vector unsigned short);

VEC_ABSS (ARG1)

Purpose:

Returns a vector containing the saturated absolute values of the contents of the given vector.

Result value:

The value of each element of the result is the saturated absolute value of the corresponding element of ARG1.

vector signed char vec_abss (vector signed char);

vector signed int vec_abss (vector signed int);

vector signed short vec_abss (vector signed short);

VEC_ADD (ARG1, ARG2)

Purpose:

Returns a vector containing the sums of each set of corresponding elements of the given vectors.

Result value:

The value of each element of the result is the sum of the corresponding elements of ARG1 and ARG2. For signed and unsigned integers, modular arithmetic is used.

vector signed char vec_add (vector signed char, vector signed char);

vector unsigned char vec_add (vector unsigned char, vector unsigned char);

vector signed int vec_add (vector signed int, vector signed int);

vector unsigned int vec_add (vector unsigned int, vector unsigned int);

vector signed __int128 vec_add (vector signed __int128, vector signed __int128);

vector unsigned __int128 vec_add (vector unsigned __int128, vector unsigned __int128);

vector signed long long vec_add (vector signed long long, vector signed long long);

vector unsigned long long vec_add (vector unsigned long long, vector unsigned long long);

vector signed short vec_add (vector signed short, vector signed short);

vector unsigned short vec_add (vector unsigned short, vector unsigned short);

vector double vec_add (vector double, vector double);

vector float vec_add (vector float, vector float);

VEC_ADDC (ARG1, ARG2)

Purpose:

Returns a vector containing the carry produced by adding each set of corresponding elements of the given vectors.

Result value:

The value of each element of the result is the carry produced by adding the corresponding elements of ARG1 and ARG2 (1 if there is a carry, 0 otherwise).

vector signed int vec_addc (vector signed int, vector signed int);

vector unsigned int vec_addc (vector unsigned int, vector unsigned int);

vector signed __int128 vec_addc (vector signed __int128, vector signed __int128);

vector unsigned __int128 vec_addc (vector unsigned __int128, vector unsigned __int128);

VEC_ADDE (ARG1, ARG2, ARG3)

Purpose:

Returns a vector containing the result of adding each set of the corresponding elements of ARG1 and ARG2 with a carry (that has a value of either 0 or 1) specified as the ARG3 vector.

Result value:

The value of each element of the result is produced by adding the corresponding elements of ARG1 and ARG2 and a carry specified in ARG3 (1 if there is a carry, 0 otherwise).

vector signed int vec_adde (vector signed int, vector signed int, vector signed int);

vector unsigned int vec_adde (vector unsigned int, vector unsigned int, vector unsigned int);

vector signed __int128 vec_adde (vector signed __int128, vector signed __int128, vector signed __int128);

vector unsigned __int128 vec_adde (vector unsigned __int128, vector unsigned __int128, vector unsigned __int128);

VEC_ADDEC (ARG1, ARG2, ARG3)

Purpose:

Returns a vector containing the carry produced by adding each set of the corresponding elements of ARG1 and ARG2 with a carry (that has a value of either 0 or 1) specified as the ARG3 vector.

Result value:

The value of each element of the result is the carry produced by adding the corresponding elements of ARG1 and ARG2 and a carry specified in ARG3 (1 if there is a carry, 0 otherwise).

vector signed int vec_addec (vector signed int, vector signed int, vector signed int);

vector unsigned int vec_addec (vector unsigned int, vector unsigned int, vector unsigned int);

vector signed __int128 vec_addec (vector signed __int128, vector signed __int128, vector signed __int128);

vector unsigned __int128 vec_addec (vector unsigned __int128, vector unsigned __int128, vector unsigned __int128);

VEC_ADDS (ARG1, ARG2)

Purpose:

Returns a vector containing the saturated sums of each set of corresponding elements of the given vectors.

Result value:

The value of each element of the result is the saturated sum of the corresponding elements of ARG1 and ARG2.

vector signed char vec_adds (vector signed char, vector signed char);

vector unsigned char vec_adds (vector unsigned char, vector unsigned char);

vector signed int vec_adds (vector signed int, vector signed int);

vector unsigned int vec_adds (vector unsigned int, vector unsigned int);

vector signed short vec_adds (vector signed short, vector signed short);

vector unsigned short vec_adds (vector unsigned short, vector unsigned short);

VEC_AND (ARG1, ARG2)

Purpose:

Performs a bitwise AND of the given vectors.

Result value:

The result is the bitwise AND of ARG1 and ARG2.

vector bool char vec_and (vector bool char, vector bool char);

vector signed char vec_and (vector signed char, vector signed char);

vector unsigned char vec_and (vector unsigned char, vector unsigned char);

vector bool int vec_and (vector bool int, vector bool int);

vector signed int vec_and (vector signed int, vector signed int);

vector unsigned int vec_and (vector unsigned int, vector unsigned int);

Phased in.[a]

vector bool long long vec_and (vector bool long long, vector bool long long);

Phased in.[a]

vector signed long long vec_and (vector signed long long, vector signed long long);

Phased in.[a]

vector unsigned long long vec_and (vector unsigned long long, vector unsigned long long);

vector bool short vec_and (vector bool short, vector bool short);

vector signed short vec_and (vector signed short, vector signed short);

vector unsigned short vec_and (vector unsigned short, vector unsigned short);

vector double vec_and (vector double, vector double);

vector float vec_and (vector float, vector float);

VEC_ANDC (ARG1, ARG2)

Purpose:

Performs a bitwise AND of the first argument and the bitwise complement of the second argument.

Result value:

The result is the bitwise AND of ARG1 with the bitwise complement of ARG2.

vector bool char vec_andc (vector bool char, vector bool char);

vector signed char vec_andc (vector signed char, vector signed char);

vector unsigned char vec_andc (vector unsigned char, vector unsigned char);

vector bool int vec_andc (vector bool int, vector bool int);

vector signed int vec_andc (vector signed int, vector signed int);

vector unsigned int vec_andc (vector unsigned int, vector unsigned int);

Phased in.[a]

vector bool long long vec_andc (vector bool long long, vector bool long long);

Phased in.[a]

vector signed long long vec_andc (vector signed long long, vector signed long long);

Phased in.[a]

vector unsigned long long vec_andc (vector unsigned long long, vector unsigned long long);

vector bool short vec_andc (vector bool short, vector bool short);

vector signed short vec_andc (vector signed short, vector signed short);

vector unsigned short vec_andc (vector unsigned short, vector unsigned short);

vector double vec_andc (vector double, vector double);

vector float vec_andc (vector float, vector float);

VEC_AVG (ARG1, ARG2)

Purpose:

Returns a vector containing the average of each set of corresponding elements of the given vectors.

Result value:

The value of each element of the result is the average of the values of the corresponding elements of ARG1 and ARG2.

vector signed char vec_avg (vector signed char, vector signed char);

vector unsigned char vec_avg (vector unsigned char, vector unsigned char);

vector signed int vec_avg (vector signed int, vector signed int);

vector unsigned int vec_avg (vector unsigned int, vector unsigned int);

vector signed short vec_avg (vector signed short, vector signed short);

vector unsigned short vec_avg (vector unsigned short, vector unsigned short);

VEC_BPERM (ARG1, ARG2)

Purpose:

Gathers up to 16 1-bit values from a quadword or from each doubleword element in the specified order, zeroing other bits.

Result value:

When the type of ARG1 is vector unsigned char or vector unsigned __int128:

  • For each i (0 ≤ i < 16), let bit index j denote the byte value of the i-th element of ARG2.

  • If bit index j is greater than or equal to 128, bit i of doubleword 0 is set to 0.

  • If bit index j is smaller than 128, bit i of the result is set to the value of the j-th bit of input ARG1.

  • All other bits are zeroed.

When the type of ARG1 is vector unsigned long long:

  • For each doubleword element i (0 ≤ i < 2) of ARG1, regardless of the input operand type specified for ARG1:

    • For each j (0 ≤ j < 8), let bit index k denote the byte value of the j-th element of ARG2.

    • If bit index k is greater than or equal to 64, bit j of element i is set to 0.

    • If bit index k is less than 64, bit j of element i is set to the value of the k-th bit of element i of input ARG1.

    • All other bits are zeroed.

[Note]Note

In the above description, all bit and byte numberings within each element denote big-endian (i.e., left-to-right) order.

vector unsigned char vec_bperm (vector unsigned char, vector unsigned char);

Phased in.[a]

vector unsigned long long vec_bperm (vector unsigned __int128, vector unsigned char);

POWER ISA 3.0

Phased in.[a]

vector unsigned long long vec_bperm (vector unsigned long long, vector unsigned char);

VEC_CEIL (ARG1)

Purpose:

Returns a vector containing the smallest representable floating-point integral values greater than or equal to the values of the corresponding elements of the given vector.

Result value:

Each element of the result contains the smallest representable floating-point integral value greater than or equal to the value of the corresponding element of ARG1.

vector double vec_ceil (vector double);

vector float vec_ceil (vector float);

VEC_CMPB (ARG1, ARG2)

Purpose:

Performs a bounds comparison of each set of corresponding elements of the given vectors.

Result value:

Each element of the result has the value 0 if the value of the corresponding element of ARG1 is less than or equal to the value of the corresponding element of ARG2 and greater than or equal to the negative of the value of the corresponding element of ARG2. Otherwise:

  • If an element of ARG2 is greater than or equal to 0, then the value of the corresponding element of the result is 0 if the absolute value of the corresponding element of ARG1 is equal to the value of the corresponding element of ARG2. The value is negative if it is greater than the value of the corresponding element of ARG2. It is positive if it is less than the value of the corresponding element of ARG2.

  • If an element of ARG2 is less than 0, then the value of the element of the result is positive if the value of the corresponding element of ARG1 is less than or equal to the value of the element of ARG2. Otherwise. it is negative.

vector signed int vec_cmpb (vector float, vector float);

VEC_CMPEQ (ARG1, ARG2)

Purpose:

Returns a vector containing the results of comparing each set of corresponding elements of the given vectors for equality.

Result value:

For each element of the result, the value of each bit is 1 if the corresponding elements of ARG1 and ARG2 are equal. Otherwise, the value of each bit is 0.

vector bool char vec_cmpeq (vector bool char, vector bool char);

vector bool char vec_cmpeq (vector signed char, vector signed char);

vector bool char vec_cmpeq (vector unsigned char, vector unsigned char);

vector bool int vec_cmpeq (vector bool int, vector bool int);

vector bool int vec_cmpeq (vector signed int, vector signed int);

vector bool int vec_cmpeq (vector unsigned int, vector unsigned int);

vector bool long long vec_cmpeq (vector bool long long, vector bool long long);

vector bool long long vec_cmpeq (vector signed long long, vector signed long long);

vector bool long long vec_cmpeq (vector unsigned long long, vector unsigned long long);

vector bool short vec_cmpeq (vector bool short, vector bool short);

vector bool short vec_cmpeq (vector signed short, vector signed short);

vector bool short vec_cmpeq (vector unsigned short, vector unsigned short);

vector bool int vec_cmpeq (vector float, vector float);

vector bool long long vec_cmpeq (vector double, vector double);

VEC_CMPGE (ARG1, ARG2)

Purpose:

Returns a vector containing the results of a greater-than-or-equal-to comparison between each set of corresponding elements of the given vectors.

Result value:

For each element of the result, the value of each bit is 1 if the value of the corresponding element of ARG1 is greater than or equal to the value of the corresponding element of ARG2. Otherwise, the value of each bit is 0.

vector bool char vec_cmpge (vector signed char, vector signed char);

vector bool char vec_cmpge (vector unsigned char, vector unsigned char);

vector bool int vec_cmpge (vector signed int, vector signed int);

vector bool int vec_cmpge (vector unsigned int, vector unsigned int);

vector bool long long vec_cmpge (vector signed long long, vector signed long long);

vector bool long long vec_cmpge (vector unsigned long long, vector unsigned long long);

vector bool short vec_cmpge (vector signed short, vector signed short);

vector bool short vec_cmpge (vector unsigned short, vector unsigned short);

vector bool int vec_cmpge (vector float, vector float);

vector bool long long vec_cmpge (vector double, vector double);

VEC_CMPGT (ARG1, ARG2)

Purpose:

Returns a vector containing the results of a greater-than comparison between each set of corresponding elements of the given vectors.

Result value:

For each element of the result, the value of each bit is 1 if the value of the corresponding element of ARG1 is greater than the value of the corresponding element of ARG2. Otherwise, the value of each bit is 0.

vector bool char vec_cmpgt (vector signed char, vector signed char);

vector bool char vec_cmpgt (vector unsigned char, vector unsigned char);

vector bool int vec_cmpgt (vector signed int, vector signed int);

vector bool int vec_cmpgt (vector unsigned int, vector unsigned int);

vector bool long long vec_cmpgt (vector signed long long, vector signed long long);

vector bool long long vec_cmpgt (vector unsigned long long, vector unsigned long long);

vector bool short vec_cmpgt (vector signed short, vector signed short);

vector bool short vec_cmpgt (vector unsigned short, vector unsigned short);

vector bool int vec_cmpgt (vector float, vector float);

vector bool long long vec_cmpgt (vector double, vector double);

VEC_CMPLE (ARG1, ARG2)

Purpose:

Returns a vector containing the results of a less-than-or-equal-to comparison between each set of corresponding elements of the given vectors.

Result value:

For each element of the result, the value of each bit is 1 if the value of the corresponding element of ARG1 is less than or equal to the value of the corresponding element of ARG2. Otherwise, the value of each bit is 0.

vector bool char vec_cmple (vector signed char, vector signed char);

vector bool char vec_cmple (vector unsigned char, vector unsigned char);

vector bool int vec_cmple (vector signed int, vector signed int);

vector bool int vec_cmple (vector unsigned int, vector unsigned int);

vector bool long long vec_cmple (vector signed long long, vector signed long long);

vector bool long long vec_cmple (vector unsigned long long, vector unsigned long long);

vector bool short vec_cmple (vector signed short, vector signed short);

vector bool short vec_cmple (vector unsigned short, vector unsigned short);

vector bool int vec_cmple (vector float, vector float);

vector bool long long vec_cmple (vector double, vector double);

VEC_CMPLT (ARG1, ARG2)

Purpose:

Returns a vector containing the results of a less-than comparison between each set of corresponding elements of the given vectors.

Result value:

For each element of the result, the value of each bit is 1 if the value of the corresponding element of ARG1 is less than the value of the corresponding element of ARG2. Otherwise, the value of each bit is 0.

vector bool char vec_cmplt (vector signed char, vector signed char);

vector bool char vec_cmplt (vector unsigned char, vector unsigned char);

vector bool int vec_cmplt (vector signed int, vector signed int);

vector bool int vec_cmplt (vector unsigned int, vector unsigned int);

vector bool long long vec_cmplt (vector signed long long, vector signed long long);

vector bool long long vec_cmplt (vector unsigned long long, vector unsigned long long);

vector bool short vec_cmplt (vector signed short, vector signed short);

vector bool short vec_cmplt (vector unsigned short, vector unsigned short);

vector bool int vec_cmplt (vector float, vector float);

vector bool long long vec_cmplt (vector double, vector double);

VEC_CMPNE (ARG1, ARG2)

Purpose:

Returns a vector containing the results of comparing each set of corresponding elements of the given vectors for inequality.

Result value:

For each element of the result, the value of each bit is 1 if the corresponding elements of ARG1 and ARG2 are not equal. Otherwise, the value of each bit is 0.

vector bool char vec_cmpne (vector bool char, vector bool char);

vector bool char vec_cmpne (vector signed char, vector signed char);

vector bool char vec_cmpne (vector unsigned char, vector unsigned char);

vector bool int vec_cmpne (vector bool int, vector bool int);

vector bool int vec_cmpne (vector signed int, vector signed int);

vector bool int vec_cmpne (vector unsigned int, vector unsigned int);

vector bool long long vec_cmpne (vector bool long long, vector bool long long);

vector bool long long vec_cmpne (vector signed long long, vector signed long long);

vector bool long long vec_cmpne (vector unsigned long long, vector unsigned long long);

vector bool short vec_cmpne (vector bool short, vector bool short);

vector bool short vec_cmpne (vector signed short, vector signed short);

vector bool short vec_cmpne (vector unsigned short, vector unsigned short);

vector bool long long vec_cmpne (vector double, vector double);

vector bool int vec_cmpne (vector float, vector float);

VEC_CMPNEZ (ARG1, ARG2)

POWER ISA 3.0

Purpose:

Returns a vector containing the results of comparing each set of corresponding elements of the given vectors for inequality or for an element with a 0 value.

Result value:

For each element of the result, the value of each bit is 1 if the corresponding elements of ARG1 and

ARG2 are not equal, or if the ARG1 element or the ARG2 element is 0. Otherwise, the value of each bit is 0.

POWER ISA 3.0

vector bool char vec_cmpnez (vector signed char, vector signed char);

POWER ISA 3.0

vector bool char vec_cmpnez (vector unsigned char, vector unsigned char);

POWER ISA 3.0

vector bool int vec_cmpnez (vector signed int, vector signed int);

POWER ISA 3.0

vector bool int vec_cmpnez (vector unsigned int, vector unsigned int);

POWER ISA 3.0

vector bool short vec_cmpnez (vector signed short, vector signed short);

POWER ISA 3.0

vector bool short vec_cmpnez (vector unsigned short, vector unsigned short);

VEC_CNTLZ (ARG1)

Purpose:

Returns a vector containing the number of most-significant bits equal to 0 of each corresponding element of the given vector.

Result value:

The value of each element of the result is set to the number of leading zeros of the corresponding element of ARG1.

Phased in.[a]

vector signed char vec_cntlz (vector signed char);

Phased in.[a]

vector unsigned char vec_cntlz (vector unsigned char);

Phased in.[a]

vector signed int vec_cntlz (vector signed int);

Phased in.[a]

vector unsigned int vec_cntlz (vector unsigned int);

Phased in.[a]

vector signed long long vec_cntlz (vector signed long long);

Phased in.[a]

vector unsigned long long vec_cntlz (vector unsigned long long);

Phased in.[a]

vector signed short vec_cntlz (vector signed short);

Phased in.[a]

vector unsigned short vec_cntlz (vector unsigned short);

VEC_CNTLZ_LSBB (ARG1)

POWER ISA 3.0

Purpose:

Returns the number of leading byte elements (starting at the lowest-numbered element) of a vector that have a least-significant bit of 0.

Result value:

The number of leading byte elements (starting at the lowest-numbered element) of a vector that have a least-significant bit of 0.

POWER ISA 3.0

signed int vec_cntlz_lsbb (vector signed char);

POWER ISA 3.0

signed int vec_cntlz_lsbb (vector unsigned char);

VEC_CNTTZ (ARG1)

POWER ISA 3.0

Purpose:

Returns a vector containing the number of least-significant bits equal to 0 of each corresponding element of the given vector.

Result value:

The value of each element of the result is set to the number of trailing zeros of the corresponding element of ARG1.

POWER ISA 3.0

vector signed char vec_cnttz (vector signed char);

POWER ISA 3.0

vector unsigned char vec_cnttz (vector unsigned char);

POWER ISA 3.0

vector signed int vec_cnttz (vector signed int);

POWER ISA 3.0

vector unsigned int vec_cnttz (vector unsigned int);

POWER ISA 3.0

vector signed long long vec_cnttz (vector signed long long);

POWER ISA 3.0

vector unsigned long long vec_cnttz (vector unsigned long long);

POWER ISA 3.0

vector signed short vec_cnttz (vector signed short);

POWER ISA 3.0

vector unsigned short vec_cnttz (vector unsigned short);

VEC_CNTTZ_LSBB (ARG1)

POWER ISA 3.0

Purpose:

Returns the number of trailing byte elements (starting at the highest-numbered element) of a vector that have a least-significant bit of 0.

Result value:

The number of trailing byte elements (starting at the highest-numbered element) of a vector that have a least-significant bit of 0.

POWER ISA 3.0

signed int vec_cnttz_lsbb (vector signed char);

POWER ISA 3.0

signed int vec_cnttz_lsbb (vector unsigned char);

VEC_CPSGN(ARG1, ARG2)

Purpose:

Returns a vector by copying the sign of the elements in vector ARG1 to the sign of the corresponding elements in vector ARG2.

Result value:

For each element of the result, copies the sign of the corresponding element in vector ARG1 to the sign of the corresponding element in vector ARG2.

Phased in.[a]

vector float vec_cpsgn (vector float, vector float);

Phased in.[a]

vector double vec_cpsgn (vector double, vector double);

VEC_CTF (ARG1, ARG2)

Purpose:

Converts an integer vector into a floating-point vector.

Result value:

The value of each element of the result is the closest floating-point approximation of the value of the corresponding element of ARG1 divided by 2 to the power of ARG2, which should be in the range 0–31.

vector float vec_ctf (vector signed int, const int);

vector float vec_ctf (vector unsigned int, const int);

VEC_CTS (ARG1, ARG2)

Purpose:

Converts a real vector into a vector signed int.

Result value:

The value of each element of the result is the saturated signed-integer value, truncated towards zero, obtained by multiplying the corresponding element of ARG1 by 2 to the power of ARG2, which should be in the range 0–31.

vector signed int vec_cts (vector float, const int);

VEC_CTU (ARG1, ARG2)

Purpose:

Converts a real vector into a vector unsigned int.

Result value:

The value of each element of the result is the saturated unsigned-integer value, truncated towards zero, obtained by multiplying the corresponding element of ARG1 by 2 to the power of ARG2, which should be in the range 0–31.

vector unsigned int vec_ctu (vector float, const int);

VEC_DIV (ARG1, ARG2)

Purpose:

Divides the elements in ARG1 by the corresponding elements in ARG2 and then assigns the result to corresponding elements in the result vector. This function emulates the operation on integer vectors.

Result value:

The value of each element of the result is obtained by dividing the corresponding element of ARG1 by the corresponding element of ARG2.

vector signed long long vec_div (vector signed long long, vector signed long long);

vector unsigned long long vec_div (vector unsigned long long, vector unsigned long long);

vector double vec_div (vector double, vector double);

vector float vec_div (vector float, vector float);

VEC_DOUBLE (ARG1)

Purpose:

Converts a vector of long integers into a vector of double-precision numbers.

Result value:

Target elements are computed by converting the respective input elements.

vector double vec_double (vector signed long long);

vector double vec_double (vector unsigned long long);

VEC_DOUBLEE (ARG1)

Purpose:

Converts an input vector to a vector of double-precision numbers.

Result value:

Target elements 0 and 1 are set to the converted values of source elements 0 and 2.

vector double vec_doublee (vector signed int);

vector double vec_doublee (vector unsigned int);

vector double vec_doublee (vector float);

VEC_DOUBLEH (ARG1)

Purpose:

Converts an input vector to a vector of double-precision floating-point numbers.

Result value:

Target elements 0 and 1 are set to the converted values of source elements 0 and 1.

vector double vec_doubleh (vector signed int);

vector double vec_doubleh (vector unsigned int);

vector double vec_doubleh (vector float);

VEC_DOUBLEL (ARG1)

Purpose:

Converts an input vector to a vector of double-precision floating-point numbers.

Result value:

Target elements 0 and 1 are set to the converted values of source elements 2 and 3.

vector double vec_doublel (vector signed int);

vector double vec_doublel (vector unsigned int);

vector double vec_doublel (vector float);

VEC_DOUBLEO (ARG1)

Purpose:

Converts an input vector to a vector of double-precision numbers.

Result value:

Target elements 0 and 1 are set to the converted values of source elements 1 and 3.

vector double vec_doubleo (vector signed int);

vector double vec_doubleo (vector unsigned int);

vector double vec_doubleo (vector float);

VEC_EQV (ARG1, ARG2)

Purpose:

Performs a bitwise XNOR of the given vectors.

Result value:

The result is the bitwise XNOR of ARG1 and ARG2.

vector bool char vec_eqv (vector bool char, vector bool char);

vector signed char vec_eqv (vector signed char, vector signed char);

vector unsigned char vec_eqv (vector unsigned char, vector unsigned char);

vector bool int vec_eqv (vector bool int, vector bool int);

vector signed int vec_eqv (vector signed int, vector signed int);

vector unsigned int vec_eqv (vector unsigned int, vector unsigned int);

vector bool long long vec_eqv (vector bool long long, vector bool long long);

vector signed long long vec_eqv (vector signed long long, vector signed long long);

vector unsigned long long vec_eqv (vector unsigned long long, vector unsigned long long);

vector bool short vec_eqv (vector bool short, vector bool short);

vector signed short vec_eqv (vector signed short, vector signed short);

vector unsigned short vec_eqv (vector unsigned short, vector unsigned short);

vector double vec_eqv (vector double, vector double);

vector float vec_eqv (vector float, vector float);

VEC_EXPTE (ARG1)

Purpose:

Returns a vector containing estimates of 2 raised to the power of the corresponding elements of the given vector.

Result value:

Each element of the result contains the estimated value of 2 raised to the power of the corresponding element of ARG1.

vector float vec_expte (vector float);

VEC_EXTRACT (ARG1, ARG2)

Purpose:

Returns the value of the ARG1 element indicated by the ARG2 parameter.

Result value:

This function uses modular arithmetic on ARG2 to determine the element number. For example, if ARG2 is out of range, the compiler uses ARG2 modulo the number of elements in the vector to determine the element position.

signed char vec_extract (vector signed char, signed int);

unsigned char vec_extract (vector bool char, signed int);

unsigned char vec_extract (vector unsigned char, signed int);

signed int vec_extract (vector signed int, signed int);

unsigned int vec_extract (vector bool int, signed int);

unsigned int vec_extract (vector unsigned int, signed int);

signed long long vec_extract (vector signed long long, signed int);

unsigned long long vec_extract (vector bool long long, signed int);

unsigned long long vec_extract (vector unsigned long long, signed int);

signed short vec_extract (vector signed short, signed int);

unsigned short vec_extract (vector bool short, signed int);

unsigned short vec_extract (vector unsigned short, signed int);

double vec_extract (vector double, signed int);

float vec_extract (vector float, signed int);

POWER ISA 3.0

Phased in.[a]

_Float16 vec_extract (vector _Float16, signed int);

VEC_EXTRACT_EXP (ARG1)

POWER ISA 3.0

Purpose:

Extracts an exponent from a floating-point number.

Result value:

Each element of the returned integer vector is extracted from the exponent field of the corresponding floating-point vector element.

The extracted exponents of ARG1 are returned as right-justified unsigned integers containing biased exponents, in accordance with the exponent representation specified by IEEE 754, without further processing.

POWER ISA 3.0

vector unsigned long long vec_extract_exp (vector double);

POWER ISA 3.0

vector unsigned int vec_extract_exp (vector float);

VEC_EXTRACT_FP32_ FROM_SHORTH (ARG1)

POWER ISA 3.0

Purpose:

Extracts four single-precision floating-point numbers from the high elements of a vector of eight 16-bit elements, interpreting each element as a 16-bit floating-point number in IEEE format.

Result value:

The first four elements are interpreted as 16-bit floating-point numbers in IEEE format, and extended to single-precision format, returning a vector with four single-precision IEEE numbers.

POWER ISA 3.0

vector float vec_extract_fp32_from_shorth (vector unsigned short);

VEC_EXTRACT_FP32_ FROM_SHORTL (ARG1)

POWER ISA 3.0

Purpose

Extracts four single-precision floating-point numbers from the low elements of a vector of eight 16-bit elements, interpreting each element as a 16-bit floating-point number in IEEE format.

Result value:

The last four elements are interpreted as 16-bit floating-point numbers in IEEE format, and extended to single-precision format, returning a vector with four single-precision IEEE numbers.

POWER ISA 3.0

vector float vec_extract_fp32_from_shortl (vector unsigned short);

VEC_EXTRACT_SIG (ARG1)

POWER ISA 3.0

Purpose:

Extracts a significand (mantissa) from a floating-point number.

Result value:

Each element of the returned integer vector is extracted from the significand (mantissa) field of the corresponding floating-point vector element.

The significand is from the corresponding floating-point number in accordance with the IEEE format. The returned result includes the implicit leading digit. The value of that digit is not encoded in the IEEE format, but is implied by the exponent.

POWER ISA 3.0

vector unsigned long long vec_extract_sig (vector double);

POWER ISA 3.0

vector unsigned int vec_extract_sig (vector float);

VEC_EXTRACT4B (ARG1, ARG2)

POWER ISA 3.0

Purpose:

Extracts a word from a vector at a byte position.

Result value:

The first doubleword element of the result contains the zero-extended extracted word from ARG1. The second doubleword is set to 0. ARG2 specifies the least-significant byte number (0–12) of the word to be extracted.

POWER ISA 3.0

vector unsigned long long vec_extract4b (vector unsigned char, const int);

VEC_FIRST_MATCH_INDEX (ARG1, ARG2)

POWER ISA 3.0

Purpose:

Performs a comparison of equality on each of the corresponding elements of ARG1 and ARG2, and returns the first position of equality.

Result value:

Returns the element index of the position of the first character match. If no match, returns the number of characters as an element count in the vector argument.

POWER ISA 3.0

unsigned int vec_first_match_index (vector signed char, vector signed char);

POWER ISA 3.0

unsigned int vec_first_match_index (vector unsigned char, vector unsigned char);

POWER ISA 3.0

unsigned int vec_first_match_index (vector signed int, vector signed int);

POWER ISA 3.0

unsigned int vec_first_match_index (vector unsigned int, vector unsigned int);

POWER ISA 3.0

unsigned int vec_first_match_index (vector signed short, vector signed short);

POWER ISA 3.0

unsigned int vec_first_match_index (vector unsigned short, vector unsigned short);

VEC_FIRST_MATCH_OR_EOS_ INDEX (ARG1, ARG2)

POWER ISA 3.0

Purpose:

Performs a comparison of equality on each of the corresponding elements of ARG1 and ARG2. Returns the first position of equality, or the zero string terminator.

Result value:

Returns the element index of the position of either the first character match or an end-of-string (EOS) terminator. If no match or terminator, returns the number of characters as an element count in the vector argument.

POWER ISA 3.0

unsigned int vec_first_match_or_eos_index (vector signed char, vector signed char);

POWER ISA 3.0

unsigned int vec_first_match_or_eos_index (vector unsigned char, vector unsigned char);

POWER ISA 3.0

unsigned int vec_first_match_or_eos_index (vector signed int, vector signed int);

POWER ISA 3.0

unsigned int vec_first_match_or_eos_index (vector unsigned int, vector unsigned int);

POWER ISA 3.0

unsigned int vec_first_match_or_eos_index (vector signed short, vector signed short);

POWER ISA 3.0

unsigned int vec_first_match_or_eos_index (vector unsigned short, vector unsigned short);

VEC_FIRST_MISMATCH_INDEX (ARG1, ARG2)

POWER ISA 3.0

Purpose:

Performs a comparison of inequality on each of the corresponding elements of ARG1 and ARG2, and returns the first position of inequality.

Result value:

Returns the element index of the position of the first character mismatch. If no mismatch, returns the number of characters as an element count in the vector argument.

POWER ISA 3.0

unsigned int vec_first_mismatch_index (vector signed char, vector signed char);

POWER ISA 3.0

unsigned int vec_first_mismatch_index (vector unsigned char, vector unsigned char);

POWER ISA 3.0

unsigned int vec_first_mismatch_index (vector signed int, vector signed int);

POWER ISA 3.0

unsigned int vec_first_mismatch_index (vector unsigned int, vector unsigned int);

POWER ISA 3.0

unsigned int vec_first_mismatch_index (vector signed short, vector signed short);

POWER ISA 3.0

unsigned int vec_first_mismatch_index (vector unsigned short, vector unsigned short);

VEC_FIRST_MISMATCH_OR_ EOS_INDEX (ARG1, ARG2)

POWER ISA 3.0

Purpose:

Performs a comparison of inequality on each of the corresponding elements of ARG1 and ARG2. Returns the first position of inequality, or the zero string terminator.

Result value:

Returns the element index of the position of either the first character mismatch or an end-of-string (EOS) terminator. If no mismatch or terminator, returns the number of characters as an element count in the vector argument.

POWER ISA 3.0

unsigned int vec_first_mismatch_or_eos_index (vector signed char, vector signed char);

POWER ISA 3.0

unsigned int vec_first_mismatch_or_eos_index (vector unsigned char, vector unsigned char);

POWER ISA 3.0

unsigned int vec_first_mismatch_or_eos_index (vector signed int, vector signed int);

POWER ISA 3.0

unsigned int vec_first_mismatch_or_eos_index (vector unsigned int, vector unsigned int);

POWER ISA 3.0

unsigned int vec_first_mismatch_or_eos_index (vector signed short, vector signed short);

POWER ISA 3.0

unsigned int vec_first_mismatch_or_eos_index (vector unsigned short, vector unsigned short);

VEC_FLOAT (ARG1)

Purpose:

Converts a vector of integers to a vector of single-precision floating-point numbers.

Result value:

Target elements are obtained by converting the respective source elements to single-precision floating-point numbers.

vector float vec_float (vector signed int);

vector float vec_float (vector unsigned int);

VEC_FLOAT2 (ARG1, ARG2)

Purpose:

Converts an input vector to a vector of single-precision numbers.

Result value:

Target elements are obtained by converting the source elements to single-precision numbers as follows:

  • Target elements 0 and 1 from source 0

  • Target elements 2 and 3 from source 1

vector float vec_float2 (vector signed long long, vector signed long long);

vector float vec_float2 (vector unsigned long long, vector unsigned long long);

vector float vec_float2 (vector double, vector double);

VEC_FLOATE (ARG2)

Purpose:

Converts an input vector to a vector of single-precision numbers.

Result value:

The even-numbered target elements are obtained by converting the source elements to single-precision numbers, using the current floating-point rounding mode.

vector float vec_floate (vector signed long long);

vector float vec_floate (vector unsigned long long);

vector float vec_floate (vector double);

VEC_FLOATH (ARG2)

POWER ISA 3.0

Phased in.[a]

Purpose:

Converts a vector to a vector of single-precision floating-point numbers.

Result value:

Target elements 0 through 3 are set to the converted values of source elements 0 through 3, respectively.

POWER ISA 3.0

vector float vec_floath (vector _Float16);

VEC_FLOATL (ARG2)

POWER ISA 3.0

Phased in.[a]

Purpose:

Converts a vector to a vector of single-precision floating-point numbers.

Result value:

Target elements 0 through 3 are set to the converted values of source elements 4 through 7, respectively.

POWER ISA 3.0

vector float vec_floatl (vector _Float16);

VEC_FLOATO (ARG2)

Purpose:

Converts an input vector to a vector of single-precision numbers.

Result value:

The odd-numbered target elements are obtained by converting the source elements to single-precision numbers, using the current floating-point rounding mode.

vector float vec_floato (vector signed long long);

vector float vec_floato (vector unsigned long long);

vector float vec_floato (vector double);

VEC_FLOOR (ARG1)

Purpose:

Returns a vector containing the largest representable floating-point integral values less than or equal to the values of the corresponding elements of the given vector.

Result value:

Each element of the result contains the largest representable floating-point integral value less than or equal to the value of the corresponding element of ARG1.

vector double vec_floor (vector double);

vector float vec_floor (vector float);

VEC_GB (ARG1)

Purpose:

Performs a gather-bits operation on the input.

Result value:

Within each doubleword, let x(i) (0 ≤ i < 8) denote the byte elements of the corresponding input doubleword element, with x(7) the most-significant byte. For each pair of i and j (0 ≤ i < 8, 0 ≤ j < 8), the j-th bit of the i-th byte element of the result is set to the value of the i-th bit of the j-th byte element of the input.

vector unsigned char vec_gb (vector unsigned char);

VEC_INSERT (ARG1, ARG2, ARG3)

Purpose:

Returns a copy of vector ARG2 with element ARG3 replaced by the value of ARG1.

Result value:

A copy of vector ARG2 with element ARG3 replaced by the value of ARG1. This function uses modular arithmetic on ARG3 to determine the element number. For example, if ARG3 is out of range, the compiler uses ARG3 modulo the number of elements in the vector to determine the element position.

vector signed char vec_insert (signed char, vector signed char, signed int);

vector unsigned char vec_insert (unsigned char, vector unsigned char, signed int);

vector signed int vec_insert (signed int, vector signed int, signed int);

vector unsigned int vec_insert (unsigned int, vector unsigned int, signed int);

vector signed long long vec_insert (signed long long, vector signed long long, signed int);

vector unsigned long long vec_insert (unsigned long long, vector unsigned long long, signed int);

vector signed short vec_insert (signed short, vector signed short, signed int);

vector unsigned short vec_insert (unsigned short, vector unsigned short, signed int);

vector double vec_insert (double, vector double, signed int);

vector float vec_insert (float, vector float, signed int);

POWER ISA 3.0

Phased in.[a]

vector _Float16 vec_insert (_Float16, vector _Float16, signed int);

VEC_INSERT_EXP (ARG1, ARG2)

POWER ISA 3.0

Purpose:

Inserts an exponent into a floating-point number.

Result value:

Each element of the returned floating-point vector is generated by combining the exponent specified by the corresponding element of ARG2 with the sign and significand of the corresponding element of ARG1.

The inserted exponent of ARG2 is treated as a right-justified unsigned integer containing a biased exponent, in accordance with the exponent representation specified by IEEE 754. It is combined with the sign and significand of ARG1 without further processing.

POWER ISA 3.0

vector double vec_insert_exp (vector double, vector unsigned long long);

POWER ISA 3.0

vector double vec_insert_exp (vector unsigned long long, vector unsigned long long);

POWER ISA 3.0

vector float vec_insert_exp (vector float, vector unsigned int);

POWER ISA 3.0

vector float vec_insert_exp (vector unsigned int, vector unsigned int);

VEC_INSERT4B (ARG1, ARG2, ARG3)

POWER ISA 3.0

Purpose:

Inserts a word into a vector at a byte position.

Result value:

Let W be the first doubleword element of ARG1, truncated to 32 bits. The result vector is formed by inserting W into ARG2 at the byte position (0–12) specified by ARG3.

POWER ISA 3.0

vector unsigned char vec_insert4b (vector signed int, vector unsigned char, const int);

POWER ISA 3.0

vector unsigned char vec_insert4b (vector unsigned int, vector unsigned char, const int);

VEC_LOGE (ARG1)

Purpose:

Returns a vector containing estimates of the base-2 logarithms of the corresponding elements of the given vector.

Result value:

Each element of the result contains the estimated value of the base-2 logarithm of the corresponding element of ARG1.

vector float vec_loge (vector float);

VEC_MADD (ARG1, ARG2, ARG3)

Purpose:

Returns a vector containing the results of performing a fused multiply-add operation for each corresponding set of elements of the given vectors.

Result value:

The value of each element of the result is the product of the values of the corresponding elements of ARG1 and ARG2, added to the value of the corresponding element of ARG3.

vector signed short vec_madd (vector signed short, vector signed short, vector signed short);

vector signed short vec_madd (vector signed short, vector unsigned short, vector unsigned short);

vector signed short vec_madd (vector unsigned short, vector signed short, vector signed short);

vector unsigned short vec_madd (vector unsigned short, vector unsigned short, vector unsigned short);

vector double vec_madd (vector double, vector double, vector double);

vector float vec_madd (vector float, vector float, vector float);

VEC_MADDS (ARG1, ARG2, ARG3)

Purpose:

Returns a vector containing the results of performing a saturated multiply-high-and-add operation for each corresponding set of elements of the given vectors.

Result value:

For each element of the result, the value is produced in the following way: The values of the corresponding elements of ARG1 and ARG2 are multiplied. The value of the 17 most-significant bits of this product is then added, using 16-bit-saturated addition, to the value of the corresponding element of ARG3.

vector signed short vec_madds (vector signed short, vector signed short, vector signed short);

VEC_MAX (ARG1, ARG2)

Purpose

Returns a vector containing the maximum value from each set of corresponding elements of the given vectors.

Result value

The value of each element of the result is the maximum of the values of the corresponding elements of ARG1 and ARG2.

vector signed char vec_max (vector signed char, vector signed char);

vector unsigned char vec_max (vector unsigned char, vector unsigned char);

vector signed int vec_max (vector signed int, vector signed int);

vector unsigned int vec_max (vector unsigned int, vector unsigned int);

vector signed long long vec_max (vector signed long long, vector signed long long);

vector unsigned long long vec_max (vector unsigned long long, vector unsigned long long);

vector signed short vec_max (vector signed short, vector signed short);

vector unsigned short vec_max (vector unsigned short, vector unsigned short);

vector double vec_max (vector double, vector double);

vector float vec_max (vector float, vector float);

VEC_MERGEE (ARG1, ARG2)

Purpose:

Merges the even-numbered values from the two vectors.

Result value:

The even-numbered elements of ARG1 are stored into the even-numbered elements of the result. The even-numbered elements of ARG2 are stored in the odd-numbered elements of the result.

Phased in.[a]

vector bool int vec_mergee (vector bool int, vector bool int);

Phased in.[a]

vector signed int vec_mergee (vector signed int, vector signed int);

Phased in.[a]

vector unsigned int vec_mergee (vector unsigned int, vector unsigned int);

Phased in.[a]

vector bool long long vec_mergee (vector bool long long, vector bool long long);

Phased in.[a]

vector signed long long vec_mergee (vector signed long long, vector signed long long);

Phased in.[a]

vector unsigned long long vec_mergee (vector unsigned long long, vector unsigned long long);

Phased in.[a]

vector float vec_mergee (vector float, vector float);

Phased in.[a]

vector double vec_mergee (vector double, vector double);

VEC_MERGEH (ARG1, ARG2)

Purpose:

Merges the most-significant halves of two vectors.

Result value:

Assume that the elements of each vector are numbered beginning with 0. The even-numbered elements of the result are taken, in order, from the elements in the most-significant 8 bytes of ARG1. The odd-numbered elements of the result are taken, in order, from the elements in the most-significant 8 bytes of ARG2.

vector bool char vec_mergeh (vector bool char, vector bool char);

vector signed char vec_mergeh (vector signed char, vector signed char);

vector unsigned char vec_mergeh (vector unsigned char, vector unsigned char);

vector bool int vec_mergeh (vector bool int, vector bool int);

vector signed int vec_mergeh (vector signed int, vector signed int);

vector unsigned int vec_mergeh (vector unsigned int, vector unsigned int);

vector bool long long vec_mergeh (vector bool long long, vector bool long long);

vector signed long long vec_mergeh (vector signed long long, vector signed long long);

Phased in.[a]

vector unsigned long long vec_mergeh (vector unsigned long long, vector unsigned long long);

vector pixel vec_mergeh (vector pixel, vector pixel);

vector bool short vec_mergeh (vector bool short, vector bool short);

vector signed short vec_mergeh (vector signed short, vector signed short);

vector unsigned short vec_mergeh (vector unsigned short, vector unsigned short);

vector double vec_mergeh (vector double, vector double);

vector float vec_mergeh (vector float, vector float);

POWER ISA 3.0

Phased in.[a]

vector _Float16 vec_mergeh (vector _Float16, vector _Float16);

VEC_MERGEL (ARG1, ARG2)

Purpose:

Merges the least-significant halves of two vectors.

Result value:

Assume that the elements of each vector are numbered beginning with 0. The even-numbered elements of the result are taken, in order, from the elements in the least-significant 8 bytes of ARG1. The odd-numbered elements of the result are taken, in order, from the elements in the least-significant 8 bytes of ARG2.

vector bool char vec_mergel (vector bool char, vector bool char);

vector signed char vec_mergel (vector signed char, vector signed char);

vector unsigned char vec_mergel (vector unsigned char, vector unsigned char);

vector bool int vec_mergel (vector bool int, vector bool int);

vector signed int vec_mergel (vector signed int, vector signed int);

vector unsigned int vec_mergel (vector unsigned int, vector unsigned int);

Phased in.[a]

vector bool long long vec_mergel (vector bool long long, vector bool long long);

vector signed long long vec_mergel (vector signed long long, vector signed long long);

Phased in.[a]

vector unsigned long long vec_mergel (vector unsigned long long, vector unsigned long long);

vector pixel vec_mergel (vector pixel, vector pixel);

vector bool short vec_mergel (vector bool short, vector bool short);

vector signed short vec_mergel (vector signed short, vector signed short);

vector unsigned short vec_mergel (vector unsigned short, vector unsigned short);

vector double vec_mergel (vector double, vector double);

vector float vec_mergel (vector float, vector float);

POWER ISA 3.0

Phased in.[a]

vector _Float16 vec_mergel (vector _Float16, vector _Float16);

VEC_MERGEO (ARG1, ARG2)

Purpose:

Merges the odd-numbered halves of two vectors.

Result value:

The odd-numbered elements of ARG1 are stored in the even-numbered elements of the result.

The odd-numbered elements of ARG2 are stored in the odd-numbered elements of the result.

Phased in.[a]

vector bool int vec_mergeo (vector bool int, vector bool int);

Phased in.[a]

vector signed int vec_mergeo (vector signed int, vector signed int);

Phased in.[a]

vector unsigned int vec_mergeo (vector unsigned int, vector unsigned int);

Phased in.[a]

vector bool long long vec_mergeo (vector bool long long, vector bool long long);

Phased in.[a]

vector signed long long vec_mergeo (vector signed long long, vector signed long long);

Phased in.[a]

vector unsigned long long vec_mergeo (vector unsigned long long, vector unsigned long long);

Phased in.[a]

vector double vec_mergeo (vector double, vector double);

Phased in.[a]

vector float vec_mergeo (vector float, vector float);

VEC_MIN (ARG1, ARG2)

Purpose:

Returns a vector containing the minimum value from each set of corresponding elements of the given vectors.

Result value:

The value of each element of the result is the minimum of the values of the corresponding elements of ARG1 and ARG2.

vector signed char vec_min (vector signed char, vector signed char);

vector unsigned char vec_min (vector unsigned char, vector unsigned char);

vector signed int vec_min (vector signed int, vector signed int);

vector unsigned int vec_min (vector unsigned int, vector unsigned int);

vector signed long long vec_min (vector signed long long, vector signed long long);

vector unsigned long long vec_min (vector unsigned long long, vector unsigned long long);

vector signed short vec_min (vector signed short, vector signed short);

vector unsigned short vec_min (vector unsigned short, vector unsigned short);

vector double vec_min (vector double, vector double);

vector float vec_min (vector float, vector float);

VEC_MRADDS (ARG1, ARG2, ARG3)

Purpose:

Returns a vector containing the results of performing a saturated multiply-high-round-and-add operation for each corresponding set of elements of the given vectors.

Result value:

For each element of the result, the value is produced in the following way: The values of the corresponding elements of ARG1 and ARG2 are multiplied and rounded such that the 15 least-significant bits are 0. The value of the 17 most-significant bits of this rounded product is then added, using 16-bit-saturated addition, to the value of the corresponding element of ARG3.

vector signed short vec_mradds (vector signed short, vector signed short, vector signed short);

VEC_MSUB (ARG1, ARG2, ARG3)

Purpose:

Returns a vector containing the results of performing a multiply-subtract operation using the given vectors.

Result value:

This function multiplies each element in ARG1 by the corresponding element in ARG2 and then subtracts the corresponding element in ARG3 from the result.

vector double vec_msub (vector double, vector double, vector double);

vector float vec_msub (vector float, vector float, vector float);

VEC_MSUM (ARG1, ARG2, ARG3)

Purpose:

Returns a vector containing the results of performing a multiply-sum operation using the given vectors.

Result value:

Assume that the elements of each vector are numbered beginning with 0. If ARG1 is a vector signed char or a vector unsigned char vector, then let m be 4. Otherwise, let m be 2. For each element n of the result vector, the value is obtained in the following way: For p = mn to mn + m – 1, multiply element p of ARG1 by element p of ARG2. Add the sum of these products to element n of ARG3. All additions are performed using 32-bit modular arithmetic.

vector signed int vec_msum (vector signed char, vector unsigned char, vector signed int);

vector signed int vec_msum (vector signed short, vector signed short, vector signed int);

vector unsigned int vec_msum (vector unsigned char, vector unsigned char, vector unsigned int);

vector unsigned int vec_msum (vector unsigned short, vector unsigned short, vector unsigned int);

VEC_MSUMS (ARG1, ARG2, ARG3)

Purpose:

Returns a vector containing the results of performing a saturated multiply-sum operation using the given vectors.

Result value:

Assume that the elements of each vector are numbered beginning with 0. For each element n of the result vector, the value is obtained in the following way: For p = 2n to 2n+1, multiply element p of ARG1 by element p of ARG2. Add the sum of these products to element n of ARG3. All additions are performed using 32-bit saturated arithmetic.

vector signed int vec_msums (vector signed short, vector signed short, vector signed int);

vector unsigned int vec_msums (vector unsigned short, vector unsigned short, vector unsigned int);

VEC_MUL (ARG1, ARG2)

Purpose:

Returns a vector containing the results of performing a multiply operation using the given vectors.

This function emulates the operation on integer vectors.

Result value:

This function multiplies corresponding elements in the given vectors and then assigns the result to corresponding elements in the result vector.

vector signed char vec_mul (vector signed char, vector signed char);

vector unsigned char vec_mul (vector unsigned char, vector unsigned char);

vector signed int vec_mul (vector signed int, vector signed int);

vector unsigned int vec_mul (vector unsigned int, vector unsigned int);

Phased in.[a]

vector signed long long vec_mul (vector signed long long, vector signed long long);

Phased in.[a]

vector unsigned long long vec_mul (vector unsigned long long, vector unsigned long long);

vector signed short vec_mul (vector signed short, vector signed short);

vector unsigned short vec_mul (vector unsigned short, vector unsigned short);

vector double vec_mul (vector double, vector double);

vector float vec_mul (vector float, vector float);

VEC_MULE (ARG1, ARG2)

Purpose:

Returns a vector containing the results of multiplying every second set of the corresponding elements of the given vectors, beginning with the first element.

Result value:

Assume that the elements of each vector are numbered beginning with 0. For each element n of the result vector, the value is the product of the value of element 2n of ARG1 and the value of element 2n of ARG2.

vector signed int vec_mule (vector signed short, vector signed short);

vector unsigned int vec_mule (vector unsigned short, vector unsigned short);

vector signed long long vec_mule (vector signed int, vector signed int);

vector unsigned long long vec_mule (vector unsigned int, vector unsigned int);

vector signed short vec_mule (vector signed char, vector signed char);

vector unsigned short vec_mule (vector unsigned char, vector unsigned char);

VEC_MULO (ARG1, ARG2)

Purpose:

Returns a vector containing the results of multiplying every second set of corresponding elements of the given vectors, beginning with the second element.

Result value:

Assume that the elements of each vector are numbered beginning with 0. For each element n of the result vector, the value is the product of the value of element 2n+1 of ARG1 and the value of element 2n+1 of ARG2.

vector signed int vec_mulo (vector signed short, vector signed short);

vector unsigned int vec_mulo (vector unsigned short, vector unsigned short);

vector signed long long vec_mulo (vector signed int, vector signed int);

vector unsigned long long vec_mulo (vector unsigned int, vector unsigned int);

vector signed short vec_mulo (vector signed char, vector signed char);

vector unsigned short vec_mulo (vector unsigned char, vector unsigned char);

VEC_NABS (ARG1)

Purpose:

Returns a vector containing the negated absolute values of the contents of the given vector.

Result value:

The value of each element of the result is the negated absolute value of the corresponding element of ARG1. For integer vectors, the arithmetic is modular.

vector signed char vec_nabs (vector signed char);

vector signed int vec_nabs (vector signed int);

vector signed long long vec_nabs (vector signed long long);

vector signed short vec_nabs (vector signed short);

vector double vec_nabs (vector double);

vector float vec_nabs (vector float);

VEC_NAND (ARG1, ARG2)

Purpose:

Performs a bitwise NAND of the given vectors.

Result value:

The result is the bitwise NAND of ARG1 and ARG2.

vector bool char vec_nand (vector bool char, vector bool char);

vector signed char vec_nand (vector signed char, vector signed char);

vector unsigned char vec_nand (vector unsigned char, vector unsigned char);

vector bool int vec_nand (vector bool int, vector bool int);

vector signed int vec_nand (vector signed int, vector signed int);

vector unsigned int vec_nand (vector unsigned int, vector unsigned int);

vector bool long long vec_nand (vector bool long long, vector bool long long);

vector signed long long vec_nand (vector signed long long, vector signed long long);

vector unsigned long long vec_nand (vector unsigned long long, vector unsigned long long);

vector bool short vec_nand (vector bool short, vector bool short);

vector signed short vec_nand (vector signed short, vector signed short);

vector unsigned short vec_nand (vector unsigned short, vector unsigned short);

vector double vec_nand (vector double, vector double);

vector float vec_nand (vector float, vector float);

VEC_NEARBYINT (ARG1)

Purpose:

Returns a vector containing the floating-point integral values nearest to the values of the corresponding elements of the given vector.

Result value:

Each element of the result contains the nearest representable floating-point integral value to the value of the corresponding element of ARG1. When an input element value is exactly between two integer values, the result value with the largest absolute value is selected.

vector double vec_nearbyint (vector double);

vector float vec_nearbyint (vector float);

VEC_NEG (ARG1)

Purpose:

Returns a vector containing the negated values of the contents of the given vector.

Result value:

The value of each element of the result is the negated value of the corresponding element of ARG1. For integer vectors, the arithmetic is modular.

vector signed char vec_neg (vector signed char);

vector signed int vec_neg (vector signed int);

vector signed long long vec_neg (vector signed long long);

vector signed short vec_neg (vector signed short);

vector double vec_neg (vector double);

vector float vec_neg (vector float);

VEC_NMADD (ARG1, ARG2, ARG3)

Purpose:

Returns a vector containing the results of performing a negative multiply-add operation on the given vectors.

Result value:

The value of each element of the result is the product of the corresponding elements of ARG1 and ARG2, added to the corresponding elements of ARG3, then multiplied by –1.0.

vector double vec_nmadd (vector double, vector double, vector double);

vector float vec_nmadd (vector float, vector float, vector float);

VEC_NMSUB (ARG1, ARG2, ARG3)

Purpose:

Returns a vector containing the results of performing a negative multiply-subtract operation on the given vectors.

Result value:

The value of each element of the result is the product of the corresponding elements of ARG1 and ARG2, subtracted from the corresponding element of ARG3, and then multiplied by –1.0.

vector double vec_nmsub (vector double, vector double, vector double);

vector float vec_nmsub (vector float, vector float, vector float);

VEC_NOR (ARG1, ARG2)

Purpose:

Performs a bitwise NOR of the given vectors.

Result value:

The result is the bitwise NOR of ARG1 and ARG2.

vector bool char vec_nor (vector bool char, vector bool char);

vector signed char vec_nor (vector signed char, vector signed char);

vector unsigned char vec_nor (vector unsigned char, vector unsigned char);

vector bool int vec_nor (vector bool int, vector bool int);

vector signed int vec_nor (vector signed int, vector signed int);

vector unsigned int vec_nor (vector unsigned int, vector unsigned int);

vector bool long long vec_nor (vector bool long long, vector bool long long);

Phased in.[a]

vector signed long long vec_nor (vector signed long long, vector signed long long);

Phased in.[a]

vector unsigned long long vec_nor (vector unsigned long long, vector unsigned long long);

vector bool short vec_nor (vector bool short, vector bool short);

vector signed short vec_nor (vector signed short, vector signed short);

vector unsigned short vec_nor (vector unsigned short, vector unsigned short);

vector double vec_nor (vector double, vector double);

vector float vec_nor (vector float, vector float);

VEC_OR (ARG1, ARG2)

Purpose:

Performs a bitwise OR of the given vectors.

Result value:

The result is the bitwise OR of ARG1 and ARG2.

vector bool char vec_or (vector bool char, vector bool char);

vector signed char vec_or (vector signed char, vector signed char);

vector unsigned char vec_or (vector unsigned char, vector unsigned char);

vector bool int vec_or (vector bool int, vector bool int);

vector signed int vec_or (vector signed int, vector signed int);

vector unsigned int vec_or (vector unsigned int, vector unsigned int);

vector bool long long vec_or (vector bool long long, vector bool long long);

Phased in.[a]

vector signed long long vec_or (vector signed long long, vector signed long long);

Phased in.[a]

vector unsigned long long vec_or (vector unsigned long long, vector unsigned long long);

vector bool short vec_or (vector bool short, vector bool short);

vector signed short vec_or (vector signed short, vector signed short);

vector unsigned short vec_or (vector unsigned short, vector unsigned short);

vector double vec_or (vector double, vector double);

vector float vec_or (vector float, vector float);

VEC_ORC (ARG1, ARG2)

Purpose:

Performs a bitwise OR of the first vector with the negated second vector.

Result value:

The result is the bitwise OR of ARG1 and the bitwise negation of ARG2.

vector bool char vec_orc (vector bool char, vector bool char);

vector signed char vec_orc (vector signed char, vector signed char);

vector unsigned char vec_orc (vector unsigned char, vector unsigned char);

vector bool int vec_orc (vector bool int, vector bool int);

vector signed int vec_orc (vector signed int, vector signed int);

vector unsigned int vec_orc (vector unsigned int, vector unsigned int);

vector bool long long vec_orc (vector bool long long, vector bool long long);

vector signed long long vec_orc (vector signed long long, vector signed long long);

vector unsigned long long vec_orc (vector unsigned long long, vector unsigned long long);

vector bool short vec_orc (vector bool short, vector bool short);

vector signed short vec_orc (vector signed short, vector signed short);

vector unsigned short vec_orc (vector unsigned short, vector unsigned short);

vector double vec_orc (vector double, vector double);

vector float vec_orc (vector float, vector float);

VEC_PACK (ARG1, ARG2)

Purpose:

Packs information from each element of two vectors into the result vector.

Result value:

For integer types, the value of each element of the result vector is taken from the low-order half of the corresponding element of the result of concatenating ARG1 and ARG2.

For floating-point types, the value of each element of the result vector is the corresponding element of the result of concatenating ARG1 and ARG2, rounded to the result type.

vector bool char vec_pack (vector bool short, vector bool short);

vector signed char vec_pack (vector signed short, vector signed short);

vector unsigned char vec_pack (vector unsigned short, vector unsigned short);

vector bool int vec_pack (vector bool long long, vector bool long long);

vector signed int vec_pack (vector signed long long, vector signed long long);

vector unsigned int vec_pack (vector unsigned long long, vector unsigned long long);

vector bool short vec_pack (vector bool int, vector bool int);

vector signed short vec_pack (vector signed int, vector signed int);

vector unsigned short vec_pack (vector unsigned int, vector unsigned int);

vector float vec_pack (vector double, vector double);

POWER ISA 3.0

Phased in.[a]

vector _Float16 vec_pack (vector float, vector float);

VEC_PACK_TO_SHORT_FP32 (ARG1, ARG2)

POWER ISA 3.0

Purpose:

Packs eight single-precision 32-bit floating-point numbers into a vector of eight 16-bit floating-point numbers.

Result value:

The value is a vector consisting of eight 16-bit elements, each representing a 16-bit floating-point number that was created by converting the corresponding single-precision value to half-precision.

POWER ISA 3.0

vector unsigned short vec_pack_to_short_fp32 (vector float, vector float);

VEC_PACKPX (ARG1, ARG2)

Purpose:

Packs information from each element of two vectors into the result vector.

Result value:

The value of each element of the result vector is taken from the corresponding element of the result of concatenating ARG1 and ARG2 as follows:

  • The least-significant bit of the high-order byte is stored into the first bit of the result element.

  • The least-significant 5 bits of each of the remaining bytes are stored into the remaining portion of the result element.

vector pixel vec_packpx (vector unsigned int, vector unsigned int);

VEC_PACKS (ARG1, ARG2)

Purpose:

Packs information from each element of two vectors into the result vector, using saturated values.

Result value:

The value of each element of the result vector is the saturated value of the corresponding element of the result of concatenating ARG1 and ARG2.

vector signed char vec_packs (vector signed short, vector signed short);

vector unsigned char vec_packs (vector unsigned short, vector unsigned short);

vector signed int vec_packs (vector signed long long, vector signed long long);

vector unsigned int vec_packs (vector unsigned long long, vector unsigned long long);

vector signed short vec_packs (vector signed int, vector signed int);

vector unsigned short vec_packs (vector unsigned int, vector unsigned int);

VEC_PACKSU (ARG1, ARG2)

Purpose:

Packs information from each element of two vectors into the result vector, using unsigned saturated values.

Result value:

The value of each element of the result vector is the saturated value of the corresponding element of the result of concatenating ARG1 and ARG2.

vector unsigned char vec_packsu (vector signed short, vector signed short);

vector unsigned char vec_packsu (vector unsigned short, vector unsigned short);

vector unsigned int vec_packsu (vector signed long long, vector signed long long);

Phased in.[a]

vector unsigned int vec_packsu (vector unsigned long long, vector unsigned long long);

vector unsigned short vec_packsu (vector signed int, vector signed int);

vector unsigned short vec_packsu (vector unsigned int, vector unsigned int);

VEC_PARITY_LSBB (ARG1)

POWER ISA 3.0

Purpose:

Compute parity on the least-significant bit of each byte.

Result value:

Returns a vector with each element containing the parity of the low-order bit of each of the bytes in that element.

POWER ISA 3.0

vector unsigned int vec_parity_lsbb (vector signed int);

POWER ISA 3.0

vector unsigned int vec_parity_lsbb (vector unsigned int);

POWER ISA 3.0

vector unsigned __int128 vec_parity_lsbb (vector signed __int128);

POWER ISA 3.0

vector unsigned __int128 vec_parity_lsbb (vector unsigned __int128);

POWER ISA 3.0

vector unsigned long long vec_parity_lsbb (vector signed long long);

POWER ISA 3.0

vector unsigned long long vec_parity_lsbb (vector unsigned long long);

VEC_PERM (ARG1, ARG2, ARG3)

Purpose:

Returns a vector that contains some elements of two vectors, in the order specified by a third vector.

Result value:

Each byte of the result is selected by using the least-significant 5 bits of the corresponding byte of ARG3 as an index into the concatenated bytes of ARG1 and ARG2.

vector bool char vec_perm (vector bool char, vector bool char, vector unsigned char);

vector signed char vec_perm (vector signed char, vector signed char, vector unsigned char);

vector unsigned char vec_perm (vector unsigned char, vector unsigned char, vector unsigned char);

vector bool int vec_perm (vector bool int, vector bool int, vector unsigned char);

vector signed int vec_perm (vector signed int, vector signed int, vector unsigned char);

vector unsigned int vec_perm (vector unsigned int, vector unsigned int, vector unsigned char);

Phased in.[a]

vector bool long long vec_perm (vector bool long long, vector bool long long, vector unsigned char);

vector signed long long vec_perm (vector signed long long, vector signed long long, vector unsigned char);

Phased in.[a]

vector unsigned long long vec_perm (vector unsigned long long, vector unsigned long long, vector unsigned char);

vector pixel vec_perm (vector pixel, vector pixel, vector unsigned char);

vector bool short vec_perm (vector bool short, vector bool short, vector unsigned char);

vector signed short vec_perm (vector signed short, vector signed short, vector unsigned char);

vector unsigned short vec_perm (vector unsigned short, vector unsigned short, vector unsigned char);

vector double vec_perm (vector double, vector double, vector unsigned char);

vector float vec_perm (vector float, vector float, vector unsigned char);

POWER ISA 3.0

Phased in.[a]

vector _Float16 vec_perm (vector _Float16, vector _Float16, vector unsigned char);

VEC_PERMXOR (ARG1, ARG2, ARG3)

Purpose:

Applies a permute and exclusive-OR operation on two vectors of byte elements.

Result value:

For each i (0 ≤ i < 16), let index1 be bits 0–3 and index2 be bits 4–7 of byte element i of mask ARG3.

Byte element i of the result is set to the exclusive-OR of byte elements index1 of ARG1 and index2 of ARG2.

Phased in.[a]

vector bool char vec_permxor (vector bool char, vector bool char, vector bool char);

Phased in.[a]

vector unsigned char vec_permxor (vector signed char, vector signed char, vector signed char);

Phased in.[a]

vector unsigned char vec_permxor (vector unsigned char, vector unsigned char, vector unsigned char);

VEC_POPCNT (ARG1)

Purpose:

Returns a vector containing the number of bits set in each element of the input vector.

Result value:

The value of each element of the result is the number of bits set in the corresponding input element.

vector unsigned char vec_popcnt (vector signed char);

vector unsigned char vec_popcnt (vector unsigned char);

vector unsigned int vec_popcnt (vector signed int);

vector unsigned int vec_popcnt (vector unsigned int);

vector unsigned long long vec_popcnt (vector signed long long);

vector unsigned long long vec_popcnt (vector unsigned long long);

vector unsigned short vec_popcnt (vector signed short);

vector unsigned short vec_popcnt (vector unsigned short);

VEC_RE (ARG1)

Purpose:

Returns a vector containing estimates of the reciprocals of the corresponding elements of the given vector.

Result value:

Each element of the result contains the estimated value of the reciprocal of the corresponding element of ARG1.

vector float vec_re (vector float);

vector double vec_re (vector double);

VEC_RECIPDIV (ARG1, ARG2)

Purpose:

Returns a vector containing approximations of the division of the corresponding elements of ARG1 by the corresponding elements of ARG2. This implementation provides an implementation-dependent precision, which is commonly within 2 ulps for most of the numeric range expressible by the input operands. This built-in function does not correspond to a single IEEE operation and does not provide the overflow, underflow, and NaN propagation characteristics specified for IEEE division. (Precision may be a function of both the specified target processor model during compilation and the actual processor on which a program is executed.)

Result value:

Each element of the result vector contains a refined approximation of the division of the corresponding element of ARG1 by the corresponding element of ARG2.

vector double vec_recipdiv (vector double, vector double);

vector float vec_recipdiv (vector float, vector float);

VEC_REVB (ARG1)

Purpose:

Reverse the bytes of each vector element of a vector.

Result value:

Returns a vector where each vector element contains the corresponding byte-reversed vector element of the input vector.

vector bool char vec_revb (vector bool char);

vector signed char vec_revb (vector signed char);

vector unsigned char vec_revb (vector unsigned char);

vector bool int vec_revb (vector bool int);

vector signed int vec_revb (vector signed int);

vector unsigned int vec_revb (vector unsigned int);

vector signed __int128 vec_revb (vector signed __int128);

vector unsigned __int128 vec_revb (vector unsigned __int128);

vector bool long long vec_revb (vector bool long long);

vector signed long long vec_revb (vector signed long long);

vector unsigned long long vec_revb (vector unsigned long long);

vector bool short vec_revb (vector bool short);

vector signed short vec_revb (vector signed short);

vector unsigned short vec_revb (vector unsigned short);

vector double vec_revb (vector double);

vector float vec_revb (vector float);

POWER ISA 3.0

Phased in.[a]

vector _Float16 vec_revb (vector _Float16);

VEC_REVE (ARG1)

Purpose:

Reverse the elements of a vector.

Result value:

Returns a vector with the elements of the input vector in reversed order.

vector bool char vec_reve (vector bool char);

vector signed char vec_reve (vector signed char);

vector unsigned char vec_reve (vector unsigned char);

vector bool int vec_reve (vector bool int);

vector signed int vec_reve (vector signed int);

vector unsigned int vec_reve (vector unsigned int);

vector bool long long vec_reve (vector bool long long);

vector signed long long vec_reve (vector signed long long);

vector unsigned long long vec_reve (vector unsigned long long);

vector bool short vec_reve (vector bool short);

vector signed short vec_reve (vector signed short);

vector unsigned short vec_reve (vector unsigned short);

vector double vec_reve (vector double);

vector float vec_reve (vector float);

POWER ISA 3.0

Phased in.[a]

vector _Float16 vec_reve (vector _Float16);

VEC_RINT (ARG1)

Purpose:

Returns a vector containing the floating-point integral values nearest to the values of the corresponding elements of the given vector.

Result value:

Each element of the result contains the nearest representable floating-point integral value to the value of the corresponding element of ARG1. When an input element value is exactly between two integer values, the result value is selected based on the rounding mode specified by the Floating-Point Rounding Control field (RN) of the FPSCR register.

vector double vec_rint (vector double);

vector float vec_rint (vector float);

VEC_RL(ARG1, ARG2)

Purpose:

Rotates each element of a vector left by a given number of bits.

Result value:

Each element of the result is obtained by rotating the corresponding element of ARG1 left by the number of bits specified by the corresponding element of ARG2.

vector signed char vec_rl (vector signed char, vector unsigned char);

vector unsigned char vec_rl (vector unsigned char, vector unsigned char);

vector signed int vec_rl (vector signed int, vector unsigned int);

vector unsigned int vec_rl (vector unsigned int, vector unsigned int);

vector signed long long vec_rl (vector signed long long, vector unsigned long long);

vector unsigned long long vec_rl (vector unsigned long long, vector unsigned long long);

vector signed short vec_rl (vector signed short, vector unsigned short);

vector unsigned short vec_rl (vector unsigned short, vector unsigned short);

VEC_RLMI (ARG1, ARG2, ARG3)

POWER ISA 3.0

Purpose:

Rotates each element of a vector left and inserts each element under a mask.

Result value:

The result is obtained by rotating each element of vector ARG1 left and inserting it under mask into ARG2. ARG3 bits 11:15 contain the mask beginning, bits 19:23 contain the mask end, and bits 27:31 contain the shift count.

POWER ISA 3.0

vector unsigned int vec_rlmi (vector unsigned int, vector unsigned int, vector unsigned int);

POWER ISA 3.0

vector unsigned long long vec_rlmi (vector unsigned long long, vector unsigned long long, vector unsigned long long);

VEC_RLNM (ARG1, ARG2, ARG3)

POWER ISA 3.0

Purpose:

Rotates each element of a vector left; then intersects (AND) it with a mask.

Result value:

Each element of vector ARG1 is rotated left; then intersected (AND) with a mask specified by ARG2 and ARG3.

ARG2 contains the shift count for each element in the low-order byte, with other bytes zero. ARG3 contains the mask begin and mask end for each element, with the mask end in the low-order byte, the mask begin in the next higher byte, and other bytes zero.

POWER ISA 3.0

vector unsigned int vec_rlnm (vector unsigned int, vector unsigned int, vector unsigned int);

POWER ISA 3.0

vector unsigned long long vec_rlnm (vector unsigned long long, vector unsigned long long, vector unsigned long long);

VEC_ROUND (ARG1)

Purpose:

Returns a vector containing the rounded values of the corresponding elements of the given vector.

Result value:

Each element of the result contains the value of the corresponding element of ARG1, rounded to the nearest representable floating-point integer, using IEEE round-to-nearest rounding.

[Note]Note

This function might not follow the strict operation definition of the resolution of a tie during a round if the -qstrict=nooperationprecision compiler option is specified to the XLC compiler.

Phased in.[a]

vector double vec_round (vector double);

vector float vec_round (vector float);

VEC_RSQRT (ARG1)

Purpose:

Returns a vector containing a refined approximation of the reciprocal square roots of the corresponding elements of the given vector. This function provides an implementation-dependent greater precision than VEC_RSQRTE.

Result value:

Each element of the result contains a refined approximation of the reciprocal square root of the corresponding element of ARG1.

vector double vec_rsqrt (vector double);

vector float vec_rsqrt (vector float);

VEC_RSQRTE (ARG1)

Purpose:

Returns a vector containing estimates of the reciprocal square roots of the corresponding elements of the given vector.

Result value:

Each element of the result contains the estimated value of the reciprocal square root of the corresponding element of ARG1.

vector double vec_rsqrte (vector double);

vector float vec_rsqrte (vector float);

VEC_SEL (ARG1, ARG2, ARG3)

Purpose:

Returns a vector containing the value of either ARG1 or ARG2 depending on the value of ARG3.

Result value:

Each bit of the result vector has the value of the corresponding bit of ARG1 if the corresponding bit of ARG3 is 0. Otherwise, each bit of the result vector has the value of the corresponding bit of ARG2.

vector bool char vec_sel (vector bool char, vector bool char, vector bool char);

vector bool char vec_sel (vector bool char, vector bool char, vector unsigned char);

vector signed char vec_sel (vector signed char, vector signed char, vector bool char);

vector signed char vec_sel (vector signed char, vector signed char, vector unsigned char);

vector unsigned char vec_sel (vector unsigned char, vector unsigned char, vector bool char);

vector unsigned char vec_sel (vector unsigned char, vector unsigned char, vector unsigned char);

vector bool int vec_sel (vector bool int, vector bool int, vector bool int);

vector bool int vec_sel (vector bool int, vector bool int, vector unsigned int);

vector signed int vec_sel (vector signed int, vector signed int, vector bool int);

vector signed int vec_sel (vector signed int, vector signed int, vector unsigned int);

vector unsigned int vec_sel (vector unsigned int, vector unsigned int, vector bool int);

vector unsigned int vec_sel (vector unsigned int, vector unsigned int, vector unsigned int);

vector bool long long vec_sel (vector bool long long, vector bool long long, vector bool long long);

vector bool long long vec_sel (vector bool long long, vector bool long long, vector unsigned long long);

vector signed long long vec_sel (vector signed long long, vector signed long long, vector bool long long);

Phased in.[a]

vector signed long long vec_sel (vector signed long long, vector signed long long, vector unsigned long long);

Phased in.[a]

vector unsigned long long vec_sel (vector unsigned long long, vector unsigned long long, vector bool long long);

Phased in.[a]

vector unsigned long long vec_sel (vector unsigned long long, vector unsigned long long, vector unsigned long long);

vector bool short vec_sel (vector bool short, vector bool short, vector bool short);

vector bool short vec_sel (vector bool short, vector bool short, vector unsigned short);

vector signed short vec_sel (vector signed short, vector signed short, vector bool short);

vector signed short vec_sel (vector signed short, vector signed short, vector unsigned short);

vector unsigned short vec_sel (vector unsigned short, vector unsigned short, vector bool short);

vector unsigned short vec_sel (vector unsigned short, vector unsigned short, vector unsigned short);

vector double vec_sel (vector double, vector double, vector bool long long);

vector double vec_sel (vector double, vector double, vector unsigned long long);

vector float vec_sel (vector float, vector float, vector bool int);

vector float vec_sel (vector float, vector float, vector unsigned int);

POWER ISA 3.0

Phased in.[a]

vector _Float16 vec_sel (vector _Float16, vector _Float16, vector bool short);

POWER ISA 3.0

Phased in.[a]

vector _Float16 vec_sel (vector _Float16, vector _Float16, vector unsigned short);

VEC_SIGNED (ARG1)

Purpose:

Converts a vector of floating-point numbers to a vector of signed integers.

Result value:

Target elements are obtained by truncating the respective source elements to signed integers.

vector signed int vec_signed (vector float);

vector signed long long vec_signed (vector double);

VEC_SIGNED2 (ARG1, ARG2)

Purpose:

Converts a vector of floating-point numbers to vector of signed integers.

Result value:

Target elements are obtained by truncating the source elements to the signed integers as follows:

  • Target elements 0 and 1 from source 0

  • Target elements 2 and 3 from source 1

vector signed int vec_signed2 (vector double, vector double);

VEC_SIGNEDE (ARG1)

Purpose:

Converts an input vector to a vector of signed integers.

Result value:

The even target elements are obtained by truncating the source elements to signed integers as follows:

Target elements 0 and 2 contain the converted values of the input vector.

vector signed int vec_signede (vector double);

VEC_SIGNEDO (ARG1)

Purpose:

Converts an input vector to a vector of signed integers.

Result value:

The odd target elements are obtained by truncating the source elements to signed integers as follows:

Target elements 1 and 3 contain the converted values of the input vector.

vector signed int vec_signedo (vector double);

VEC_SL (ARG1, ARG2)

Purpose:

Performs a left shift for each element of a vector.

Result value:

Each element of the result vector is the result of left shifting the corresponding element of ARG1 by the number of bits specified by the value of the corresponding element of ARG2, modulo the number of bits in the element. The bits that are shifted out are replaced by zeros.

vector signed char vec_sl (vector signed char, vector unsigned char);

vector unsigned char vec_sl (vector unsigned char, vector unsigned char);

vector signed int vec_sl (vector signed int, vector unsigned int);

vector unsigned int vec_sl (vector unsigned int, vector unsigned int);

vector signed long long vec_sl (vector signed long long, vector unsigned long long);

vector unsigned long long vec_sl (vector unsigned long long, vector unsigned long long);

vector signed short vec_sl (vector signed short, vector unsigned short);

vector unsigned short vec_sl (vector unsigned short, vector unsigned short);

VEC_SLD (ARG1, ARG2, ARG3)

Purpose:

Left shifts a double vector (that is, two concatenated vectors) by a given number of bytes. For vec_sld being performed on the vector bool and floating-point types, the result is undefined, when the specified shift count is not a multiple of the element size.

Result value:

The result is the most-significant 16 bytes obtained by concatenating ARG1 and ARG2 and shifting left by the number of bytes specified by ARG3, which should be in the range 0–15.

vector bool char vec_sld (vector bool char, vector bool char, const int);

vector signed char vec_sld (vector signed char, vector signed char, const int);

vector unsigned char vec_sld (vector unsigned char, vector unsigned char, const int);

vector bool int vec_sld (vector bool int, vector bool int, const int);

vector signed int vec_sld (vector signed int, vector signed int, const int);

vector unsigned int vec_sld (vector unsigned int, vector unsigned int, const int);

Phased in.[a]

vector bool long long vec_sld (vector bool long long, vector bool long long, const int);

Phased in.[a]

vector signed long long vec_sld (vector signed long long, vector signed long long, const int);

Phased in.[a]

vector unsigned long long vec_sld (vector unsigned long long, vector unsigned long long, const int);

vector pixel vec_sld (vector pixel, vector pixel, const int);

vector bool short vec_sld (vector bool short, vector bool short, const int);

vector signed short vec_sld (vector signed short, vector signed short, const int);

vector unsigned short vec_sld (vector unsigned short, vector unsigned short, const int);

Phased in.[a]

vector double vec_sld (vector double, vector double, const int);

vector float vec_sld (vector float, vector float, const int);

VEC_SLDW (ARG1, ARG2, ARG3)

Purpose:

Returns a vector obtained by shifting left the concatenated input vectors by the number of specified words.

Result value:

The value of each element is set to the value of an input element of the concatenated vectors ARG1 and ARG2, with the word offset to its right1 specified by ARG3, which should be in the range 0–3.

1A shift left picks values from the right.

vector signed char vec_sldw (vector signed char, vector signed char, const int);

vector unsigned char vec_sldw (vector unsigned char, vector unsigned char, const int);

vector signed int vec_sldw (vector signed int, vector signed int, const int);

vector unsigned int vec_sldw (vector unsigned int, vector unsigned int, const int);

vector signed long long vec_sldw (vector signed long long, vector signed long long, const int);

vector unsigned long long vec_sldw (vector unsigned long long, vector unsigned long long, const int);

vector signed short vec_sldw (vector signed short, vector signed short, const int);

vector unsigned short vec_sldw (vector unsigned short, vector unsigned short, const int);

VEC_SLL (ARG1, ARG2)

Purpose:

Left shifts a vector by a given number of bits.

Result value:

The result is the contents of ARG1, shifted left by the number of bits specified by the three least-significant bits of ARG2. The bits that are shifted out are replaced by zeros. The shift count must have been replicated into all bytes of the shift count specification.

vector signed char vec_sll (vector signed char, vector unsigned char);

vector unsigned char vec_sll (vector unsigned char, vector unsigned char);

vector signed int vec_sll (vector signed int, vector unsigned char);

vector unsigned int vec_sll (vector unsigned int, vector unsigned char);

Phased in.[a]

vector signed long long vec_sll (vector signed long long, vector unsigned char);

Phased in.[a]

vector unsigned long long vec_sll (vector unsigned long long, vector unsigned char);

vector pixel vec_sll (vector pixel, vector unsigned char);

vector signed short vec_sll (vector signed short, vector unsigned char);

vector unsigned short vec_sll (vector unsigned short, vector unsigned char);

VEC_SLO (ARG1, ARG2)

Purpose:

Left shifts a vector by a given number of bytes (octets).

Result value:

The result is the contents of ARG1, shifted left by the number of bytes specified by the most-significant nibble of the least-significant byte1 of ARG2. The bits that are shifted out are replaced by zeros.

1That is, by little-endian bits 7–4 or big-endian bits 121–124.

vector signed char vec_slo (vector signed char, vector signed char);

vector signed char vec_slo (vector signed char, vector unsigned char);

vector unsigned char vec_slo (vector unsigned char, vector signed char);

vector unsigned char vec_slo (vector unsigned char, vector unsigned char);

vector signed int vec_slo (vector signed int, vector signed char);

vector signed int vec_slo (vector signed int, vector unsigned char);

vector unsigned int vec_slo (vector unsigned int, vector signed char);

vector unsigned int vec_slo (vector unsigned int, vector unsigned char);

vector signed long long vec_slo (vector signed long long, vector signed char);

vector signed long long vec_slo (vector signed long long, vector unsigned char);

vector unsigned long long vec_slo (vector unsigned long long, vector signed char);

vector unsigned long long vec_slo (vector unsigned long long, vector unsigned char);

vector pixel vec_slo (vector pixel, vector signed char);

vector pixel vec_slo (vector pixel, vector unsigned char);

vector signed short vec_slo (vector signed short, vector signed char);

vector signed short vec_slo (vector signed short, vector unsigned char);

vector unsigned short vec_slo (vector unsigned short, vector signed char);

vector unsigned short vec_slo (vector unsigned short, vector unsigned char);

vector float vec_slo (vector float, vector signed char);

vector float vec_slo (vector float, vector unsigned char);

VEC_SLV (ARG1, ARG2)

POWER ISA 3.0

Purpose:

Left-shifts a vector by a varying number of bits by element.

Result value:

For each integer 0i14, let Xi be the halfword formed by concatenating elements i and i+1 of ARG1. Let X15 be the halfword formed by concatenating element 15 of ARG1 with a zero byte. Let Si be the value in the three least-significant bits of element i of ARG2. Then, element i of the result vector contains the value formed from bits Si through Si + 7 of Xi.

POWER ISA 3.0

vector unsigned char vec_slv (vector unsigned char, vector unsigned char);

VEC_SPLAT (ARG1, ARG2)

Purpose:

Returns a vector that has all of its elements set to a given value.

Result value:

The value of each element of the result is the value of the element of ARG1 specified by ARG2, which should be an element number less than the number of elements supported for the respective ARG1 type.

vector bool char vec_splat (vector bool char, const int);

vector signed char vec_splat (vector signed char, const int);

vector unsigned char vec_splat (vector unsigned char, const int);

vector bool int vec_splat (vector bool int, const int);

vector signed int vec_splat (vector signed int, const int);

vector unsigned int vec_splat (vector unsigned int, const int);

Phased in.[a]

vector bool long long vec_splat (vector bool long long, const int);

vector signed long long vec_splat (vector signed long long, const int);

vector unsigned long long vec_splat (vector unsigned long long, const int);

vector pixel vec_splat (vector pixel, const int);

vector bool short vec_splat (vector bool short, const int);

vector signed short vec_splat (vector signed short, const int);

vector unsigned short vec_splat (vector unsigned short, const int);

Phased in.[a]

vector double vec_splat (vector double, const int);

vector float vec_splat (vector float, const int);

POWER ISA 3.0

Phased in.[a]

vector _Float16 vec_splat (vector _Float16, const int);

VEC_SPLAT_S8 (ARG1)

Purpose:

Returns a vector with all elements equal to the given value.

Result value:

The bit pattern of ARG1 is interpreted as a signed value. Each element of the result is given this value.

vector signed char vec_splat_s8 (const int);

VEC_SPLAT_S16 (ARG1)

Purpose:

Returns a vector with all elements equal to the given value.

Result value:

Each element of the result has the value of ARG1.

vector signed short vec_splat_s16 (const int);

VEC_SPLAT_S32 (ARG1)

Purpose:

Returns a vector with all elements equal to the given value.

Result value:

Each element of the result has the value of ARG1.

vector signed int vec_splat_s32 (const int);

VEC_SPLAT_U8 (ARG1)

Purpose:

Returns a vector with all elements equal to the given value.

Result value:

The bit pattern of ARG1 is interpreted as an unsigned value. Each element of the result is given this value.

vector unsigned char vec_splat_u8 (const int);

VEC_SPLAT_U16 (ARG1)

Purpose:

Returns a vector with all elements equal to the given value.

Result value:

The bit pattern of ARG1 is interpreted as an unsigned value. Each element of the result is given this value.

vector unsigned short vec_splat_u16 (const int);

VEC_SPLAT_U32 (ARG1)

Purpose:

Returns a vector with all elements equal to the given value.

Result value:

The bit pattern of ARG1 is interpreted as an unsigned value. Each element of the result is given this value.

vector unsigned int vec_splat_u32 (const int);

VEC_SPLATS (ARG1)

Purpose:

Returns a vector with the value of each element set to ARG1.

Result value:

Each element of the result is set to the value of the scalar input parameter.

vector signed char vec_splats (signed char);

vector unsigned char vec_splats (unsigned char);

vector signed int vec_splats (signed int);

vector unsigned int vec_splats (unsigned int);

vector signed __int128 vec_splats (signed __int128);

vector unsigned __int128 vec_splats (unsigned __int128);

vector signed long long vec_splats (signed long long);

vector unsigned long long vec_splats (unsigned long long);

vector signed short vec_splats (signed short);

vector unsigned short vec_splats (unsigned short);

vector double vec_splats (double);

vector float vec_splats (float);

POWER ISA 3.0

Phased in.[a]

vector _Float16 vec_splats (_Float16);

VEC_SQRT (ARG1)

Purpose:

Returns a vector containing the square root of each element in the given vector.

Result value:

Each element of the result vector is the square root of the corresponding element of ARG1.

vector double vec_sqrt (vector double);

vector float vec_sqrt (vector float);

VEC_SR (ARG1, ARG2)

Purpose:

Performs a logical right shift for each element of a vector.

Result value:

Each element of the result vector is the result of logically right shifting the corresponding element of ARG1 by the number of bits specified by the value of the corresponding element of ARG2, modulo the number of bits in the element. The bits that are shifted out are replaced by zeros.

vector signed char vec_sr (vector signed char, vector unsigned char);

vector unsigned char vec_sr (vector unsigned char, vector unsigned char);

vector signed int vec_sr (vector signed int, vector unsigned int);

vector unsigned int vec_sr (vector unsigned int, vector unsigned int);

vector signed long long vec_sr (vector signed long long, vector unsigned long long);

vector unsigned long long vec_sr (vector unsigned long long, vector unsigned long long);

vector signed short vec_sr (vector signed short, vector unsigned short);

vector unsigned short vec_sr (vector unsigned short, vector unsigned short);

VEC_SRA (ARG1, ARG2)

Purpose:

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

Result value:

Each element of the result vector is the result of algebraically right shifting the corresponding element of ARG1 by the number of bits specified by the value of the corresponding element of ARG2, 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 ARG1.

vector signed char vec_sra (vector signed char, vector unsigned char);

vector unsigned char vec_sra (vector unsigned char, vector unsigned char);

vector signed int vec_sra (vector signed int, vector unsigned int);

vector unsigned int vec_sra (vector unsigned int, vector unsigned int);

vector signed long long vec_sra (vector signed long long, vector unsigned long long);

vector unsigned long long vec_sra (vector unsigned long long, vector unsigned long long);

vector signed short vec_sra (vector signed short, vector unsigned short);

vector unsigned short vec_sra (vector unsigned short, vector unsigned short);

VEC_SRL (ARG1, ARG2)

Purpose:

Right shifts a vector by a given number of bits.

Result value:

The result is the contents of ARG1, shifted right by the number of bits specified by the 3 least-significant bits of ARG2. The bits that are shifted out are replaced by zeros. The shift count must have been replicated into all bytes of the shift count specification.

vector signed char vec_srl (vector signed char, vector unsigned char);

vector unsigned char vec_srl (vector unsigned char, vector unsigned char);

vector signed int vec_srl (vector signed int, vector unsigned char);

vector unsigned int vec_srl (vector unsigned int, vector unsigned char);

Phased in.[a]

vector signed long long vec_srl (vector signed long long, vector unsigned char);

Phased in.[a]

vector unsigned long long vec_srl (vector unsigned long long, vector unsigned char);

vector pixel vec_srl (vector pixel, vector unsigned char);

vector signed short vec_srl (vector signed short, vector unsigned char);

vector unsigned short vec_srl (vector unsigned short, vector unsigned char);

VEC_SRO (ARG1, ARG2)

Purpose:

Right shifts a vector by a given number of bytes (octets).

Result value:

The result is the contents of ARG1, shifted right by the number of bytes specified by bits 121–124 of ARG2. The bits that are shifted out are replaced by zeros.

vector signed char vec_sro (vector signed char, vector signed char);

vector signed char vec_sro (vector signed char, vector unsigned char);

vector unsigned char vec_sro (vector unsigned char, vector signed char);

vector unsigned char vec_sro (vector unsigned char, vector unsigned char);

vector signed int vec_sro (vector signed int, vector signed char);

vector signed int vec_sro (vector signed int, vector unsigned char);

vector unsigned int vec_sro (vector unsigned int, vector signed char);

vector unsigned int vec_sro (vector unsigned int, vector unsigned char);

Phased in.[a]

vector signed long long vec_sro (vector signed long long, vector signed char);

Phased in.[a]

vector signed long long vec_sro (vector signed long long, vector unsigned char);

Phased in.[a]

vector unsigned long long vec_sro (vector unsigned long long, vector signed char);

Phased in.[a]

vector unsigned long long vec_sro (vector unsigned long long, vector unsigned char);

vector pixel vec_sro (vector pixel, vector signed char);

vector pixel vec_sro (vector pixel, vector unsigned char);

vector signed short vec_sro (vector signed short, vector signed char);

vector signed short vec_sro (vector signed short, vector unsigned char);

vector unsigned short vec_sro (vector unsigned short, vector signed char);

vector unsigned short vec_sro (vector unsigned short, vector unsigned char);

vector float vec_sro (vector float, vector signed char);

vector float vec_sro (vector float, vector unsigned char);

VEC_SRV (ARG1, ARG2)

POWER ISA 3.0

Purpose:

Right-shifts a vector by a varying number of bits by element.

Result value:

For each integer 1 i 15, let Xi be the halfword formed by concatenating elements i and i + 1 of ARG1. Let X0 be the halfword formed by concatenating a zero byte with element 0 of ARG1. Let Si be the value in the three least-significant bits of element i of ARG2. Then element i of the result vector contains the value formed from bits 8 – Si through 15 – Si.

POWER ISA 3.0

vector unsigned char vec_srv (vector unsigned char, vector unsigned char);

VEC_SUB (ARG1, ARG2)

Purpose:

Returns a vector containing the result of subtracting each element of ARG2 from the corresponding element of ARG1. This function emulates the operation on long long vectors.

Result value:

The value of each element of the result is the result of subtracting the value of the corresponding element of ARG2 from the value of the corresponding element of ARG1. The arithmetic is modular for integer vectors.

vector signed char vec_sub (vector signed char, vector signed char);

vector unsigned char vec_sub (vector unsigned char, vector unsigned char);

vector signed int vec_sub (vector signed int, vector signed int);

vector unsigned int vec_sub (vector unsigned int, vector unsigned int);

vector signed __int128 vec_sub (vector signed __int128, vector signed __int128);

vector unsigned __int128 vec_sub (vector unsigned __int128, vector unsigned __int128);

vector signed long long vec_sub (vector signed long long, vector signed long long);

vector unsigned long long vec_sub (vector unsigned long long, vector unsigned long long);

vector signed short vec_sub (vector signed short, vector signed short);

vector unsigned short vec_sub (vector unsigned short, vector unsigned short);

vector double vec_sub (vector double, vector double);

vector float vec_sub (vector float, vector float);

VEC_SUBC (ARG1, ARG2)

Purpose:

Returns a vector containing the carry produced by subtracting each set of corresponding elements of the given vectors.

Result value:

The value of each element of the result is the value of the carry produced by subtracting the value of the corresponding element of ARG2 from the value of the corresponding element of ARG1. The value is 0 if a borrow occurred, or 1 if no borrow occurred.

vector signed int vec_subc (vector signed int, vector signed int);

vector unsigned int vec_subc (vector unsigned int, vector unsigned int);

vector signed __int128 vec_subc (vector signed __int128, vector signed __int128);

vector unsigned __int128 vec_subc (vector unsigned __int128, vector unsigned __int128);

VEC_SUBE (ARG1, ARG2, ARG3)

Purpose:

Returns a vector containing the result of first elementwise subtracting vector ARG2 from vector ARG1, and then elementwise adding vector ARG3 to the difference. ARG3 is a carry vector, with each element having a value of 0 or 1.

Result value:

The value of each element of the result is produced by subtracting the corresponding element of ARG2 from the corresponding element of ARG1, and then adding the carry specified in the corresponding element of ARG3 (1 if there is a carry, 0 otherwise).

vector signed int vec_sube (vector signed int, vector signed int, vector signed int);

vector unsigned int vec_sube (vector unsigned int, vector unsigned int, vector unsigned int);

vector signed __int128 vec_sube (vector signed __int128, vector signed __int128, vector signed __int128);

vector unsigned __int128 vec_sube (vector unsigned __int128, vector unsigned __int128, vector unsigned __int128);

VEC_SUBEC (ARG1, ARG2, ARG3)

Purpose:

Returns a vector containing the carries produced by first elementwise subtracting vector ARG2 from vector ARG1, and then elementwise adding vector ARG3 to the difference. ARG3 is a carry vector, with each element having a value of 0 or 1.

Result value:

The value of each element of the result is the carry produced by subtracting the corresponding element of ARG2 from the corresponding element of ARG1, and then adding the carry specified in the corresponding element of ARG3 (1 if there is a carry, 0 otherwise).

vector signed int vec_subec (vector signed int, vector signed int, vector signed int);

vector unsigned int vec_subec (vector unsigned int, vector unsigned int, vector unsigned int);

vector signed __int128 vec_subec (vector signed __int128, vector signed __int128, vector signed __int128);

vector unsigned __int128 vec_subec (vector unsigned __int128, vector unsigned __int128, vector unsigned __int128);

VEC_SUBS (ARG1, ARG2)

Purpose:

Returns a vector containing the saturated differences of each set of corresponding elements of the given vectors.

Result value:

The value of each element of the result is the saturated result of subtracting the value of the corresponding element of ARG2 from the value of the corresponding element of ARG1.

vector signed char vec_subs (vector signed char, vector signed char);

vector unsigned char vec_subs (vector unsigned char, vector unsigned char);

vector signed int vec_subs (vector signed int, vector signed int);

vector unsigned int vec_subs (vector unsigned int, vector unsigned int);

vector signed short vec_subs (vector signed short, vector signed short);

vector unsigned short vec_subs (vector unsigned short, vector unsigned short);

VEC_SUM2S (ARG1, ARG2)

Purpose:

Returns a vector containing the results of performing a sum-across-doublewords vector operation on the given vectors.

Result value:

The first and third element of the result are 0. The second element of the result contains the saturated sum of the first and second elements of ARG1 and the second element of ARG2. The fourth element of the result contains the saturated sum of the third and fourth elements of ARG1 and the fourth element of ARG2.

vector signed int vec_sum2s (vector signed int, vector signed int);

VEC_SUM4S (ARG1, ARG2)

Purpose:

Returns a vector containing the results of performing a sum-across-words vector operation on the given vectors.

Result value:

Assume that the elements of each vector are numbered beginning with 0. If ARG1 is a vector signed char vector or a vector unsigned char vector, then let m be 4. Otherwise, let m be 2. For each element n of the result vector, the value is obtained by adding elements mn through mn + m – 1 of ARG1 and element n of ARG2 using saturated addition.

vector signed int vec_sum4s (vector signed char, vector signed int);

vector signed int vec_sum4s (vector signed short, vector signed int);

vector unsigned int vec_sum4s (vector unsigned char, vector unsigned int);

VEC_SUMS (ARG1, ARG2)

Purpose:

Returns a vector containing the results of performing a sum across vector operation on the given vectors.

Result value:

The first three elements of the result are 0. The fourth element is the saturated sum of all the elements of ARG1 and the fourth element of ARG2.

vector signed int vec_sums (vector signed int, vector signed int);

VEC_TEST_DATA_CLASS (ARG1, ARG2)

POWER ISA 3.0

Purpose:

Determines the data class for each floating-point element.

Result value:

Each element is set to all ones if the corresponding element of ARG1 matches one of the possible data types selected by ARG2. If not, each element is set to all zeros. ARG2 can select one of the data types defined in Table A.7, “Constants Used with vec_test_data_class”.

POWER ISA 3.0

vector bool int vec_test_data_class (vector float, const int);

POWER ISA 3.0

vector bool long long vec_test_data_class (vector double, const int);

VEC_TRUNC (ARG1)

Purpose:

Returns a vector containing the truncated values of the corresponding elements of the given vector.

Result value:

Each element of the result contains the value of the corresponding element of ARG1, truncated to an integral value.

vector double vec_trunc (vector double);

vector float vec_trunc (vector float);

VEC_UNPACKH (ARG1)

Purpose:

Unpacks the most-significant (“high”) half of a vector into a vector with larger elements.

Result value:

If ARG1 is an integer vector, the value of each element of the result is the value of the corresponding element of the most-significant half of ARG1.

If ARG1 is a floating-point vector, the value of each element of the result is the value of the corresponding element of the most-significant half of ARG1, widened to the result precision.

If ARG1 is a pixel vector, the value of each element of the result is taken from the corresponding element of the most-significant half of ARG1 as follows:

  • All bits in the first byte of the element of the result are set to the value of the first bit of the element of ARG1.

  • The least-significant 5 bits of the second byte of the element of the result are set to the value of the next 5 bits in the element of ARG1.

  • The least-significant 5 bits of the third byte of the element of the result are set to the value of the next 5 bits in the element of ARG1.

  • The least-significant 5 bits of the fourth byte of the element of the result are set to the value of the next 5 bits in the element of ARG1.

vector bool int vec_unpackh (vector bool short);

vector signed int vec_unpackh (vector signed short);

vector unsigned int vec_unpackh (vector pixel);

vector bool long long vec_unpackh (vector bool int);

vector signed long long vec_unpackh (vector signed int);

vector bool short vec_unpackh (vector bool char);

vector signed short vec_unpackh (vector signed char);

Phased in.[a]

vector double vec_unpackh (vector float);

POWER ISA 3.0

Phased in.[a]

vector float vec_unpackh (vector _Float16);

VEC_UNPACKL (ARG1)

Purpose:

Unpacks the least-significant (“low”) half of a vector into a vector with larger elements.

Result value:

If ARG1 is an integer vector, the value of each element of the result is the value of the corresponding element of the least-significant half of ARG1.

If ARG1 is a floating-point vector, the value of each element of the result is the value of the corresponding element of the least-significant half of ARG, widened to the result precision.

If ARG1 is a pixel vector, the value of each element of the result is taken from the corresponding element of the least-significant half of ARG1 as follows:

  • All bits in the first byte of the element of the result are set to the value of the first bit of the element of ARG1.

  • The least-significant 5 bits of the second byte of the element of the result are set to the value of the next 5 bits in the element of ARG1.

  • The least-significant 5 bits of the third byte of the element of the result are set to the value of the next 5 bits in the element of ARG1.

  • The least-significant 5 bits of the fourth byte of the element of the result are set to the value of the next 5 bits in the element of ARG1.

vector bool int vec_unpackl (vector bool short);

vector signed int vec_unpackl (vector signed short);

vector unsigned int vec_unpackl (vector pixel);

vector bool long long vec_unpackl (vector bool int);

vector signed long long vec_unpackl (vector signed int);

vector bool short vec_unpackl (vector bool char);

vector signed short vec_unpackl (vector signed char);

Phased in.[a]

vector double vec_unpackl (vector float);

POWER ISA 3.0

Phased in.[a]

vector float vec_unpackl (vector _Float16);

VEC_UNSIGNED (ARG1)

Purpose:

Converts a vector of double-precision numbers to a vector of unsigned integers.

Result value:

Target elements are obtained by truncating the respective source elements to unsigned integers.

vector unsigned int vec_unsigned (vector float);

vector unsigned long long vec_unsigned (vector double);

VEC_UNSIGNED2 (ARG1, ARG2)

Purpose:

Converts a vector of double-precision numbers to a vector of unsigned integers.

Result value:

Target elements are obtained by truncating the source elements to the unsigned integers as follows:

  • Target elements 0 and 1 from source 0

  • Target elements 2 and 3 from source 1

vector unsigned int vec_unsigned2 (vector double, vector double);

VEC_UNSIGNEDE (ARG1)

Purpose:

Converts an input vector to a vector of unsigned integers.

Result value:

The even target elements are obtained by truncating the source elements to unsigned integers as follows:

Target elements 0 and 2 contain the converted values of the input vector.

vector unsigned int vec_unsignede (vector double);

VEC_UNSIGNEDO (ARG1)

Purpose:

Converts an input vector to a vector of unsigned integers.

Result value:

The odd target elements are obtained by truncating the source elements to unsigned integers as follows:

Target elements 1 and 3 contain the converted values of the input vector.

vector unsigned int vec_unsignedo (vector double);

VEC_XL (ARG1, ARG2)

Purpose:

Loads a 16-byte vector from the memory address specified by the displacement and the pointer.

Result value:

This function adds the displacement and the pointer R-value to obtain the address for the load operation.

[Important]Important

For languages that support built-in methods for pointer dereferencing, such as the C/C++ pointer dereference * and array access [ ] operators, use of the native operators is encouraged and use of the vec_xl intrinsic is discouraged.

vector signed char vec_xl (signed long long, signed char *);

vector unsigned char vec_xl (signed long long, unsigned char *);

vector signed int vec_xl (signed long long, signed int *);

vector unsigned int vec_xl (signed long long, unsigned int *);

vector signed __int128 vec_xl (signed long long, signed __int128 *);

vector unsigned __int128 vec_xl (signed long long, unsigned __int128 *);

vector signed signed long long vec_xl (signed long long, signed long long *);

vector unsigned long long vec_xl (signed long long, unsigned long long *);

vector signed short vec_xl (signed long long, signed short *);

vector unsigned short vec_xl (signed long long, unsigned short *);

vector double vec_xl (signed long long, double *);

vector float vec_xl (signed long long, float *);

POWER ISA 3.0

Phased in.[a]

vector _Float16 vec_xl (signed long long, _Float16 *);

VEC_XL_BE (ARG1. ARG2)

Purpose:

In little-endian environments, loads the elements of the 16-byte vector ARG1 starting with the highest-numbered element at the memory address specified by the displacement ARG1 and the pointer ARG2. In big-endian environments, this operator performs the same operation as VEC_XL.

Result value:

In little-endian mode, loads the elements of the vector in sequential order, with the highest-numbered element loaded from the lowest data address and the lowest-numbered element of the vector at the highest address. All elements are loaded in little-endian data format.

This function adds the displacement and the pointer R-value to obtain the address for the load operation. It does not truncate the affected address to a multiple of 16 bytes.

vector signed char vec_xl_be (signed long long, signed char *);

vector unsigned char vec_xl_be (signed long long, unsigned char *);

vector signed int vec_xl_be (signed long long, signed int *);

vector unsigned int vec_xl_be (signed long long, unsigned int *);

vector signed __int128 vec_xl_be (signed long long, signed __int128 *);

vector unsigned __int128 vec_xl_be (signed long long, unsigned __int128 *);

vector signed long long vec_xl_be (signed long long, signed long long *);

vector unsigned long long vec_xl_be (signed long long, unsigned long long *);

vector signed short vec_xl_be (signed long long, signed short *);

vector unsigned short vec_xl_be (signed long long, unsigned short *);

vector double vec_xl_be (signed long long, double *);

vector float vec_xl_be (signed long long, float *);

POWER ISA 3.0

Phased in.[a]

vector _Float16 vec_xl_be (signed long long, _Float16 *);

VEC_XL_LEN (ARG1, ARG2)

POWER ISA 3.0

Purpose:

Loads a vector of a specified byte length.

Result value:

Loads the number of bytes specified by ARG2 from the address specified in ARG1. Initializes elements in order from the byte stream (as defined by the endianness of the operating environment). Any bytes of elements that cannot be initialized from the number of loaded bytes have a zero value.

At least 0 and at most 16 bytes will be loaded. The length is specified by the least-significant byte of ARG2, as min (mod (ARG2, 256), 16). The behavior is undefined if the length argument is outside of the range 0–255, or if it is not a multiple of the vector element size.

POWER ISA 3.0

vector signed char vec_xl_len (signed char *, size_t);

POWER ISA 3.0

vector unsigned char vec_xl_len (unsigned char *, size_t);

POWER ISA 3.0

vector signed int vec_xl_len (signed int *, size_t);

POWER ISA 3.0

vector unsigned int vec_xl_len (unsigned int *, size_t);

POWER ISA 3.0

vector signed __int128 vec_xl_len (signed __int128 *, size_t);

POWER ISA 3.0

vector unsigned __int128 vec_xl_len (unsigned __int128 *, size_t);

POWER ISA 3.0

vector signed long long vec_xl_len (signed long long *, size_t);

POWER ISA 3.0

vector unsigned long long vec_xl_len (unsigned long long *, size_t);

POWER ISA 3.0

vector signed short vec_xl_len (signed short *, size_t);

POWER ISA 3.0

vector unsigned short vec_xl_len (unsigned short *, size_t);

POWER ISA 3.0

vector double vec_xl_len (double *, size_t);

POWER ISA 3.0

vector float vec_xl_len (float *, size_t);

POWER ISA 3.0

vector _Float16 vec_xl_len (_Float16 *, size_t);

VEC_XL_LEN_R (ARG1, ARG2)

POWER ISA 3.0

Purpose

Loads a vector of a specified byte length, right-justified.

Result value:

Loads the number of bytes specified by ARG2 from the address specified in ARG1, right justified with the first byte to the left and the last to the right. Initializes elements in order from the byte stream (as defined by the endianness of the operating environment). Any bytes of elements that cannot be initialized from the number of loaded bytes have a zero value.

At least 0 and at most 16 bytes will be loaded. The length is specified by the least-significant byte of ARG2, as min (mod (ARG2, 256), 16). The behavior is undefined if the length argument is outside of the range 0–255, or if it is not a multiple of the vector element size.

POWER ISA 3.0

vector unsigned char vec_xl_len_r (unsigned char *, size_t);

VEC_XOR (ARG1, ARG2)

Purpose:

Performs a bitwise XOR of the given vectors.

Result value:

The result is the bitwise XOR of ARG1 and ARG2.

vector bool char vec_xor (vector bool char, vector bool char);

vector signed char vec_xor (vector signed char, vector signed char);

vector unsigned char vec_xor (vector unsigned char, vector unsigned char);

vector bool int vec_xor (vector bool int, vector bool int);

vector signed int vec_xor (vector signed int, vector signed int);

vector unsigned int vec_xor (vector unsigned int, vector unsigned int);

vector bool long long vec_xor (vector bool long long, vector bool long long);

Phased in.[a]

vector signed long long vec_xor (vector signed long long, vector signed long long);

Phased in.[a]

vector unsigned long long vec_xor (vector unsigned long long, vector unsigned long long);

vector bool short vec_xor (vector bool short, vector bool short);

vector signed short vec_xor (vector signed short, vector signed short);

vector unsigned short vec_xor (vector unsigned short, vector unsigned short);

vector double vec_xor (vector double, vector double);

vector float vec_xor (vector float, vector float);

VEC_XST (ARG1, ARG2, ARG3)

Purpose

Stores the elements of the 16-byte vector to the effective address obtained by adding the displacement provided in the address provided.

Result value:

Stores the provided vector in memory.

[Important]Important

For languages that support built-in methods for pointer dereferencing, such as the C/C++ pointer dereference * and array access [ ] operators, use of the native operators is encouraged and use of the vec_xl intrinsic is discouraged.

void vec_xst (vector signed char, signed long long, signed char *);

void vec_xst (vector unsigned char, signed long long, unsigned char *);

void vec_xst (vector signed int, signed long long, signed int *);

void vec_xst (vector unsigned int, signed long long, unsigned int *);

void vec_xst (vector signed __int128, signed long long, signed __int128 *);

void vec_xst (vector unsigned __int128, signed long long, unsigned __int128 *);

void vec_xst (vector signed long long, signed long long, signed long long *);

void vec_xst (vector unsigned long long, signed long long, unsigned long long *);

void vec_xst (vector signed short, signed long long, signed short *);

void vec_xst (vector unsigned short, signed long long, unsigned short *);

void vec_xst (vector double, signed long long, double *);

void vec_xst (vector float, signed long long, float *);

POWER ISA 3.0

Phased in.[a]

void vec_xst (vector _Float16, signed long long, _Float16 *);

VEC_XST_BE (ARG1, ARG2, ARG3)

Purpose:

In little-endian environments, stores the elements of the 16-byte vector ARG1 starting with the highest-numbered element at the memory address specified by the displacement ARG1 and the pointer ARG2. In big-endian environments, this operator performs the same operation as VEC_XST.

Result value:

In little-endian mode, stores the elements of the vector in sequential order, with the highest-numbered element stored at the lowest data address and the lowest-numbered element of the vector at the highest address. All elements are stored in little-endian data format.

This function adds the displacement and the pointer R-value to obtain the address for the store operation. It does not truncate the affected address to a multiple of 16 bytes.

void vec_xst_be (vector signed char, signed long long, signed char *);

void vec_xst_be (vector unsigned char, signed long long, unsigned char *);

void vec_xst_be (vector signed int, signed long long, signed int *);

void vec_xst_be (vector unsigned int, signed long long, unsigned int *);

void vec_xst_be (vector signed __int128, signed long long, signed __int128 *);

void vec_xst_be (vector unsigned __int128, signed long long, unsigned __int128 *);

void vec_xst_be (vector signed long long, signed long long, signed long long *);

void vec_xst_be (vector unsigned long long, signed long long, unsigned long long *);

void vec_xst_be (vector signed short, signed long long, signed short *);

void vec_xst_be (vector unsigned short, signed long long, unsigned short *);

void vec_xst_be (vector double, signed long long, double *);

void vec_xst_be (vector float, signed long long, float *);

POWER ISA 3.0

Phased in.[a]

void vec_xst_be (vector _Float16, signed long long, _Float16 *);

VEC_XST_LEN (ARG1, ARG2, ARG3)

POWER ISA 3.0

Purpose:

Stores a vector of a specified byte length.

Result value:

Stores the number of bytes specified by ARG3 of the vector ARG1 to the address specified in ARG2. The bytes are obtained starting from the lowest-numbered byte of the lowest-numbered element (as defined by the endianness of the operating environment). All bytes of an element are accessed before proceeding to the next higher element.

At least 0 and at most 16 bytes will be stored. The length is specified by the least-significant byte of ARG3, as min (mod (ARG3, 256), 16). The behavior is undefined if the length argument is outside of the range 0–255, or if it is not a multiple of the vector element size.

POWER ISA 3.0

void vec_xst_len (vector signed char, signed char *, size_t);

POWER ISA 3.0

void vec_xst_len (vector unsigned char, unsigned char *, size_t);

POWER ISA 3.0

void vec_xst_len (vector signed int, signed int *, size_t);

POWER ISA 3.0

void vec_xst_len (vector unsigned int, unsigned int *, size_t);

POWER ISA 3.0

void vec_xst_len (vector signed __int128, signed __int128 *, size_t);

POWER ISA 3.0

void vec_xst_len (vector unsigned __int128, unsigned __int128 *, size_t);

POWER ISA 3.0

void vec_xst_len (vector signed long long, signed long long *, size_t);

POWER ISA 3.0

void vec_xst_len (vector unsigned long long, unsigned long long *, size_t);

POWER ISA 3.0

void vec_xst_len (vector signed short, signed short *, size_t);

POWER ISA 3.0

void vec_xst_len (vector unsigned short, unsigned short *, size_t);

POWER ISA 3.0

void vec_xst_len (vector double, double *, size_t);

POWER ISA 3.0

void vec_xst_len (vector float, float *, size_t);

POWER ISA 3.0

void vec_xst_len (vector _Float16, _Float16 *, size_t);

VEC_XST_LEN_R (ARG1, ARG2, ARG3)

POWER ISA 3.0

Purpose:

Stores a right-justified vector of a specified byte length.

Result value:

Stores the number of bytes specified by ARG3 of the right-justified vector ARG1 to the address specified by ARG2.

At least 0 and at most 16 bytes will be stored. The length is specified by the least-significant byte of ARG3, as min (mod (ARG2, 256), 16). The behavior is undefined if the length argument is outside of the range 0–255, or if it is not a multiple of the vector element size.

POWER ISA 3.0

void vec_xst_len_r (vector unsigned char, unsigned char *, size_t);

[a] This optional function is being phased in, and it might not be available on all implementations. Phased-in interfaces are optional for the current generation of compliant systems.



loading table of contents...