Summary of vector built-in functions

The tables below summarize and categorize the vector built-in functions.

Arithmetic

Table 1. Vector built-in functions for arithmetic
Function name Short name description More information
vec_abs Vector Absolute Value See detail
vec_add_u128 Vector Add unsigned 128-bits See detail
vec_addc Vector Add Carryout See detail
vec_addc_u128 Vector Add Compute Carryout unsigned 128-bits See detail
vec_adde_u128 Vector Add With Carry unsigned 128-bits See detail
vec_addec_u128 Vector Add With Carry Compute Carry unsigned 128-bits See detail
vec_andc Vector AND With Complement See detail
vec_avg Vector Average See detail
vec_checksum Vector Checksum See detail
vec_gfmsum Vector Galois Field Multiply Sum See detail
vec_gfmsum_128 Vector Galois Field Multiply Sum 128-bits See detail
vec_gfmsum_accum Vector Galois Field Multiply Sum and Accumulate See detail
vec_gfmsum_accum_128 Vector Galois Field Multiply Sum and Accumulate 128-bits See detail
vec_madd Vector Multiply Add See detail
vec_max Vector Maximum See detail
vec_meadd Vector Multiply and Add Even See detail
vec_mhadd Vector Multiply and Add High See detail
vec_min Vector Minimum See detail
vec_mladd Vector Multiply and Add Low See detail
vec_moadd Vector Multiply and Add Odd See detail
vec_msub Vector Multiply Subtract See detail
vec_mule Vector Multiply Even See detail
vec_mulh Vector Multiply High See detail
vec_mulo Vector Multiply Odd See detail
vec_nabs Vector Negative Absolute See detail
vec_sqrt Vector Square Root See detail
vec_sub_u128 Vector Subtract unsigned 128-bits See detail
vec_subc Vector Subtract Carryout See detail
vec_subc_u128 Vector Subtract Carryout unsigned 128-bits See detail
vec_sube_u128 Vector Subtract with Carryout See detail
vec_subec_u128 Vector Subtract with Carryout, Carryout See detail
vec_sum_u128 Vector Sum Across Quadword See detail
vec_sum2 Vector Sum Across Doubleword See detail
vec_sum4 Vector Sum Across Word See detail

Compare

Table 2. Vector built-in functions for comparing elements
Function name Short name description More information
vec_cmpeq Vector Compare Equal See detail
vec_cmpeq_idx Vector Compare Equal Index See detail
vec_cmpeq_idx_cc Vector Compare Equal Index with Condition Code See detail
vec_cmpeq_or_0_idx Vector Compare Equal or Zero Index See detail
vec_cmpeq_or_0_idx_cc Vector Compare Equal or Zero Index with Condition Code See detail
vec_cmpge Vector Compare Greater Than or Equal See detail
vec_cmpgt Vector Compare Greater Than See detail
vec_cmple Vector Compare Less Than or Equal See detail
vec_cmplt Vector Compare Less Than See detail
vec_cmpne_idx Vector Compare Not Equal Index See detail
vec_cmpne_idx_cc Vector Compare Not Equal Index with Condition Code See detail
vec_cmpne_or_0_idx Vector Compare Not Equal or Zero Index See detail
vec_cmpne_or_0_idx_cc Vector Compare Not Equal or Zero Index with Condition Code See detail

Compare Ranges

Table 3. Vector built-in functions for comparing ranges
Function name Short name description More information
vec_cmpnrg Vector Compare Not in Ranges See detail
vec_cmpnrg_cc Vector Compare Not in Ranges with Condition Code See detail
vec_cmpnrg_idx Vector Compare Not in Ranges Index See detail
vec_cmpnrg_idx_cc Vector Compare Not in Ranges Index with Condition Code See detail
vec_cmpnrg_or_0_idx Vector Compare Not in Ranges or Zero Index See detail
vec_cmpnrg_or_0_idx_cc Vector Compare Not in Ranges or Zero Index with Condition Code See detail
vec_cmprg Vector Compare Ranges See detail
vec_cmprg_cc Vector Compare Ranges with Condition Code See detail
vec_cmprg_idx Vector Compare Ranges Index See detail
vec_cmprg_idx_cc Vector Compare Ranges Index with Condition Code See detail
vec_cmprg_or_0_idx Vector Compare Ranges or Zero Index See detail
vec_cmprg_or_0_idx_cc Vector Compare Ranges or Zero Index with Condition Code See detail

Find Any Element

Table 4. Vector built-in functions for element searching
Function name Short name description More information
vec_find_any_eq Vector Find Any Element Equal See detail
vec_find_any_eq_cc Vector Find Any Element Equal with Condition Code See detail
vec_find_any_eq_idx Vector Find Any Element Equal Index See detail
vec_find_any_eq_idx_cc Vector Find Any Element Equal Index with Condition Code See detail
vec_find_any_eq_or_0_idx Vector Find Any Element Equal or Zero Index See detail
vec_find_any_eq_or_0_idx_cc Vector Find Any Element Equal or Zero Index with Condition Code See detail
vec_find_any_ne Vector Find Any Element Not Equal See detail
vec_find_any_ne_cc Vector Find Any Element Not Equal with Condition Code See detail
vec_find_any_ne_idx Vector Find Any Element Not Equal Index See detail
vec_find_any_ne_idx_cc Vector Find Any Element Not Equal Index with Condition Code See detail
vec_find_any_ne_or_0_idx Vector Find Any Element Not Equal or Zero Index See detail
vec_find_any_ne_or_0_idx_cc Vector Find Any Element Not Equal or Zero Index with Condition Code See detail

Gather and Scatter

Table 5. Vector built-in functions for gathering and scattering elements
Function name Short name description More information
vec_extract Vector Extract See detail
vec_gather_element Vector Gather Element See detail
vec_insert Vector Insert See detail
vec_insert_and_zero Vector Insert and Zero See detail
vec_perm Vector Permute See detail
vec_permi Vector Permute Immediate See detail
vec_promote Vector Promote See detail
vec_scatter_element Vector Scatter Element See detail
vec_sel Vector Select See detail

Generate Mask

Table 6. Vector built-in functions for generating mask
Function name Short name description More information
vec_genmask Vector Generate Byte Mask See detail
vec_genmasks_8 Vector Generate Mask (Byte) See detail
vec_genmasks_16 Vector Generate Mask (Halfword) See detail
vec_genmasks_32 Vector Generate Mask (Word) See detail
vec_genmasks_64 Vector Generate Mask (Doubleword) See detail

Copy until Zero

Table 7. Vector built-in functions for copying until a zero is encountered
Function name Short name description More information
vec_cp_until_zero Vector Copy Until Zero See detail
vec_cp_until_zero_cc Vector Copy Until Zero See detail

Load and Store

Table 8. Vector built-in functions for loading and storing vectors
Function name Short name description More information
vec_ld2f Vector Load 2 float See detail
vec_load_bndry Vector Load to Block Boundary See detail
vec_load_len Vector Load with Length See detail
vec_load_pair Vector Load Pair See detail
vec_st2f Vector Store 2 float See detail
vec_store_len Vector Store with Length See detail
vec_xld2 Vector Load 2 Doubleword See detail
vec_xlw4 Vector Load 4 Word See detail
vec_xstd2 Vector Store 2 Doubleword See detail
vec_xstw4 Vector Store 4 Word See detail

Logical

Table 9. Vector built-in functions for logical calculation
Function name Short name description More information
vec_cntlz Vector Count Leading Zeros See detail
vec_cnttz Vector Count Trailing Zeros See detail
vec_nor Vector NOR See detail
vec_popcnt Vector Population Count See detail

Merge

Table 10. Vector built-in functions for merging vectors
Function name Short name description More information
vec_mergeh Vector Merge High See detail
vec_mergel Vector Merge Low See detail

Pack and Unpack

Table 11. Vector built-in functions for pack and unpack
Function name Short name description More information
vec_pack Vector Pack See detail
vec_packs Vector Pack Saturate See detail
vec_packs_cc Vector Pack Saturate Condition Code See detail
vec_packsu Vector Pack Saturated Unsigned See detail
vec_packsu_cc Vector Pack Saturated Unsigned Condition Code See detail
vec_unpackh Vector Unpack High Element See detail
vec_unpackl Vector Unpack Low Element See detail

Replicate

Table 12. Vector built-in functions for replicating vector elements
Function name Short name description More information
vec_splat Vector Splat See detail
vec_splat_s8 Vector Splat Signed Byte See detail
vec_splat_s16 Vector Splat Signed Halfword See detail
vec_splat_s32 Vector Splat Signed Word See detail
vec_splat_s64 Vector Splat Signed Doubleword See detail
vec_splat_u8 Vector Splat Unsigned Byte See detail
vec_splat_u16 Vector Splat Unsigned Halfword See detail
vec_splat_u32 Vector Splat Unsigned Word See detail
vec_splat_u64 Vector Splat Doubleword See detail
vec_splats Vector Splats See detail

Rotate and Shift

Table 13. Vector built-in functions for rotate and shift
Function name Short name description More information
vec_rl Vector Element Rotate Left See detail
vec_rl_mask Vector Element Rotate and Insert Under Mask See detail
vec_rli Vector Element Rotate Left Immediate See detail
vec_slb Vector Shift Left by Byte See detail
vec_sld Vector Shift Left Double by Byte See detail
vec_sldw Vector Shift Left Double by Word See detail
vec_sll Vector Shift Left See detail
vec_srab Vector Shift Right Arithmetic by Byte See detail
vec_sral Vector Shift Right Arithmetic See detail
vec_srb Vector Shift Right by Byte See detail
vec_srl Vector Shift Right See detail

Rounding and Conversion

Table 14. Vector built-in functions for rounding and conversion
Function name Short name description More information
vec_ceil Vector Ceiling See detail
vec_ctd Vector Convert to Double See detail
vec_ctsl Vector Convert to signed long long See detail
vec_ctul Vector Convert to unsigned long long See detail
vec_extend_s64 Vector Sign Extend to Doubleword See detail
vec_floor Vector Floor See detail
vec_round Vector Round to Nearest See detail
vec_roundc Vector Round to Current See detail
vec_roundm Vector Round toward Negative Infinity See detail
vec_roundp Vector Round toward Positive Infinity See detail
vec_roundz Vector Round toward Zero See detail
vec_trunc Vector Truncate See detail

Test

Table 15. Vector built-in functions for testing
Function name Short name description More information
vec_fp_test_data_class Vector Floating-Point Test Data Class See detail
vec_test_mask Vector Test under Mask See detail

All Predicates

Table 16. Vector built-in functions for searching and comparing all elements
Function name Short name description More information
vec_all_eq All Elements Equal See detail
vec_all_ge All Elements Greater Than or Equal See detail
vec_all_gt All Elements Greater Than See detail
vec_all_le All Elements Less Than or Equal See detail
vec_all_lt All Elements Less Than See detail
vec_all_nan All Elements Not a Number See detail
vec_all_ne All Elements Not Equal See detail
vec_all_nge All Elements Not Greater Than or Equal See detail
vec_all_ngt All Elements Not Greater Than See detail
vec_all_nle All Elements Not Less Than or Equal See detail
vec_all_nlt All Elements Not Less Than See detail
vec_all_numeric All Elements Numeric See detail

Any Predicates

Table 17. Vector built-in functions for searching and comparing any elements
Function name Short name description More information
vec_any_eq Any Element Equal See detail
vec_any_ge Any Element Greater Than or Equal See detail
vec_any_gt Any Element Greater Than See detail
vec_any_le Any Element Less Than or Equal See detail
vec_any_lt Any Element Less Than See detail
vec_any_nan Any Element Not a Number See detail
vec_any_ne Any Element Not Equal See detail
vec_any_nge Any Element Not Greater Than or Equal See detail
vec_any_ngt Any Element Not Greater Than See detail
vec_any_nle Any Element Not Less Than or Equal See detail
vec_any_nlt Any Element Not Less Than See detail
vec_any_numeric Any Element Numeric See detail