Arithmetic
On this Page
Arithmetic¶
Absolute¶
Represents ABS instruction - Calculates absolute value.
This operation is implemented as instruction ABS for integer operands and FORM_FP_NUMBER for floating point (actually AND on SPU).
Intrinsics Prototype and Arguments
float s_f32_abs(float a, int switches=0, float income=0, bool predicate=1, bool polarity=0) |
bf16 s_bf16_abs(bf16 a, int switches=0, bf16 income=0, bool predicate=1, bool polarity=0) |
int32_t s_i32_abs(int32_t a, int switches=0, int32_t income=0, bool predicate=1, bool polarity=0) |
int16_t s_i16_abs(int16_t a, int switches=0, int16_t income=0, bool predicate=1, bool polarity=0) |
int8_t s_i8_abs(int8_t a, int switches=0, int8_t income=0, bool predicate=1, bool polarity=0) |
float64 v_f32_abs_b(float64 a, int switches=0, float64 income=0, bool predicate=1, bool polarity=0) |
float64 v_f32_abs_vb(float64 a, int switches, float64 income, bool64 predicate, bool polarity=0) |
bfloat128 v_bf16_abs_b(bfloat128 a, int switches=0, bfloat128 income=0, bool predicate=1, bool polarity=0) |
bfloat128 v_bf16_abs_vb(bfloat128 a, int switches, bfloat128 income, bool128 predicate, bool polarity=0) |
int64 v_i32_abs_b(int64 a, int switches=0, int64 income=0, bool predicate=1, bool polarity=0) |
int64 v_i32_abs_vb(int64 a, int switches, int64 income, bool64 predicate, bool polarity=0) |
short128 v_i16_abs_b(short128 a, int switches=0, short128 income=0, bool predicate=1, bool polarity=0) |
short128 v_i16_abs_vb(short128 a, int switches, short128 income, bool128 predicate, bool polarity=0) |
char256 v_i8_abs_b(char256 a, int switches=0, char256 income=0, bool predicate=1, bool polarity=0) |
char256 v_i8_abs_vb(char256 a, int switches, char256 income, bool256 predicate, bool polarity=0) |
a |
The argument (SRC1). |
switches |
Switches of ABS instructions. |
income |
This value is returned if the predicate is false. |
predicate |
Predicate value for the instruction. |
polarity |
True if polarity of the predicate is inverted. |
Absolute value of operand a.
Add¶
Represents ADD instruction.
Intrinsics Prototype and Arguments
float s_f32_add(float a, float b, int switches=0, float income={}, bool predicate=1, bool polarity=0) |
bf16 s_bf16_add(bf16 a, bf16 b, int switches=0, bf16 income={}, bool predicate=1, bool polarity=0) |
int32_t s_i32_add(int32_t a, int32_t b, int switches=0, int32_t income={}, bool predicate=1, bool polarity=0) |
uint32_t s_u32_add(uint32_t a, uint32_t b, int switches=0, uint32_t income={}, bool predicate=1, bool polarity=0) |
int16_t s_i16_add(int16_t a, int16_t b, int switches=0, int16_t income={}, bool predicate=1, bool polarity=0) |
uint16_t s_u16_add(uint16_t a, uint16_t b, int switches=0, uint16_t income={}, bool predicate=1, bool polarity=0) |
int8_t s_i8_add(int8_t a, int8_t b, int switches=0, int8_t income={}, bool predicate=1, bool polarity=0) |
uint8_t s_u8_add(uint8_t a, uint8_t b, int switches=0, uint8_t income={}, bool predicate=1, bool polarity=0) |
float64 v_f32_add_vb(float64 a, float64 b, int switches, float64 income, bool64 predicate, bool polarity=0) |
float64 v_f32_add_b(float64 a, float64 b, int switches=0, float64 income={}, bool predicate=1, bool polarity=0) |
bfloat128 v_bf16_add_vb(bfloat128 a, bfloat128 b, int switches, bfloat128 income, bool128 predicate, bool polarity=0) |
bfloat128 v_bf16_add_b(bfloat128 a, bfloat128 b, int switches=0, bfloat128 income={}, bool predicate=1, bool polarity=0) |
int64 v_i32_add_vb(int64 a, int64 b, int switches, int64 income, bool64 predicate, bool polarity=0) |
int64 v_i32_add_b(int64 a, int64 b, int switches=0, int64 income={}, bool predicate=1, bool polarity=0) |
uint64 v_u32_add_vb(uint64 a, uint64 b, int switches, uint64 income, bool64 predicate, bool polarity=0) |
uint64 v_u32_add_b(uint64 a, uint64 b, int switches=0, uint64 income={}, bool predicate=1, bool polarity=0) |
short128 v_i16_add_vb(short128 a, short128 b, int switches, short128 income, bool128 predicate, bool polarity=0) |
short128 v_i16_add_b(short128 a, short128 b, int switches=0, short128 income={}, bool predicate=1, bool polarity=0) |
ushort128 v_u16_add_vb(ushort128 a, ushort128 b, int switches, ushort128 income, bool128 predicate, bool polarity=0) |
ushort128 v_u16_add_b(ushort128 a, ushort128 b, int switches=0, ushort128 income={}, bool predicate=1, bool polarity=0) |
char256 v_i8_add_vb(char256 a, char256 b, int switches, char256 income, bool256 predicate, bool polarity=0) |
char256 v_i8_add_b(char256 a, char256 b, int switches=0, char256 income={}, bool predicate=1, bool polarity=0) |
uchar256 v_u8_add_vb(uchar256 a, uchar256 b, int switches, uchar256 income, bool256 predicate, bool polarity=0) |
uchar256 v_u8_add_b(uchar256 a, uchar256 b, int switches=0, uchar256 income={}, bool predicate=1, bool polarity=0) |
a |
The first SRC operand to ADD (SRC1). |
b |
The second SRC operand to ADD (SRC2). |
switches |
Switches of ADD instructions. |
income |
This value is returned if the predicate is false. |
predicate |
Predicate value for the instruction. |
polarity |
True if polarity of the predicate is inverted. |
Allowed switches are:
SW_SAT - Saturate (integer types only).
Sum of operands a and b.
And¶
Represents AND instruction, performs bitwise and.
Intrinsics Prototype and Arguments
float s_f32_and(float a, float b, int switches=0, float income={}, bool predicate=1, bool polarity=0) |
bf16 s_bf16_and(bf16 a, bf16 b, int switches=0, bf16 income={}, bool predicate=1, bool polarity=0) |
int32_t s_i32_and(int32_t a, int32_t b, int switches=0, int32_t income={}, bool predicate=1, bool polarity=0) |
uint32_t s_u32_and(uint32_t a, uint32_t b, int switches=0, uint32_t income={}, bool predicate=1, bool polarity=0) |
int16_t s_i16_and(int16_t a, int16_t b, int switches=0, int16_t income={}, bool predicate=1, bool polarity=0) |
uint16_t s_u16_and(uint16_t a, uint16_t b, int switches=0, uint16_t income={}, bool predicate=1, bool polarity=0) |
int8_t s_i8_and(int8_t a, int8_t b, int switches=0, int8_t income={}, bool predicate=1, bool polarity=0) |
uint8_t s_u8_and(uint8_t a, uint8_t b, int switches=0, uint8_t income={}, bool predicate=1, bool polarity=0) |
bool s_i1_and(bool a, bool b, int switches=0, bool income={}, bool predicate=1, bool polarity=0) |
float64 v_f32_and_vb(float64 a, float64 b, int switches, float64 income, bool64 predicate, bool polarity=0) |
float64 v_f32_and_b(float64 a, float64 b, int switches=0, float64 income={}, bool predicate=1, bool polarity=0) |
bfloat128 v_bf16_and_vb(bfloat128 a, bfloat128 b, int switches, bfloat128 income, bool128 predicate, bool polarity=0) |
bfloat128 v_bf16_and_b(bfloat128 a, bfloat128 b, int switches=0, bfloat128 income={}, bool predicate=1, bool polarity=0) |
int64 v_i32_and_vb(int64 a, int64 b, int switches, int64 income, bool64 predicate, bool polarity=0) |
int64 v_i32_and_b(int64 a, int64 b, int switches=0, int64 income={}, bool predicate=1, bool polarity=0) |
uint64 v_u32_and_vb(uint64 a, uint64 b, int switches, uint64 income, bool64 predicate, bool polarity=0) |
uint64 v_u32_and_b(uint64 a, uint64 b, int switches=0, uint64 income={}, bool predicate=1, bool polarity=0) |
short128 v_i16_and_vb(short128 a, short128 b, int switches, short128 income, bool128 predicate, bool polarity=0) |
short128 v_i16_and_b(short128 a, short128 b, int switches=0, short128 income={}, bool predicate=1, bool polarity=0) |
ushort128 v_u16_and_vb(ushort128 a, ushort128 b, int switches, ushort128 income, bool128 predicate, bool polarity=0) |
ushort128 v_u16_and_b(ushort128 a, ushort128 b, int switches=0, ushort128 income={}, bool predicate=1, bool polarity=0) |
char256 v_i8_and_vb(char256 a, char256 b, int switches, char256 income, bool256 predicate, bool polarity=0) |
char256 v_i8_and_b(char256 a, char256 b, int switches=0, char256 income={}, bool predicate=1, bool polarity=0) |
uchar256 v_u8_and_vb(uchar256 a, uchar256 b, int switches, uchar256 income, bool256 predicate, bool polarity=0) |
uchar256 v_u8_and_b(uchar256 a, uchar256 b, int switches=0, uchar256 income={}, bool predicate=1, bool polarity=0) |
bool256 v_i1_and_b(bool256 a, bool256 b, int switches=0, bool256 income={}, bool predicate=1, bool polarity=0) |
bool256 v_i1_and_vb(bool256 a, bool256 b, int switches, bool256 income, bool256 predicate, bool polarity=0) |
a |
The first SRC operand to AND (SRC1). |
b |
The second SRC operand to AND (SRC2). |
switches |
Switches of AND instructions. |
income |
This value is returned if the predicate is false. |
predicate |
Predicate value for the instruction. |
polarity |
True if polarity of the predicate is inverted. |
Result of AND operation between a and b.
Arithmetic Shift¶
Represents ASH instruction.
Intrinsics Prototype and Arguments
int32_t s_i32_ash(int32_t a, int8_t b, int switches=0, int32_t income={}, bool predicate=1, bool polarity=0) |
uint32_t s_u32_ash(uint32_t a, int8_t b, int switches=0, uint32_t income={}, bool predicate=1, bool polarity=0) |
int16_t s_i16_ash(int16_t a, int8_t b, int switches=0, int16_t income={}, bool predicate=1, bool polarity=0) |
uint16_t s_u16_ash(uint16_t a, int8_t b, int switches=0, uint16_t income={}, bool predicate=1, bool polarity=0) |
int8_t s_i8_ash(int8_t a, int8_t b, int switches=0, int8_t income={}, bool predicate=1, bool polarity=0) |
uint8_t s_u8_ash(uint8_t a, int8_t b, int switches=0, uint8_t income={}, bool predicate=1, bool polarity=0) |
int64 v_i32_ash_b(int64 a, char256 b, int switches=0, int64 income={}, bool predicate=1, bool polarity=0) |
int64 v_i32_ash_vb(int64 a, char256 b, int switches, int64 income, bool64 predicate, bool polarity=0) |
uint64 v_u32_ash_b(uint64 a, char256 b, int switches=0, uint64 income={}, bool predicate=1, bool polarity=0) |
uint64 v_u32_ash_vb(uint64 a, char256 b, int switches, uint64 income, bool64 predicate, bool polarity=0) |
short128 v_i16_ash_b(short128 a, char256 b, int switches=0, short128 income={}, bool predicate=1, bool polarity=0) |
short128 v_i16_ash_vb(short128 a, char256 b, int switches, short128 income, bool128 predicate, bool polarity=0) |
ushort128 v_u16_ash_b(ushort128 a, char256 b, int switches=0, ushort128 income={}, bool predicate=1, bool polarity=0) |
ushort128 v_u16_ash_vb(ushort128 a, char256 b, int switches, ushort128 income, bool128 predicate, bool polarity=0) |
char256 v_i8_ash_b(char256 a, char256 b, int switches=0, char256 income={}, bool predicate=1, bool polarity=0) |
char256 v_i8_ash_vb(char256 a, char256 b, int switches, char256 income, bool256 predicate, bool polarity=0) |
uchar256 v_u8_ash_b(uchar256 a, char256 b, int switches=0, uchar256 income={}, bool predicate=1, bool polarity=0) |
uchar256 v_u8_ash_vb(uchar256 a, char256 b, int switches, uchar256 income, bool256 predicate, bool polarity=0) |
a |
The value to shift (SRC1). |
b |
The number of bits to shift (SRC2). |
switches |
Switches of ASH instructions. |
income |
This value is returned if the predicate is false. |
predicate |
Predicate value for the instruction. |
polarity |
True if polarity of the predicate is inverted. |
Allowed switches are:
SW_SAT - Saturate (should always be set, left shift saturation is enabled by default).
SW_RHU - Round half up.
Result of operation - DEST=a*(2^b).
Calc Fp Special¶
Represents CALC_FP_SPECIAL instruction.
Intrinsics Prototype and Arguments
float s_f32_calc_fp_special(float src1, float src2, int switches, float income, bool predicate=1, bool polarity=0) |
bf16 s_bf16_calc_fp_special(bf16 src1, bf16 src2, int switches, bf16 income, bool predicate=1, bool polarity=0) |
float64 v_f32_calc_fp_special_b(float64 src1, float64 src2, int switches, float64 income, bool predicate=1, bool polarity=0) |
float64 v_f32_calc_fp_special_vb(float64 src1, float64 src2, int switches, float64 income, bool64 predicate, bool polarity=0) |
bfloat128 v_bf16_calc_fp_special_b(bfloat128 src1, bfloat128 src2, int switches, bfloat128 income, bool predicate=1, bool polarity=0) |
bfloat128 v_bf16_calc_fp_special_vb(bfloat128 src1, bfloat128 src2, int switches, bfloat128 income, bool128 predicate, bool polarity=0) |
src1 |
The first operand (SRC1). |
src2 |
The second SRC operand (SRC2). For unary functions it is ignored and may be of any value, for instance, zero. src1 and src2 are 8/10bit-masks format (vector or scalar) representing the class of the operands - returned value of FCLASS instruction. |
switches |
Code of the function. |
income |
This value is returned if the predicate is false. |
predicate |
Predicate value for the instruction. |
polarity |
True if polarity of the predicate is inverted. |
Allowed switches are:
[SPECIAL_FUNC]
SW_RECIP - reciprocal - 1/x
SW_RSQRT - reciprocal square root of x
SW_SQRT - square root of x
SW_LOG - logarithm of x
SW_EXP - exponent - e^x
SW_TANH - hyperbolic tangent of x
SW_DIV - divide - x/y
SW_POW - power - x^y
Calculate the choosen function for all special class elements.
(for non special class elements returns income).
Extract Exponent¶
Represents EXTRACT_EXP instruction.
Intrinsics Prototype and Arguments
int32_t s_f32_extract_exp(float a, int switches=0, int32_t income={}, bool predicate=1, bool polarity=0) |
int16_t s_bf16_extract_exp(bf16 a, int switches=0, int16_t income={}, bool predicate=1, bool polarity=0) |
int64 v_f32_extract_exp_vb(float64 a, int switches, int64 income, bool64 predicate, bool polarity=0) |
int64 v_f32_extract_exp_b(float64 a, int switches=0, int64 income={}, bool predicate=1, bool polarity=0) |
short128 v_bf16_extract_exp_vb(bfloat128 a, int switches, short128 income, bool128 predicate, bool polarity=0) |
short128 v_bf16_extract_exp_b(bfloat128 a, int switches=0, short128 income={}, bool predicate=1, bool polarity=0) |
a |
Input float number (SRC1). |
switches |
Instruction switches. |
income |
This value is returned if the predicate is false. |
predicate |
Predicate value for the instruction. |
polarity |
True if polarity of the predicate is inverted. |
Allowed switches are:
SW_BIASED - When set, the exponent should be biased (unsigned). When cleared, the exponent should be non-biased (signed).
Mantissa of the input value.
FCLASS¶
Represents FCLASS instruction.
10bit mask maps to the following classes: (returned for 16/32 bit data types)
Intrinsics Prototype and Arguments
float s_f32_fclass(float a, int switches=0, float income={}, bool predicate=1, bool polarity=0) |
bf16 s_bf16_fclass(bf16 a, int switches=0, bf16 income={}, bool predicate=1, bool polarity=0) |
float64 v_f32_fclass_b(float64 a, int switches=0, float64 income={}, bool predicate=1, bool polarity=0) |
float64 v_f32_fclass_vb(float64 a, int switches, float64 income, bool64 predicate, bool polarity=0) |
bfloat128 v_bf16_fclass_b(bfloat128 a, int switches=0, bfloat128 income={}, bool predicate=1, bool polarity=0) |
bfloat128 v_bf16_fclass_vb(bfloat128 a, int switches, bfloat128 income, bool128 predicate, bool polarity=0) |
a |
The input value (SRC1). |
switches |
Switches of the instructions. |
income |
This value is returned if the predicate is false. |
predicate |
Predicate value for the instruction. |
polarity |
True if polarity of the predicate is inverted. |
8/10bit-masks format describing the input value.
Find First¶
Represents FIND_FIRST instruction.
Intrinsics Prototype and Arguments
uint8_t s_f32_find_first(float a, int switches=0, uint8_t income={}, bool predicate=1, bool polarity=0) |
uint8_t s_bf16_find_first(bf16 a, int switches=0, uint8_t income={}, bool predicate=1, bool polarity=0) |
uint8_t s_i32_find_first(int32_t a, int switches=0, uint8_t income={}, bool predicate=1, bool polarity=0) |
uint8_t s_u32_find_first(uint32_t a, int switches=0, uint8_t income={}, bool predicate=1, bool polarity=0) |
uint8_t s_i16_find_first(int16_t a, int switches=0, uint8_t income={}, bool predicate=1, bool polarity=0) |
uint8_t s_u16_find_first(uint16_t a, int switches=0, uint8_t income={}, bool predicate=1, bool polarity=0) |
uint8_t s_i8_find_first(int8_t a, int switches=0, uint8_t income={}, bool predicate=1, bool polarity=0) |
uint8_t s_u8_find_first(uint8_t a, int switches=0, uint8_t income={}, bool predicate=1, bool polarity=0) |
uchar256 v_f32_find_first_b(float64 a, int switches=0, uchar256 income={}, bool predicate=1, bool polarity=0) |
uchar256 v_f32_find_first_vb(float64 a, int switches, uchar256 income, bool64 predicate, bool polarity=0) |
uchar256 v_bf16_find_first_b(bfloat128 a, int switches=0, uchar256 income={}, bool predicate=1, bool polarity=0) |
uchar256 v_bf16_find_first_vb(bfloat128 a, int switches, uchar256 income, bool128 predicate, bool polarity=0) |
uchar256 v_i32_find_first_b(int64 a, int switches=0, uchar256 income={}, bool predicate=1, bool polarity=0) |
uchar256 v_i32_find_first_vb(int64 a, int switches, uchar256 income, bool64 predicate, bool polarity=0) |
uchar256 v_u32_find_first_b(uint64 a, int switches=0, uchar256 income={}, bool predicate=1, bool polarity=0) |
uchar256 v_u32_find_first_vb(uint64 a, int switches, uchar256 income, bool64 predicate, bool polarity=0) |
uchar256 v_i16_find_first_b(short128 a, int switches=0, uchar256 income={}, bool predicate=1, bool polarity=0) |
uchar256 v_i16_find_first_vb(short128 a, int switches, uchar256 income, bool128 predicate, bool polarity=0) |
uchar256 v_u16_find_first_b(ushort128 a, int switches=0, uchar256 income={}, bool predicate=1, bool polarity=0) |
uchar256 v_u16_find_first_vb(ushort128 a, int switches, uchar256 income, bool128 predicate, bool polarity=0) |
uchar256 v_i8_find_first_b(char256 a, int switches=0, uchar256 income={}, bool predicate=1, bool polarity=0) |
uchar256 v_i8_find_first_vb(char256 a, int switches, uchar256 income, bool256 predicate, bool polarity=0) |
uchar256 v_u8_find_first_b(uchar256 a, int switches=0, uchar256 income={}, bool predicate=1, bool polarity=0) |
uchar256 v_u8_find_first_vb(uchar256 a, int switches, uchar256 income, bool256 predicate, bool polarity=0) |
a |
Input value (SRC1). |
switches |
Instruction switches. |
income |
This value is returned if the predicate is false. |
predicate |
Predicate value for the instruction. |
polarity |
True if polarity of the predicate is inverted. |
Allowed switches are:
[SET] - Indicates whether the first bit to look for is 0 or 1.
SW_FIND_ZERO
SW_FIND_ONE
[DIR] - Indicates the direction of the search.
SW_LSB
SW_MSB
First 0/1 bit position.
Form Floating point number¶
Represents FORM_FP_NUMBER instruction.
Intrinsics Prototype and Arguments
float64 v_f32_form_fp_num_b(float64 a, float64 b, float64 c, int switches=0, float64 income={}, bool predicate=1, bool polarity=0) |
float64 v_f32_form_fp_num_vb(float64 a, float64 b, float64 c, int switches, float64 income, bool64 predicate, bool polarity=0) |
float64 v_f32_form_fp_num_ie_b(char256 a, float64 b, float64 c, int switches=0, float64 income={}, bool predicate=1, bool polarity=0) |
float64 v_f32_form_fp_num_ie_vb(char256 a, float64 b, float64 c, int switches, float64 income, bool64 predicate, bool polarity=0) |
bfloat128 v_bf16_form_fp_num_b(bfloat128 a, bfloat128 b, bfloat128 c, int switches=0, bfloat128 income={}, bool predicate=1, bool polarity=0) |
bfloat128 v_bf16_form_fp_num_vb(bfloat128 a, bfloat128 b, bfloat128 c, int switches, bfloat128 income, bool128 predicate, bool polarity=0) |
bfloat128 v_bf16_form_fp_num_ie_b(char256 a, bfloat128 b, bfloat128 c, int switches=0, bfloat128 income={}, bool predicate=1, bool polarity=0) |
bfloat128 v_bf16_form_fp_num_ie_vb(char256 a, bfloat128 b, bfloat128 c, int switches, bfloat128 income, bool128 predicate, bool polarity=0) |
a |
Exponent (SRC1). |
b |
Sign (SRC2). |
c |
Mantissa (SRC3). |
switches |
Instruction switches. |
income |
This value is returned if the predicate is false. |
predicate |
Predicate value for the instruction. |
polarity |
True if polarity of the predicate is inverted. |
Allowed switches are:
SW_ADD_BIAS - Add bias to exponent (SRC1) prior to operation.
SW_FORCE_SIGN0 - Force sign bit at DEST to 0.
SW_FORCE_SIGN1 - Force sign bit at DEST to 1.
SW_EXP_IS_NUM - Treat the value in the source as an INT8 number, shift left by mantissa size and mask un-relevant bits.
SW_SIGN_LSB - When set, takes the SIGN from the LSB of the src instead from its sign bit.
Constructed floating number.
Note
SW_FORCE_SIGN0, SW_FORCE_SIGN1, SW_SIGN_LSB are mutually exclusive.
Note
In intrinsic functions with ‘ie’ infix, SW_EXP_IS_NUM switch is set by default.
MAC¶
Represents MAC instruction.
Intrinsics Prototype and Arguments
float s_f32_mac(float a, float b, float accumulator, int switches=0, bool predicate=1, bool polarity=0) |
bf16 s_bf16_mac(bf16 a, bf16 b, bf16 accumulator, int switches=0, bool predicate=1, bool polarity=0) |
int32_t s_i16_mac(int16_t a, int16_t b, int32_t accumulator, int switches=0, bool predicate=1, bool polarity=0) |
uint32_t s_u16_mac(uint16_t a, uint16_t b, uint32_t accumulator, int switches=0, bool predicate=1, bool polarity=0) |
float64 v_f32_mac_vb(float64 a, float64 b, float64 accumulator, int switches, bool64 predicate, bool polarity=0) |
float64 v_f32_mac_b(float64 a, float64 b, float64 accumulator, int switches=0, bool predicate=1, bool polarity=0) |
bfloat128 v_bf16_mac_vb(bfloat128 a, bfloat128 b, bfloat128 accumulator, int switches, bool128 predicate, bool polarity=0) |
bfloat128 v_bf16_mac_b(bfloat128 a, bfloat128 b, bfloat128 accumulator, int switches=0, bool predicate=1, bool polarity=0) |
int128 v_i16_mac_vb(short128 a, short128 b, int128 accumulator, int switches, bool128 predicate, bool polarity=0) |
int128 v_i16_mac_b(short128 a, short128 b, int128 accumulator, int switches=0, bool predicate=1, bool polarity=0) |
uint128 v_u16_mac_vb(ushort128 a, ushort128 b, uint128 accumulator, int switches, bool128 predicate, bool polarity=0) |
uint128 v_u16_mac_b(ushort128 a, ushort128 b, uint128 accumulator, int switches=0, bool predicate=1, bool polarity=0) |
a |
The first SRC operand to MAC (SRC1). |
b |
The second SRC operand to MAC (SRC2). |
accumulator |
DEST operand to MAC. |
switches |
Switches of MAC instructions. |
predicate |
Predicate value for the instruction. |
polarity |
True if polarity of the predicate is inverted. |
Allowed switches are:
SW_SAT - Saturates the result (valid for integer data-types only).
SW_NO_NEG - default, acc=acc+a*b.
SW_NEG - When set, acc=acc-(a*b). (valid for float data-types only).
Updated value of accumulator acc=acc+(a*b).
MAC using ACC_F32 switch¶
Represents MAC instruction with ACC_F32 switch (32-bit accumulator).
Intrinsics Prototype and Arguments
float s_bf16_mac_acc32(bf16 a, bf16 b, float accumulator, int switches=0, bool predicate=1, bool polarity=0) |
float128 v_bf16_mac_acc32_vb(bfloat128 a, bfloat128 b, float128 accumulator, int switches, bool128 predicate, bool polarity=0) |
float128 v_bf16_mac_acc32_b(bfloat128 a, bfloat128 b, float128 accumulator, int switches=0, bool predicate=1, bool polarity=0) |
a |
The first SRC operand to MAC (SRC1). |
b |
The second SRC operand to MAC (SRC2). |
accumulator |
DEST operand to MAC. |
switches |
Switches of MAC instructions. |
predicate |
Predicate value for the instruction. |
polarity |
True if polarity of the predicate is inverted. |
Allowed switches are:
SW_NO_NEG - default, acc=acc+(a*b).
SW_NEG - When set, acc=acc-(a*b)
Updated value of accumulator acc=acc+(a*b).
Max¶
Represents MAX instruction.
Intrinsics Prototype and Arguments
float s_f32_max(float a, float b, int switches=0, float income={}, bool predicate=1, bool polarity=0) |
bf16 s_bf16_max(bf16 a, bf16 b, int switches=0, bf16 income={}, bool predicate=1, bool polarity=0) |
int32_t s_i32_max(int32_t a, int32_t b, int switches=0, int32_t income={}, bool predicate=1, bool polarity=0) |
uint32_t s_u32_max(uint32_t a, uint32_t b, int switches=0, uint32_t income={}, bool predicate=1, bool polarity=0) |
int16_t s_i16_max(int16_t a, int16_t b, int switches=0, int16_t income={}, bool predicate=1, bool polarity=0) |
uint16_t s_u16_max(uint16_t a, uint16_t b, int switches=0, uint16_t income={}, bool predicate=1, bool polarity=0) |
int8_t s_i8_max(int8_t a, int8_t b, int switches=0, int8_t income={}, bool predicate=1, bool polarity=0) |
uint8_t s_u8_max(uint8_t a, uint8_t b, int switches=0, uint8_t income={}, bool predicate=1, bool polarity=0) |
float64 v_f32_max_vb(float64 a, float64 b, int switches, float64 income, bool64 predicate, bool polarity=0) |
float64 v_f32_max_b(float64 a, float64 b, int switches=0, float64 income={}, bool predicate=1, bool polarity=0) |
bfloat128 v_bf16_max_vb(bfloat128 a, bfloat128 b, int switches, bfloat128 income, bool128 predicate, bool polarity=0) |
bfloat128 v_bf16_max_b(bfloat128 a, bfloat128 b, int switches=0, bfloat128 income={}, bool predicate=1, bool polarity=0) |
int64 v_i32_max_vb(int64 a, int64 b, int switches, int64 income, bool64 predicate, bool polarity=0) |
int64 v_i32_max_b(int64 a, int64 b, int switches=0, int64 income={}, bool predicate=1, bool polarity=0) |
uint64 v_u32_max_vb(uint64 a, uint64 b, int switches, uint64 income, bool64 predicate, bool polarity=0) |
uint64 v_u32_max_b(uint64 a, uint64 b, int switches=0, uint64 income={}, bool predicate=1, bool polarity=0) |
char256 v_i8_max_vb(char256 a, char256 b, int switches, char256 income, bool256 predicate, bool polarity=0) |
char256 v_i8_max_b(char256 a, char256 b, int switches=0, char256 income={}, bool predicate=1, bool polarity=0) |
uchar256 v_u8_max_vb(uchar256 a, uchar256 b, int switches, uchar256 income, bool256 predicate, bool polarity=0) |
uchar256 v_u8_max_b(uchar256 a, uchar256 b, int switches=0, uchar256 income={}, bool predicate=1, bool polarity=0) |
short128 v_i16_max_vb(short128 a, short128 b, int switches, short128 income, bool128 predicate, bool polarity=0) |
short128 v_i16_max_b(short128 a, short128 b, int switches=0, short128 income={}, bool predicate=1, bool polarity=0) |
ushort128 v_u16_max_vb(ushort128 a, ushort128 b, int switches, ushort128 income, bool128 predicate, bool polarity=0) |
ushort128 v_u16_max_b(ushort128 a, ushort128 b, int switches=0, ushort128 income={}, bool predicate=1, bool polarity=0) |
a |
The first SRC operand to MAX (SRC1). |
b |
The second SRC operand to MAX (SRC2). |
switches |
Switches of MAX instructions. |
income |
This value is returned if the predicate is false. |
predicate |
Predicate value for the instruction. |
polarity |
True if polarity of the predicate is inverted. |
Result of operation.
Min¶
Represents MIN instruction.
Intrinsics Prototype and Arguments
float s_f32_min(float a, float b, int switches=0, float income={}, bool predicate=1, bool polarity=0) |
bf16 s_bf16_min(bf16 a, bf16 b, int switches=0, bf16 income={}, bool predicate=1, bool polarity=0) |
int32_t s_i32_min(int32_t a, int32_t b, int switches=0, int32_t income={}, bool predicate=1, bool polarity=0) |
uint32_t s_u32_min(uint32_t a, uint32_t b, int switches=0, uint32_t income={}, bool predicate=1, bool polarity=0) |
int16_t s_i16_min(int16_t a, int16_t b, int switches=0, int16_t income={}, bool predicate=1, bool polarity=0) |
uint16_t s_u16_min(uint16_t a, uint16_t b, int switches=0, uint16_t income={}, bool predicate=1, bool polarity=0) |
int8_t s_i8_min(int8_t a, int8_t b, int switches=0, int8_t income={}, bool predicate=1, bool polarity=0) |
uint8_t s_u8_min(uint8_t a, uint8_t b, int switches=0, uint8_t income={}, bool predicate=1, bool polarity=0) |
float64 v_f32_min_vb(float64 a, float64 b, int switches, float64 income, bool64 predicate, bool polarity=0) |
float64 v_f32_min_b(float64 a, float64 b, int switches=0, float64 income={}, bool predicate=1, bool polarity=0) |
bfloat128 v_bf16_min_vb(bfloat128 a, bfloat128 b, int switches, bfloat128 income, bool128 predicate, bool polarity=0) |
bfloat128 v_bf16_min_b(bfloat128 a, bfloat128 b, int switches=0, bfloat128 income={}, bool predicate=1, bool polarity=0) |
int64 v_i32_min_vb(int64 a, int64 b, int switches, int64 income, bool64 predicate, bool polarity=0) |
int64 v_i32_min_b(int64 a, int64 b, int switches=0, int64 income={}, bool predicate=1, bool polarity=0) |
uint64 v_u32_min_vb(uint64 a, uint64 b, int switches, uint64 income, bool64 predicate, bool polarity=0) |
uint64 v_u32_min_b(uint64 a, uint64 b, int switches=0, uint64 income={}, bool predicate=1, bool polarity=0) |
char256 v_i8_min_vb(char256 a, char256 b, int switches, char256 income, bool256 predicate, bool polarity=0) |
char256 v_i8_min_b(char256 a, char256 b, int switches=0, char256 income={}, bool predicate=1, bool polarity=0) |
uchar256 v_u8_min_vb(uchar256 a, uchar256 b, int switches, uchar256 income, bool256 predicate, bool polarity=0) |
uchar256 v_u8_min_b(uchar256 a, uchar256 b, int switches=0, uchar256 income={}, bool predicate=1, bool polarity=0) |
short128 v_i16_min_vb(short128 a, short128 b, int switches, short128 income, bool128 predicate, bool polarity=0) |
short128 v_i16_min_b(short128 a, short128 b, int switches=0, short128 income={}, bool predicate=1, bool polarity=0) |
ushort128 v_u16_min_vb(ushort128 a, ushort128 b, int switches, ushort128 income, bool128 predicate, bool polarity=0) |
ushort128 v_u16_min_b(ushort128 a, ushort128 b, int switches=0, ushort128 income={}, bool predicate=1, bool polarity=0) |
a |
The first SRC operand to MIN (SRC1). |
b |
The second SRC operand to MIN (SRC2). |
switches |
Switches of MIN instructions. |
income |
This value is returned if the predicate is false. |
predicate |
Predicate value for the instruction. |
polarity |
True if polarity of the predicate is inverted. |
Result of operation.
Mul¶
Represents MUL instruction for float arguments.
Intrinsics Prototype and Arguments
float s_f32_mul(float a, float b, int switches=0, float income={}, bool predicate=1, bool polarity=0) |
bf16 s_bf16_mul(bf16 a, bf16 b, int switches=0, bf16 income={}, bool predicate=1, bool polarity=0) |
float64 v_f32_mul_vb(float64 a, float64 b, int switches, float64 income, bool64 predicate, bool polarity=0) |
float64 v_f32_mul_b(float64 a, float64 b, int switches=0, float64 income={}, bool predicate=1, bool polarity=0) |
bfloat128 v_bf16_mul_vb(bfloat128 a, bfloat128 b, int switches, bfloat128 income, bool128 predicate, bool polarity=0) |
bfloat128 v_bf16_mul_b(bfloat128 a, bfloat128 b, int switches=0, bfloat128 income={}, bool predicate=1, bool polarity=0) |
a |
The first SRC operand to MUL (SRC1). |
b |
The second SRC operand to MUL (SRC2). |
switches |
Switches of MUL instructions. |
income |
This value is returned if the predicate is false. |
predicate |
Predicate value for the instruction. |
polarity |
True if polarity of the predicate is inverted. |
Result of operation.
MUL with ACC_F32 switch¶
Represents MUL instruction with ACC_F32 switch (32-bit accumulator).
Intrinsics Prototype and Arguments
float s_bf16_mul_acc32(bf16 a, bf16 b, int switches=0, float income={}, bool predicate=1, bool polarity=0) |
float128 v_bf16_mul_acc32_vb(bfloat128 a, bfloat128 b, int switches, float128 income, bool128 predicate, bool polarity=0) |
float128 v_bf16_mul_acc32_b(bfloat128 a, bfloat128 b, int switches=0, float128 income={}, bool predicate=1, bool polarity=0) |
a |
The first SRC operand to MUL (SRC1). |
b |
The second SRC operand to MUL (SRC2). |
switches |
Switches of MUL instructions. |
income |
This value is returned if the predicate is false. |
predicate |
Predicate value for the instruction. |
polarity |
True if polarity of the predicate is inverted. |
Result of operation.
Scalar MUL¶
Represents scalar MUL instruction for integer arguments.
Intrinsics Prototype and Arguments
int32_t s_i32_mul(int32_t a, int32_t b, int switches=0, int32_t income={}, bool predicate=1, bool polarity=0) |
uint32_t s_u32_mul(uint32_t a, uint32_t b, int switches=0, uint32_t income={}, bool predicate=1, bool polarity=0) |
int32_t s_i16_mul(int16_t a, int16_t b, int switches=0, int32_t income={}, bool predicate=1, bool polarity=0) |
uint32_t s_u16_mul(uint16_t a, uint16_t b, int switches=0, uint32_t income={}, bool predicate=1, bool polarity=0) |
a |
The first SRC operand to MUL (SRC1). |
b |
The second SRC operand to MUL (SRC2). |
switches |
Switches of MUL instructions. |
income |
This value is returned if the predicate is false. |
predicate |
Predicate value for the instruction. |
polarity |
True if polarity of the predicate is inverted. |
Allowed switches are:
SW_LOWER32 - When set lower 32 bit of 64 bit result are stored (INT32, UINT32 only).
SW_UPPER32 - When set upper 32 bit of 64 bit result are stored (INT32, UINT32 only).
Result of operation.
Vector MUL¶
Represents vector MUL instruction for integer arguments.
Intrinsics Prototype and Arguments
int128 v_i32_mul_b(int64 a, int64 b, int switches=0, int128 income={}, bool predicate=1, bool polarity=0) |
int128 v_i32_mul_vb(int64 a, int64 b, int switches, int128 income, bool64 predicate, bool polarity=0) |
uint128 v_u32_mul_b(uint64 a, uint64 b, int switches=0, uint128 income={}, bool predicate=1, bool polarity=0) |
uint128 v_u32_mul_vb(uint64 a, uint64 b, int switches, uint128 income, bool64 predicate, bool polarity=0) |
int128 v_i16_mul_b(short128 a, short128 b, int switches=0, int128 income={}, bool predicate=1, bool polarity=0) |
int128 v_i16_mul_vb(short128 a, short128 b, int switches, int128 income, bool128 predicate, bool polarity=0) |
uint128 v_u16_mul_vb(ushort128 a, ushort128 b, int switches, uint128 income, bool128 predicate, bool polarity=0) |
uint128 v_u16_mul_b(ushort128 a, ushort128 b, int switches=0, uint128 income={}, bool predicate=1, bool polarity=0) |
a |
The first SRC operand to MUL (SRC1). |
b |
The second SRC operand to MUL (SRC2). |
switches |
Switches of MUL instructions. |
income |
This value is returned if the predicate is false. |
predicate |
Predicate value for the instruction. |
polarity |
True if polarity of the predicate is inverted. |
Result of operation.
Vector MUL using DOUBLE_AND_ROUND32 switch¶
Represents vector MUL instruction with DOUBLE_AND_ROUND32 switch (RHU).
Intrinsics Prototype and Arguments
int64 v_i32_mul_round_b(int64 a, int64 b, int switches=0, int64 income={}, bool predicate=1, bool polarity=0) |
int64 v_i32_mul_round_vb(int64 a, int64 b, int switches, int64 income, bool64 predicate, bool polarity=0) |
uint64 v_u32_mul_round_b(uint64 a, uint64 b, int switches=0, uint64 income={}, bool predicate=1, bool polarity=0) |
uint64 v_u32_mul_round_vb(uint64 a, uint64 b, int switches, uint64 income, bool64 predicate, bool polarity=0) |
a |
The first SRC operand to MUL (SRC1). |
b |
The second SRC operand to MUL (SRC2). |
switches |
Switches of MUL instructions. |
income |
This value is returned if the predicate is false. |
predicate |
Predicate value for the instruction. |
polarity |
True if polarity of the predicate is inverted. |
Result of operation.
Nearby integer¶
Represents NEARBYINT instruction.
Intrinsics Prototype and Arguments
float s_f32_nearbyint(float a, int switches=0, float income={}, bool predicate=1, bool polarity=0) |
float64 v_f32_nearbyint_b(float64 a, int switches=0, float64 income={}, bool predicate=1, bool polarity=0) |
float64 v_f32_nearbyint_vb(float64 a, int switches, float64 income, bool64 predicate, bool polarity=0) |
bf16 s_bf16_nearbyint(bf16 a, int switches=0, bf16 income={}, bool predicate=1, bool polarity=0) |
bfloat128 v_bf16_nearbyint_b(bfloat128 a, int switches=0, bfloat128 income={}, bool predicate=1, bool polarity=0) |
bfloat128 v_bf16_nearbyint_vb(bfloat128 a, int switches, bfloat128 income, bool128 predicate, bool polarity=0) |
a |
Input value (SRC1). |
switches |
Switches of the instructions. |
income |
This value is returned if the predicate is false. |
predicate |
Predicate value for the instruction. |
polarity |
True if polarity of the predicate is inverted. |
Allowed switches are:
[ROUND]
SW_RHNE - Round half to nearest even.
SW_RZ - Round zero.
SW_RU - Round up.
SW_RD - Round down.
Returns the nearest integer value to a.
Not¶
Represents NOT instruction.
Intrinsics Prototype and Arguments
float s_f32_not(float a, int switches=0, float income={}, bool predicate=1, bool polarity=0) |
bf16 s_bf16_not(bf16 a, int switches=0, bf16 income={}, bool predicate=1, bool polarity=0) |
int32_t s_i32_not(int32_t a, int switches=0, int32_t income={}, bool predicate=1, bool polarity=0) |
uint32_t s_u32_not(uint32_t a, int switches=0, uint32_t income={}, bool predicate=1, bool polarity=0) |
int16_t s_i16_not(int16_t a, int switches=0, int16_t income={}, bool predicate=1, bool polarity=0) |
uint16_t s_u16_not(uint16_t a, int switches=0, uint16_t income={}, bool predicate=1, bool polarity=0) |
int8_t s_i8_not(int8_t a, int switches=0, int8_t income={}, bool predicate=1, bool polarity=0) |
uint8_t s_u8_not(uint8_t a, int switches=0, uint8_t income={}, bool predicate=1, bool polarity=0) |
bool s_i1_not(bool a, int switches=0, bool income={}, bool predicate=1, bool polarity=0) |
float64 v_f32_not_b(float64 a, int switches=0, float64 income={}, bool predicate=1, bool polarity=0) |
float64 v_f32_not_vb(float64 a, int switches, float64 income, bool64 predicate, bool polarity=0) |
bfloat128 v_bf16_not_b(bfloat128 a, int switches=0, bfloat128 income={}, bool predicate=1, bool polarity=0) |
bfloat128 v_bf16_not_vb(bfloat128 a, int switches, bfloat128 income, bool128 predicate, bool polarity=0) |
int64 v_i32_not_b(int64 a, int switches=0, int64 income={}, bool predicate=1, bool polarity=0) |
int64 v_i32_not_vb(int64 a, int switches, int64 income, bool64 predicate, bool polarity=0) |
uint64 v_u32_not_b(uint64 a, int switches=0, uint64 income={}, bool predicate=1, bool polarity=0) |
uint64 v_u32_not_vb(uint64 a, int switches, uint64 income, bool64 predicate, bool polarity=0) |
short128 v_i16_not_b(short128 a, int switches=0, short128 income={}, bool predicate=1, bool polarity=0) |
short128 v_i16_not_vb(short128 a, int switches, short128 income, bool128 predicate, bool polarity=0) |
ushort128 v_u16_not_b(ushort128 a, int switches=0, ushort128 income={}, bool predicate=1, bool polarity=0) |
ushort128 v_u16_not_vb(ushort128 a, int switches, ushort128 income, bool128 predicate, bool polarity=0) |
char256 v_i8_not_b(char256 a, int switches=0, char256 income={}, bool predicate=1, bool polarity=0) |
char256 v_i8_not_vb(char256 a, int switches, char256 income, bool256 predicate, bool polarity=0) |
uchar256 v_u8_not_b(uchar256 a, int switches=0, uchar256 income={}, bool predicate=1, bool polarity=0) |
uchar256 v_u8_not_vb(uchar256 a, int switches, uchar256 income, bool256 predicate, bool polarity=0) |
bool256 v_i1_not_b(bool256 a, int switches=0, bool256 income={}, bool predicate=1, bool polarity=0) |
bool256 v_i1_not_vb(bool256 a, int switches, bool256 income, bool256 predicate, bool polarity=0) |
a |
The argument (SRC1). |
switches |
Switches of NOT instructions. |
income |
This value is returned if the predicate is false. |
predicate |
Predicate value for the instruction. |
polarity |
True if polarity of the predicate is inverted. |
Result of operation.
Or¶
Represents OR instruction.
Intrinsics Prototype and Arguments
float s_f32_or(float a, float b, int switches=0, float income={}, bool predicate=1, bool polarity=0) |
bf16 s_bf16_or(bf16 a, bf16 b, int switches=0, bf16 income={}, bool predicate=1, bool polarity=0) |
int32_t s_i32_or(int32_t a, int32_t b, int switches=0, int32_t income={}, bool predicate=1, bool polarity=0) |
uint32_t s_u32_or(uint32_t a, uint32_t b, int switches=0, uint32_t income={}, bool predicate=1, bool polarity=0) |
int16_t s_i16_or(int16_t a, int16_t b, int switches=0, int16_t income={}, bool predicate=1, bool polarity=0) |
uint16_t s_u16_or(uint16_t a, uint16_t b, int switches=0, uint16_t income={}, bool predicate=1, bool polarity=0) |
int8_t s_i8_or(int8_t a, int8_t b, int switches=0, int8_t income={}, bool predicate=1, bool polarity=0) |
uint8_t s_u8_or(uint8_t a, uint8_t b, int switches=0, uint8_t income={}, bool predicate=1, bool polarity=0) |
bool s_i1_or(bool a, bool b, int switches=0, bool income={}, bool predicate=1, bool polarity=0) |
float64 v_f32_or_vb(float64 a, float64 b, int switches, float64 income, bool64 predicate, bool polarity=0) |
float64 v_f32_or_b(float64 a, float64 b, int switches=0, float64 income={}, bool predicate=1, bool polarity=0) |
bfloat128 v_bf16_or_vb(bfloat128 a, bfloat128 b, int switches, bfloat128 income, bool128 predicate, bool polarity=0) |
bfloat128 v_bf16_or_b(bfloat128 a, bfloat128 b, int switches=0, bfloat128 income={}, bool predicate=1, bool polarity=0) |
int64 v_i32_or_vb(int64 a, int64 b, int switches, int64 income, bool64 predicate, bool polarity=0) |
int64 v_i32_or_b(int64 a, int64 b, int switches=0, int64 income={}, bool predicate=1, bool polarity=0) |
uint64 v_u32_or_vb(uint64 a, uint64 b, int switches, uint64 income, bool64 predicate, bool polarity=0) |
uint64 v_u32_or_b(uint64 a, uint64 b, int switches=0, uint64 income={}, bool predicate=1, bool polarity=0) |
short128 v_i16_or_vb(short128 a, short128 b, int switches, short128 income, bool128 predicate, bool polarity=0) |
short128 v_i16_or_b(short128 a, short128 b, int switches=0, short128 income={}, bool predicate=1, bool polarity=0) |
ushort128 v_u16_or_vb(ushort128 a, ushort128 b, int switches, ushort128 income, bool128 predicate, bool polarity=0) |
ushort128 v_u16_or_b(ushort128 a, ushort128 b, int switches=0, ushort128 income={}, bool predicate=1, bool polarity=0) |
char256 v_i8_or_vb(char256 a, char256 b, int switches, char256 income, bool256 predicate, bool polarity=0) |
char256 v_i8_or_b(char256 a, char256 b, int switches=0, char256 income={}, bool predicate=1, bool polarity=0) |
uchar256 v_u8_or_vb(uchar256 a, uchar256 b, int switches, uchar256 income, bool256 predicate, bool polarity=0) |
uchar256 v_u8_or_b(uchar256 a, uchar256 b, int switches=0, uchar256 income={}, bool predicate=1, bool polarity=0) |
bool256 v_i1_or_b(bool256 a, bool256 b, int switches=0, bool256 income={}, bool predicate=1, bool polarity=0) |
bool256 v_i1_or_vb(bool256 a, bool256 b, int switches, bool256 income, bool256 predicate, bool polarity=0) |
a |
The first SRC operand to OR (SRC1). |
b |
The second SRC operand to OR (SRC2). |
switches |
Switches of OR instructions. |
income |
This value is returned if the predicate is false. |
predicate |
Predicate value for the instruction. |
polarity |
True if polarity of the predicate is inverted. |
Result of operation.
Popcnt¶
Represents POPCNT instruction.
Intrinsics Prototype and Arguments
uint8_t s_f32_popcnt(float a, int switches=0, uint8_t income={}, bool predicate=1, bool polarity=0) |
uint8_t s_bf16_popcnt(bf16 a, int switches=0, uint8_t income={}, bool predicate=1, bool polarity=0) |
uint8_t s_i32_popcnt(int32_t a, int switches=0, uint8_t income={}, bool predicate=1, bool polarity=0) |
uint8_t s_u32_popcnt(uint32_t a, int switches=0, uint8_t income={}, bool predicate=1, bool polarity=0) |
uint8_t s_i16_popcnt(int16_t a, int switches=0, uint8_t income={}, bool predicate=1, bool polarity=0) |
uint8_t s_u16_popcnt(uint16_t a, int switches=0, uint8_t income={}, bool predicate=1, bool polarity=0) |
uint8_t s_i8_popcnt(int8_t a, int switches=0, uint8_t income={}, bool predicate=1, bool polarity=0) |
uint8_t s_u8_popcnt(uint8_t a, int switches=0, uint8_t income={}, bool predicate=1, bool polarity=0) |
uchar256 v_f32_popcnt_b(float64 a, int switches=0, uchar256 income={}, bool predicate=1, bool polarity=0) |
uchar256 v_f32_popcnt_vb(float64 a, int switches, uchar256 income, bool64 predicate, bool polarity=0) |
uchar256 v_bf16_popcnt_b(bfloat128 a, int switches=0, uchar256 income={}, bool predicate=1, bool polarity=0) |
uchar256 v_bf16_popcnt_vb(bfloat128 a, int switches, uchar256 income, bool128 predicate, bool polarity=0) |
uchar256 v_i32_popcnt_b(int64 a, int switches=0, uchar256 income={}, bool predicate=1, bool polarity=0) |
uchar256 v_i32_popcnt_vb(int64 a, int switches, uchar256 income, bool64 predicate, bool polarity=0) |
uchar256 v_u32_popcnt_b(uint64 a, int switches=0, uchar256 income={}, bool predicate=1, bool polarity=0) |
uchar256 v_u32_popcnt_vb(uint64 a, int switches, uchar256 income, bool64 predicate, bool polarity=0) |
uchar256 v_i16_popcnt_b(short128 a, int switches=0, uchar256 income={}, bool predicate=1, bool polarity=0) |
uchar256 v_i16_popcnt_vb(short128 a, int switches, uchar256 income, bool128 predicate, bool polarity=0) |
uchar256 v_u16_popcnt_b(ushort128 a, int switches=0, uchar256 income={}, bool predicate=1, bool polarity=0) |
uchar256 v_u16_popcnt_vb(ushort128 a, int switches, uchar256 income, bool128 predicate, bool polarity=0) |
uchar256 v_i8_popcnt_b(char256 a, int switches=0, uchar256 income={}, bool predicate=1, bool polarity=0) |
uchar256 v_i8_popcnt_vb(char256 a, int switches, uchar256 income, bool256 predicate, bool polarity=0) |
uchar256 v_u8_popcnt_b(uchar256 a, int switches=0, uchar256 income={}, bool predicate=1, bool polarity=0) |
uchar256 v_u8_popcnt_vb(uchar256 a, int switches, uchar256 income, bool256 predicate, bool polarity=0) |
a |
Value in which population is counted (SRC1). |
switches |
Switches of the instructions. |
income |
This value is returned if the predicate is false. |
predicate |
Predicate value for the instruction. |
polarity |
True if polarity of the predicate is inverted. |
Allowed switches are:
[SET] - Indicates whether to count 0s or 1s.
SW_COUNT_ZEROS
SW_COUNT_ONES
The number of 0s or 1s in the elemenet - a.
Shift Left¶
Represents SHL instruction.
Intrinsics Prototype and Arguments
float s_f32_shl(float a, int8_t b, int switches=0, float income={}, bool predicate=1, bool polarity=0) |
bf16 s_bf16_shl(bf16 a, uint8_t b, int switches=0, bf16 income={}, bool predicate=1, bool polarity=0) |
int32_t s_i32_shl(int32_t a, int8_t b, int switches=0, int32_t income={}, bool predicate=1, bool polarity=0) |
uint32_t s_u32_shl(uint32_t a, int8_t b, int switches=0, uint32_t income={}, bool predicate=1, bool polarity=0) |
int16_t s_i16_shl(int16_t a, int8_t b, int switches=0, int16_t income={}, bool predicate=1, bool polarity=0) |
uint16_t s_u16_shl(uint16_t a, int8_t b, int switches=0, uint16_t income={}, bool predicate=1, bool polarity=0) |
int8_t s_i8_shl(int8_t a, int8_t b, int switches=0, int8_t income={}, bool predicate=1, bool polarity=0) |
uint8_t s_u8_shl(uint8_t a, int8_t b, int switches=0, uint8_t income={}, bool predicate=1, bool polarity=0) |
float64 v_f32_shl_b(float64 a, int64 b, int switches=0, float64 income={}, bool predicate=1, bool polarity=0) |
float64 v_f32_shl_vb(float64 a, int64 b, int switches, float64 income, bool64 predicate, bool polarity=0) |
bfloat128 v_bf16_shl_b(bfloat128 a, short128 b, int switches=0, bfloat128 income={}, bool predicate=1, bool polarity=0) |
bfloat128 v_bf16_shl_vb(bfloat128 a, short128 b, int switches, bfloat128 income, bool128 predicate, bool polarity=0) |
int64 v_i32_shl_b(int64 a, int64 b, int switches=0, int64 income={}, bool predicate=1, bool polarity=0) |
int64 v_i32_shl_vb(int64 a, int64 b, int switches, int64 income, bool64 predicate, bool polarity=0) |
uint64 v_u32_shl_b(uint64 a, int64 b, int switches=0, uint64 income={}, bool predicate=1, bool polarity=0) |
uint64 v_u32_shl_vb(uint64 a, int64 b, int switches, uint64 income, bool64 predicate, bool polarity=0) |
short128 v_i16_shl_b(short128 a, short128 b, int switches=0, short128 income={}, bool predicate=1, bool polarity=0) |
short128 v_i16_shl_vb(short128 a, short128 b, int switches, short128 income, bool128 predicate, bool polarity=0) |
ushort128 v_u16_shl_b(ushort128 a, short128 b, int switches=0, ushort128 income={}, bool predicate=1, bool polarity=0) |
ushort128 v_u16_shl_vb(ushort128 a, short128 b, int switches, ushort128 income, bool128 predicate, bool polarity=0) |
char256 v_i8_shl_b(char256 a, char256 b, int switches=0, char256 income={}, bool predicate=1, bool polarity=0) |
char256 v_i8_shl_vb(char256 a, char256 b, int switches, char256 income, bool256 predicate, bool polarity=0) |
uchar256 v_u8_shl_b(uchar256 a, char256 b, int switches=0, uchar256 income={}, bool predicate=1, bool polarity=0) |
uchar256 v_u8_shl_vb(uchar256 a, char256 b, int switches, uchar256 income, bool256 predicate, bool polarity=0) |
a |
The value to shift (SRC1). |
b |
The number of bits to shift left (SRC2). |
switches |
Switches of SHL instructions. |
income |
This value is returned if the predicate is false. |
predicate |
Predicate value for the instruction. |
polarity |
True if polarity of the predicate is inverted. |
Result of operation.
Shift Left for IRF¶
Represents SHL instruction for int5 operands.
Intrinsics Prototype and Arguments
int5 i_i32_shl(int5 a, int5 b, int dimmask, const int switches, int5 income, bool predicate=1, bool polarity=0) |
a |
The value to shift (SRC1). |
b |
The number of bits to shift left (SRC2). |
dimmask |
Selects IRF lanes participated in the operation. |
switches |
Switches of SHL instructions. |
income |
This value is returned if the predicate is false or when dimmask does not apply. |
predicate |
Predicate value for the instruction. |
polarity |
True if polarity of the predicate is inverted. |
Result of operation.
Shift Right¶
Represents SHR instruction.
Intrinsics Prototype and Arguments
float s_f32_shr(float a, int8_t b, int switches=0, float income={}, bool predicate=1, bool polarity=0) |
bf16 s_bf16_shr(bf16 a, uint8_t b, int switches=0, bf16 income={}, bool predicate=1, bool polarity=0) |
int32_t s_i32_shr(int32_t a, int8_t b, int switches=0, int32_t income={}, bool predicate=1, bool polarity=0) |
uint32_t s_u32_shr(uint32_t a, int8_t b, int switches=0, uint32_t income={}, bool predicate=1, bool polarity=0) |
int16_t s_i16_shr(int16_t a, int8_t b, int switches=0, int16_t income={}, bool predicate=1, bool polarity=0) |
uint16_t s_u16_shr(uint16_t a, int8_t b, int switches=0, uint16_t income={}, bool predicate=1, bool polarity=0) |
int8_t s_i8_shr(int8_t a, int8_t b, int switches=0, int8_t income={}, bool predicate=1, bool polarity=0) |
uint8_t s_u8_shr(uint8_t a, int8_t b, int switches=0, uint8_t income={}, bool predicate=1, bool polarity=0) |
float64 v_f32_shr_b(float64 a, int64 b, int switches=0, float64 income={}, bool predicate=1, bool polarity=0) |
float64 v_f32_shr_vb(float64 a, int64 b, int switches, float64 income, bool64 predicate, bool polarity=0) |
bfloat128 v_bf16_shr_b(bfloat128 a, short128 b, int switches=0, bfloat128 income={}, bool predicate=1, bool polarity=0) |
bfloat128 v_bf16_shr_vb(bfloat128 a, short128 b, int switches, bfloat128 income, bool128 predicate, bool polarity=0) |
int64 v_i32_shr_b(int64 a, int64 b, int switches=0, int64 income={}, bool predicate=1, bool polarity=0) |
int64 v_i32_shr_vb(int64 a, int64 b, int switches, int64 income, bool64 predicate, bool polarity=0) |
uint64 v_u32_shr_b(uint64 a, int64 b, int switches=0, uint64 income={}, bool predicate=1, bool polarity=0) |
uint64 v_u32_shr_vb(uint64 a, int64 b, int switches, uint64 income, bool64 predicate, bool polarity=0) |
short128 v_i16_shr_b(short128 a, short128 b, int switches=0, short128 income={}, bool predicate=1, bool polarity=0) |
short128 v_i16_shr_vb(short128 a, short128 b, int switches, short128 income, bool128 predicate, bool polarity=0) |
ushort128 v_u16_shr_b(ushort128 a, short128 b, int switches=0, ushort128 income={}, bool predicate=1, bool polarity=0) |
ushort128 v_u16_shr_vb(ushort128 a, short128 b, int switches, ushort128 income, bool128 predicate, bool polarity=0) |
char256 v_i8_shr_b(char256 a, char256 b, int switches=0, char256 income={}, bool predicate=1, bool polarity=0) |
char256 v_i8_shr_vb(char256 a, char256 b, int switches, char256 income, bool256 predicate, bool polarity=0) |
uchar256 v_u8_shr_b(uchar256 a, char256 b, int switches=0, uchar256 income={}, bool predicate=1, bool polarity=0) |
uchar256 v_u8_shr_vb(uchar256 a, char256 b, int switches, uchar256 income, bool256 predicate, bool polarity=0) |
a |
The value to shift (SRC1). |
b |
The number of bits to shift right (SRC2). |
switches |
Switches of SHR instructions. |
income |
This value is returned if the predicate is false. |
predicate |
Predicate value for the instruction. |
polarity |
True if polarity of the predicate is inverted. |
Result of operation.
Shuffle¶
Represents SHUFFLE instruction.
For each element in DEST b encodes the src element in the following format
Intrinsics Prototype and Arguments
float64 v_f32_shuffle_b(float64 a, uchar256 b, int switches, float64 income, bool predicate=1, bool polarity=0) |
float64 v_f32_shuffle_vb(float64 a, uchar256 b, int switches, float64 income, bool64 predicate, bool polarity=0) |
bfloat128 v_bf16_shuffle_b(bfloat128 a, uchar256 b, int switches, bfloat128 income, bool predicate=1, bool polarity=0) |
bfloat128 v_bf16_shuffle_vb(bfloat128 a, uchar256 b, int switches, bfloat128 income, bool128 predicate, bool polarity=0) |
int64 v_i32_shuffle_b(int64 a, uchar256 b, int switches, int64 income, bool predicate=1, bool polarity=0) |
int64 v_i32_shuffle_vb(int64 a, uchar256 b, int switches, int64 income, bool64 predicate, bool polarity=0) |
uint64 v_u32_shuffle_b(uint64 a, uchar256 b, int switches, uint64 income, bool predicate=1, bool polarity=0) |
uint64 v_u32_shuffle_vb(uint64 a, uchar256 b, int switches, uint64 income, bool64 predicate, bool polarity=0) |
short128 v_i16_shuffle_b(short128 a, uchar256 b, int switches, short128 income, bool predicate=1, bool polarity=0) |
short128 v_i16_shuffle_vb(short128 a, uchar256 b, int switches, short128 income, bool128 predicate, bool polarity=0) |
ushort128 v_u16_shuffle_b(ushort128 a, uchar256 b, int switches, ushort128 income, bool predicate=1, bool polarity=0) |
ushort128 v_u16_shuffle_vb(ushort128 a, uchar256 b, int switches, ushort128 income, bool128 predicate, bool polarity=0) |
char256 v_i8_shuffle_b(char256 a, uchar256 b, int switches, char256 income, bool predicate=1, bool polarity=0) |
char256 v_i8_shuffle_vb(char256 a, uchar256 b, int switches, char256 income, bool256 predicate, bool polarity=0) |
uchar256 v_u8_shuffle_b(uchar256 a, uchar256 b, int switches, uchar256 income, bool predicate=1, bool polarity=0) |
uchar256 v_u8_shuffle_vb(uchar256 a, uchar256 b, int switches, uchar256 income, bool256 predicate, bool polarity=0) |
a |
Value to shuffle (SRC1). |
b |
SHUFFLE directions (SRC2). |
switches |
Instruction switches. |
income |
This value is returned if the predicate is false or when no elements are moved to the target lanes. |
predicate |
Predicate value for the instruction. |
polarity |
True if polarity of the predicate is inverted. |
Reshuffled vector.
Subtract¶
Represents SUB instruction.
Intrinsics Prototype and Arguments
float s_f32_sub(float a, float b, int switches=0, float income={}, bool predicate=1, bool polarity=0) |
bf16 s_bf16_sub(bf16 a, bf16 b, int switches=0, bf16 income={}, bool predicate=1, bool polarity=0) |
int32_t s_i32_sub(int32_t a, int32_t b, int switches=0, int32_t income={}, bool predicate=1, bool polarity=0) |
uint32_t s_u32_sub(uint32_t a, uint32_t b, int switches=0, uint32_t income={}, bool predicate=1, bool polarity=0) |
int16_t s_i16_sub(int16_t a, int16_t b, int switches=0, int16_t income={}, bool predicate=1, bool polarity=0) |
uint16_t s_u16_sub(uint16_t a, uint16_t b, int switches=0, uint16_t income={}, bool predicate=1, bool polarity=0) |
int8_t s_i8_sub(int8_t a, int8_t b, int switches=0, int8_t income={}, bool predicate=1, bool polarity=0) |
uint8_t s_u8_sub(uint8_t a, uint8_t b, int switches=0, uint8_t income={}, bool predicate=1, bool polarity=0) |
float64 v_f32_sub_vb(float64 a, float64 b, int switches, float64 income, bool64 predicate, bool polarity=0) |
float64 v_f32_sub_b(float64 a, float64 b, int switches=0, float64 income={}, bool predicate=1, bool polarity=0) |
bfloat128 v_bf16_sub_vb(bfloat128 a, bfloat128 b, int switches, bfloat128 income, bool128 predicate, bool polarity=0) |
bfloat128 v_bf16_sub_b(bfloat128 a, bfloat128 b, int switches=0, bfloat128 income={}, bool predicate=1, bool polarity=0) |
int64 v_i32_sub_vb(int64 a, int64 b, int switches, int64 income, bool64 predicate, bool polarity=0) |
int64 v_i32_sub_b(int64 a, int64 b, int switches=0, int64 income={}, bool predicate=1, bool polarity=0) |
uint64 v_u32_sub_vb(uint64 a, uint64 b, int switches, uint64 income, bool64 predicate, bool polarity=0) |
uint64 v_u32_sub_b(uint64 a, uint64 b, int switches=0, uint64 income={}, bool predicate=1, bool polarity=0) |
short128 v_i16_sub_vb(short128 a, short128 b, int switches, short128 income, bool128 predicate, bool polarity=0) |
short128 v_i16_sub_b(short128 a, short128 b, int switches=0, short128 income={}, bool predicate=1, bool polarity=0) |
ushort128 v_u16_sub_vb(ushort128 a, ushort128 b, int switches, ushort128 income, bool128 predicate, bool polarity=0) |
ushort128 v_u16_sub_b(ushort128 a, ushort128 b, int switches=0, ushort128 income={}, bool predicate=1, bool polarity=0) |
char256 v_i8_sub_vb(char256 a, char256 b, int switches, char256 income, bool256 predicate, bool polarity=0) |
char256 v_i8_sub_b(char256 a, char256 b, int switches=0, char256 income={}, bool predicate=1, bool polarity=0) |
uchar256 v_u8_sub_vb(uchar256 a, uchar256 b, int switches, uchar256 income, bool256 predicate, bool polarity=0) |
uchar256 v_u8_sub_b(uchar256 a, uchar256 b, int switches=0, uchar256 income={}, bool predicate=1, bool polarity=0) |
a |
The first SRC operand to SUB (SRC1). |
b |
The second SRC operand to SUB (SRC2). |
switches |
Switches of SUB instructions. |
income |
This value is returned if the predicate is false. |
predicate |
Predicate value for the instruction. |
polarity |
True if polarity of the predicate is inverted. |
Allowed switches are:
SW_SAT - Saturate (integer types only).
SW_NEG - Negates the destination after the operation.
Result of the operation.
Xor¶
Represents XOR instruction.
Intrinsics Prototype and Arguments
float s_f32_xor(float a, float b, int switches=0, float income={}, bool predicate=1, bool polarity=0) |
bf16 s_bf16_xor(bf16 a, bf16 b, int switches=0, bf16 income={}, bool predicate=1, bool polarity=0) |
int32_t s_i32_xor(int32_t a, int32_t b, int switches=0, int32_t income={}, bool predicate=1, bool polarity=0) |
uint32_t s_u32_xor(uint32_t a, uint32_t b, int switches=0, uint32_t income={}, bool predicate=1, bool polarity=0) |
int16_t s_i16_xor(int16_t a, int16_t b, int switches=0, int16_t income={}, bool predicate=1, bool polarity=0) |
uint16_t s_u16_xor(uint16_t a, uint16_t b, int switches=0, uint16_t income={}, bool predicate=1, bool polarity=0) |
int8_t s_i8_xor(int8_t a, int8_t b, int switches=0, int8_t income={}, bool predicate=1, bool polarity=0) |
uint8_t s_u8_xor(uint8_t a, uint8_t b, int switches=0, uint8_t income={}, bool predicate=1, bool polarity=0) |
bool s_i1_xor(bool a, bool b, int switches=0, bool income={}, bool predicate=1, bool polarity=0) |
float64 v_f32_xor_vb(float64 a, float64 b, int switches, float64 income, bool64 predicate, bool polarity=0) |
float64 v_f32_xor_b(float64 a, float64 b, int switches=0, float64 income={}, bool predicate=1, bool polarity=0) |
bfloat128 v_bf16_xor_vb(bfloat128 a, bfloat128 b, int switches, bfloat128 income, bool128 predicate, bool polarity=0) |
bfloat128 v_bf16_xor_b(bfloat128 a, bfloat128 b, int switches=0, bfloat128 income={}, bool predicate=1, bool polarity=0) |
int64 v_i32_xor_vb(int64 a, int64 b, int switches, int64 income, bool64 predicate, bool polarity=0) |
int64 v_i32_xor_b(int64 a, int64 b, int switches=0, int64 income={}, bool predicate=1, bool polarity=0) |
uint64 v_u32_xor_vb(uint64 a, uint64 b, int switches, uint64 income, bool64 predicate, bool polarity=0) |
uint64 v_u32_xor_b(uint64 a, uint64 b, int switches=0, uint64 income={}, bool predicate=1, bool polarity=0) |
short128 v_i16_xor_vb(short128 a, short128 b, int switches, short128 income, bool128 predicate, bool polarity=0) |
short128 v_i16_xor_b(short128 a, short128 b, int switches=0, short128 income={}, bool predicate=1, bool polarity=0) |
ushort128 v_u16_xor_vb(ushort128 a, ushort128 b, int switches, ushort128 income, bool128 predicate, bool polarity=0) |
ushort128 v_u16_xor_b(ushort128 a, ushort128 b, int switches=0, ushort128 income={}, bool predicate=1, bool polarity=0) |
char256 v_i8_xor_vb(char256 a, char256 b, int switches, char256 income, bool256 predicate, bool polarity=0) |
char256 v_i8_xor_b(char256 a, char256 b, int switches=0, char256 income={}, bool predicate=1, bool polarity=0) |
uchar256 v_u8_xor_vb(uchar256 a, uchar256 b, int switches, uchar256 income, bool256 predicate, bool polarity=0) |
uchar256 v_u8_xor_b(uchar256 a, uchar256 b, int switches=0, uchar256 income={}, bool predicate=1, bool polarity=0) |
bool256 v_i1_xor_b(bool256 a, bool256 b, int switches=0, bool256 income={}, bool predicate=1, bool polarity=0) |
bool256 v_i1_xor_vb(bool256 a, bool256 b, int switches, bool256 income, bool256 predicate, bool polarity=0) |
a |
The first SRC operand to XOR (SRC1). |
b |
The second SRC operand to XOR (SRC2). |
switches |
Switches of XOR instructions. |
income |
This value is returned if the predicate is false. |
predicate |
Predicate value for the instruction. |
polarity |
True if polarity of the predicate is inverted. |
Result of operation.