stxvrhx

Store VSX Vector Rightmost Halfword Indexed X-form

stxvrhx XS,RA,RB

Stores the rightmost halfword of a VSX vector element to memory.

Details

The stxvrhx instruction stores the rightmost halfword (16 bits) of the VSX vector element specified by XS into memory at the effective address EA, which is computed as the sum of GPR[RA] and GPR[RB].

Pseudocode Operation

if MSR.VSX=0 then
    VSX_Unavailable()
EA = ((RA=0) ? 0 : GPR[RA]) + GPR[RB]
store_data = VSR[32×SX+S].hword[7]
MEM(EA,2) = store_data

Programming Note

The stxvrhx instruction stores the rightmost halfword of a VSX vector element into memory. Ensure that the VSX facility is enabled (MSR.VSX=1); otherwise, a VSX_Unavailable exception will occur. The effective address is calculated by adding GPR[RA] and GPR[RB], so ensure these registers contain valid addresses. This instruction operates at user privilege level.

Example

stxvrhx vs1, r4, r5

Encoding

Binary Layout
0
0
S
6
RA
11
RB
16
16
21
SX
31
 
Format X-form
Opcode 0x7C00015A
Extension VSX

Operands

  • XS
    VSX Vector Register
  • RA
    General Purpose Register (Base Address)
  • RB
    General Purpose Register (Index)