stvx

Store Vector Indexed

stvx vS, RA, RB

Stores a quadword from a vector register to memory at an address formed by adding two general-purpose registers.

Details

The contents of VSR[VRS+32] are placed into the quad-word in storage at address EA, which is the result of ANDing 0xFFFF_FFFF_FFFF_FFF0 with the sum (RA|0) + (RB).

Pseudocode Operation

if MSR.VEC=0 then
    Vector_Unavailable()
EA ←((RA=0) ? 0 : GPR[RA]) + GPR[RB]
EA ←EA & 0xFFFF_FFFF_FFFF_FFF0
MEM(EA, 16) ←VSR[VRS+32]

Programming Note

The stvx instruction stores a vector register into memory. Ensure that the Vector Facility is enabled by checking and setting the VEC bit in the MSR register if necessary. The effective address (EA) must be aligned to a 16-byte boundary, as indicated by the AND operation with 0xFFFF_FFFF_FFFF_FFF0. This instruction operates at user privilege level but will raise an exception if the Vector Facility is not available.

Example

stvx v1, r3, r4

Encoding

Binary Layout
31
0
vS
6
RA
11
RB
16
231
/
 
Format X-form
Opcode 0x7C0001C6
Extension VMX (AltiVec)
Registers Altered MSR

Operands

  • vS
    Source Vector Register
  • RA
    Base Register
  • RB
    Index Register
  • VRS
    Vector Register