vextractuh
Vector Extract Unsigned Halfword
vextractuh RA, vB, UIM
Extracts a halfword from a vector into a GPR.
Details
Extracts an unsigned halfword element from vB at the position specified by UIM and stores the zero-extended 16-bit value into general-purpose register RA. The halfword index (0–7) is provided by the 3-bit immediate UIM. No status flags are affected. This instruction is part of the VMX (AltiVec) extension.
Pseudocode Operation
index ← UIM[1:3]
RA ← (0x0000) || vB[index*16 : index*16+15]
Programming Note
The vextractuh instruction extracts an unsigned halfword from a vector register at a specified index. Ensure the index is within bounds to avoid undefined behavior. This instruction operates in user privilege level and does not generate exceptions for valid indices.
Example
vextractuh r4, vb, uim
Encoding
Binary Layout
4
0
RA
6
UIM
11
vB
16
589
21
Operands
-
RA
Target GPR -
vB
Source Vector -
UIM
Index