VMX (AltiVec) Instructions
319 PowerISA instructions in this extension - showing 100 per page, page 1 of 4 - click any row for encoding, pseudocode, and full documentation.
| Mnemonic | Syntax | Format | Summary |
|---|---|---|---|
| bcdsr. | bcdsr. VRT,VRA,VRB,PS | VX-form | Shifts a binary coded decimal value by a specified number of digits and rounds the result. |
| bcdus. | bcdus. VRT,VRA,VRB | VX-form | Performs an unsigned shift on packed decimal values in vector registers. |
| bcdutrunc. | bcdutrunc. VRT,VRA,VRB | VX-form | Truncates the unsigned decimal value in VRB to a specified length and places it into VRT. |
| lvebx | lvebx VRT,RA,RB | X-form | Loads a byte from memory into a vector register element. |
| lvehx | lvehx VX,RA,RB | X-form | Loads a halfword element from memory into the corresponding halfword element of a vector register, with the address computed as the sum of RA and RB, aligned to a halfword boundary. |
| lvewx | lvewx VRT,RA,RB | X-form | Loads a word from memory into a vector register element. |
| lvsl | lvsl VRT,RA,RB | X-form | Loads a vector pattern suitable for shifting left indexed. |
| lvx | lvx vD, RA, RB | X-form | Loads a 128-bit vector from memory into a Vector Register. Address must be 16-byte aligned (bits 60-63 of effective address are ignored). |
| mtvscr | mtvscr VRB | VX-form | Moves the contents of a vector register word into the VSCR. |
| mtvsrbm | mtvsrbm VRT,RB | VX-form | Moves a byte mask from a GPR to a VSR. |
| mtvsrqm | mtvsrqm VRT,RB | VX-form | Moves a quadword mask from a general-purpose register to a vector scalar register. |
| mtvsrwm | mtvsrwm VRT,RB | VX-form | Moves a word mask from a general-purpose register to a vector scalar register. |
| ps_add | ps_add FRT, FRA, FRB | A-form | Adds two paired singles. |
| ps_madd | ps_madd FRT, FRA, FRC, FRB | A-form | Multiply-Add on paired singles. |
| ps_mul | ps_mul FRT, FRA, FRC | A-form | Multiplies two paired singles. |
| ps_sub | ps_sub FRT, FRA, FRB | A-form | Subtracts two paired singles. |
| psq_l | psq_l FRT, D(RA), W, I | X-form | Loads a paired single from memory (Embedded/Legacy). |
| psq_st | psq_st FRS, D(RA), W, I | X-form | Stores a paired single to memory (Embedded/Legacy). |
| stvebx | stvebx VRS,RA,RB | X-form | Stores a byte element from a vector register into memory. |
| stvehx | stvehx VRS,RA,RB | X-form | Stores a halfword element from a vector register to memory. |
| stvx | stvx vS, RA, RB | X-form | Stores a quadword from a vector register to memory at an address formed by adding two general-purpose registers. |
| vabsdub | vabsdub vD, vA, vB | VA-form | Returns the absolute value of the difference of integer values in byte elements. |
| vabsduh | vabsduh vD, vA, vB | VA-form | Computes |A - B| for halfwords. |
| vabsduw | vabsduw vD, vA, vB | VA-form | Calculates the absolute difference of unsigned words from two vector registers and stores the result in another vector register. |
| vaddcuq | vaddcuq vD, vA, vB | VX-form | Adds the contents of two vector registers and writes the carry-out to another register. |
| vaddcuw | vaddcuw vD, vA, vB | VX-form | Adds the contents of two vector registers and writes the carry-out to another vector register. |
| vaddfp | vaddfp vD, vA, vB | VA-form | Adds the contents of two vector registers and places the result in another vector register. |
| vaddsbs | vaddsbs vD, vA, vB | VX-form | Adds 16 signed bytes with saturation (-128..127). |
| vaddshs | vaddshs vD, vA, vB | VX-form | Adds the contents of two vector registers and saturates the result if it overflows. |
| vaddsws | vaddsws vD, vA, vB | VX-form | Adds 4 signed words with saturation. |
| vaddubm | vaddubm vD, vA, vB | VX-form | Adds the contents of two vector registers and updates the result in another vector register, modulo operation for bytes. |
| vaddubs | vaddubs vD, vA, vB | VX-form | Adds the contents of two vector registers and saturates the result if it overflows. |
| vaddudm | vaddudm vD, vA, vB | VX-form | Adds 2 doublewords modulo 2^64. |
| vadduhm | vadduhm vD, vA, vB | VX-form | Adds 8 halfwords modulo 65536. |
| vadduhs | vadduhs vD, vA, vB | VX-form | Adds the contents of two vector registers and saturates the result. |
| vadduqm | vadduqm vD, vA, vB | VA-form | Adds the contents of two vector registers and updates the destination register with the result modulo 2^128. |
| vadduwm | vadduwm vD, vA, vB | VX-form | Adds 4 words modulo 2^32. |
| vadduws | vadduws vD, vA, vB | VX-form | Adds the contents of two vector registers and saturates the result if it exceeds 32 bits. |
| vand | vand vD, vA, vB | VX-form | Performs a bitwise AND operation on the contents of two vector registers and stores the result in another vector register. |
| vandc | vandc vD, vA, vB | VX-form | Bitwise AND of vA with the ones' complement of vB (vA & ~vB). |
| vavgsb | vavgsb vD, vA, vB | VA-form | Performs a signed byte-wise average of two vector registers and stores the result in another vector register. |
| vavgsh | vavgsh vD, vA, vB | VA-form | Performs a signed halfword average operation on vector elements. |
| vavgsw | vavgsw vD, vA, vB | VA-form | Performs a vector average of signed words from two source vectors and stores the result in a destination vector. |
| vavgub | vavgub vD, vA, vB | VA-form | Computes (a+b+1)/2 for bytes. |
| vavguh | vavguh vD, vA, vB | VA-form | Computes (a+b+1)/2 for halfwords. |
| vavguw | vavguw vD, vA, vB | VA-form | Computes (a+b+1)/2 for words. |
| vbpermd | vbpermd VRT,VRA,VRB | VX-form | Performs a bit permute operation on doublewords of two vector registers and stores the result in another vector register. |
| vbpermq | vbpermq VRT,VRA,VRB | VX-form | Performs a bit permutation on two vector registers and stores the result in another vector register. |
| vbrd | vbrd vD, vB | VX-form | Reverses bytes within each doubleword. |
| vbrh | vbrh vD, vB | VX-form | Reverses bytes within each halfword (Endian Swap). |
| vbrq | vbrq vD, vB | VX-form | Reverses bytes within the entire 128-bit quadword. |
| vbrw | vbrw vD, vB | VX-form | Reverses bytes within each word. |
| vcfsx | vcfsx vD, vB, UIM | VX-form | Converts signed fixed-point values in a vector register to single-precision floating-point values. |
| vcfuged | vcfuged vD, vA, vB | VX-form | Separates bits of source into two groups based on mask (Power10). |
| vcfux | vcfux vD, vB, UIM | VX-form | Converts 4 unsigned 32-bit integers to floats. |
| vclrlb | vclrlb vD, vA, RB | VX-form | Clears the leftmost bytes in a vector register based on the value in a general-purpose register. |
| vclrrb | vclrrb vD, vA, RB | VX-form | Clears the N rightmost bytes of a vector. |
| vclzb | vclzb vD, vB | VX-form | Counts the number of leading zero bits in each byte element of a vector register. |
| vclzd | vclzd vD, vB | VX-form | Counts the number of leading zero bits in each doubleword element of a vector register. |
| vclzdm | vclzdm VRT, VRA, VRB | X-form | Counts the number of leading zeros in each doubleword element of a vector, considering a mask. |
| vclzh | vclzh vD, vB | VX-form | Counts leading zeros in each halfword. |
| vclzlsbb | vclzlsbb RA, vB | VX-form | Counts the number of contiguous leading byte elements in VSR[VRB+32] having a zero least-significant bit. |
| vclzw | vclzw vD, vB | VX-form | Counts the number of leading zero bits in each word element of a vector register. |
| vcmpbfp | vcmpbfp VRT,VRA,VRB | VC-form | Compares two VSRs word element by word and sets the target VSR if Rc=1. |
| vcmpbfp. | vcmpbfp. VRT,VRA,VRB | VC-form | Compares two VSRs word element by word and sets the target VSR if Rc=1. |
| vcmpeqfp | vcmpeqfp VRT,VRA,VRB | VC-form | Compares the elements of two vector registers for equality and stores the result in a third vector register. |
| vcmpeqfp. | vcmpeqfp. VRT,VRA,VRB | VC-form | Compares the elements of two vector registers for equality and stores the result in a third vector register. |
| vcmpequb | vcmpequb VRT,VRA,VRB | VC-form | Compares two vector registers element by element as unsigned bytes and sets the target vector register based on the comparison. |
| vcmpequb. | vcmpequb. VRT,VRA,VRB | VC-form | Compares two vector registers element by element as unsigned bytes and sets the target vector register based on the comparison. |
| vcmpequd | vcmpequd VRT,VRA,VRB | VC-form | Compares two vector registers for equality on an unsigned doubleword basis and stores the result in a third vector register. |
| vcmpequd. | vcmpequd. VRT,VRA,VRB | VC-form | Compares two vector registers for equality on an unsigned doubleword basis and stores the result in a third vector register. |
| vcmpequh | vcmpequh VRT,VRA,VRB | VC-form | Compares each halfword of two vector registers and sets the corresponding halfword in the target register to all 1s if they are equal, otherwise all 0s. |
| vcmpequh. | vcmpequh. VRT,VRA,VRB | VC-form | Compares each halfword of two vector registers and sets the corresponding halfword in the target register to all 1s if they are equal, otherwise all 0s. |
| vcmpequq | vcmpequq VRT,VRA,VRB | VC-form | Compares two quadwords and sets the result to all ones if they are equal, otherwise all zeros. |
| vcmpequq. | vcmpequq. VRT,VRA,VRB | VC-form | Compares two quadwords and sets the result to all ones if they are equal, otherwise all zeros. |
| vcmpequw | vcmpequw VRT,VRA,VRB | VC-form | Compares each word of two vector registers and sets the corresponding word in the target register to all 1s if they are equal, otherwise all 0s. |
| vcmpequw. | vcmpequw. VRT,VRA,VRB | VC-form | Compares each word of two vector registers and sets the corresponding word in the target register to all 1s if they are equal, otherwise all 0s. |
| vcmpgefp | vcmpgefp vD, vA, vB | VC-form | Compares 4 floats (A >= B). |
| vcmpgtfp | vcmpgtfp VRT,VRA,VRB | VC-form | Compares the contents of two vector registers and sets the target vector register based on whether each element is greater than the corresponding element in the other vector. |
| vcmpgtfp. | vcmpgtfp. VRT,VRA,VRB | VC-form | Compares the contents of two vector registers and sets the target vector register based on whether each element is greater than the corresponding element in the other vector. |
| vcmpgtsb | vcmpgtsb VRT,VRA,VRB | VC-form | Compares each byte of two vector registers and sets the corresponding result byte to all 1s if the signed byte in the first source register is greater than the signed byte in the second source register, otherwise sets it to all 0s. |
| vcmpgtsb. | vcmpgtsb. VRT,VRA,VRB | VC-form | Compares each byte of two vector registers and sets the corresponding result byte to all 1s if the signed byte in the first source register is greater than the signed byte in the second source register, otherwise sets it to all 0s. |
| vcmpgtsd | vcmpgtsd VRT,VRA,VRB | VC-form | Compares two doublewords of signed integers and sets the result vector based on the comparison. |
| vcmpgtsd. | vcmpgtsd. VRT,VRA,VRB | VC-form | Compares two doublewords of signed integers and sets the result vector based on the comparison. |
| vcmpgtsh | vcmpgtsh VRT,VRA,VRB | VC-form | Compares each halfword of two vector registers and sets the corresponding result element to all 1s if the first operand is greater than the second, otherwise all 0s. |
| vcmpgtsh. | vcmpgtsh. VRT,VRA,VRB | VC-form | Compares each halfword of two vector registers and sets the corresponding result element to all 1s if the first operand is greater than the second, otherwise all 0s. |
| vcmpgtsq | vcmpgtsq VRT,VRA,VRB | VC-form | Compares two signed quadwords and sets the result based on whether the first is greater than the second. |
| vcmpgtsq. | vcmpgtsq. VRT,VRA,VRB | VC-form | Compares two signed quadwords and sets the result based on whether the first is greater than the second. |
| vcmpgtsw | vcmpgtsw VRT,VRA,VRB | VC-form | Compares each word of two vector registers and sets the corresponding word in the target vector register to all 1s if the first operand is greater than the second, otherwise to all 0s. |
| vcmpgtsw. | vcmpgtsw. VRT,VRA,VRB | VC-form | Compares each word of two vector registers and sets the corresponding word in the target vector register to all 1s if the first operand is greater than the second, otherwise to all 0s. |
| vcmpgtub | vcmpgtub vD, vA, vB | VC-form | Unsigned > comparison for 16 bytes. |
| vcmpgtud | vcmpgtud vD, vA, vB | VC-form | Compares the contents of two vector registers and sets a result based on whether each element in the first register is greater than the corresponding element in the second register. |
| vcmpgtuh | vcmpgtuh vD, vA, vB | VC-form | Unsigned > comparison for 8 halfwords. |
| vcmpgtuw | vcmpgtuw vD, vA, vB | VC-form | Unsigned > comparison for 4 words. |
| vcmpneb | vcmpneb VRT,VRA,VRB | VC-form | Compares each byte of two vector registers and sets the result register to all 1s if the bytes are not equal, otherwise all 0s. |
| vcmpneb. | vcmpneb. VRT,VRA,VRB | VC-form | Compares each byte of two vector registers and sets the result register to all 1s if the bytes are not equal, otherwise all 0s. |
| vcmpneh | vcmpneh VRT,VRA,VRB | VC-form | Compares the contents of two vector registers and sets the result register to all 1s if the elements are not equal, otherwise all 0s. |
| vcmpneh. | vcmpneh. VRT,VRA,VRB | VC-form | Compares the contents of two vector registers and sets the result register to all 1s if the elements are not equal, otherwise all 0s. |
| vcmpnew | vcmpnew VRT,VRA,VRB | VC-form | Compares each word of two vector registers and sets the corresponding word in the target vector register to all 1s if the words are not equal, otherwise to all 0s. |
| vcmpnew. | vcmpnew. VRT,VRA,VRB | VC-form | Compares each word of two vector registers and sets the corresponding word in the target vector register to all 1s if the words are not equal, otherwise to all 0s. |