xxextractuw

VSX Vector Extract Unsigned Word

xxextractuw RT, XS, UIM

Extracts an unsigned word from a vector register and places it into another vector register.

Details

The instruction extracts the contents of byte elements UIM:UIM+3 from VSR[XB] and places them into word element 1 of VSR[XT]. The remaining byte elements of VSR[XT] are not modified, and the remaining word elements of VSR[XT] are set to 0.

Pseudocode Operation

if MSR.VSX=0 then
    VSX_Unavailable()
src ←VSR[32×BX+B].byte[UIM:UIM+3]
VSR[32×TX+T].dword[0] ←EXTZ64(src)
VSR[32×TX+T].dword[1] ←0x0000_0000_0000_0000

Programming Note

This instruction is useful for extracting a specific 4-byte segment from one vector register and placing it into another, while zeroing out the rest of the destination register. Ensure that VSX (Vector Scalar Extensions) are enabled in the MSR register to avoid exceptions. Be cautious with byte alignment; UIM must be a multiple of 4 to correctly extract a word. This instruction operates at the user privilege level and does not generate any exceptions beyond those related to VSX availability.

Example

xxextractuw r3, vs1, uim

Encoding

Binary Layout
60
0
XS
6
UIM
11 12
RT
16
165
 
Format XX2-form
Opcode 0xF00000A5
Extension VSX
Registers Altered MSR

Operands

  • RT
    Target GPR
  • XS
    Source VSR
  • UIM
    Element Index
  • XT
    Target Vector Register
  • XB
    Source Vector Register