mtvsrd

Move To VSR Doubleword

mtvsrd XT, RA

Moves 64 bits from a GPR to a VSR.

Details

The mtvsrd instruction moves the contents of a general-purpose register (GPR) into the doubleword element 0 of a vector-scalar register (VSR). If TX=0, it is treated as a Floating-Point instruction in terms of resource availability. If TX=1, it is treated as a Vector instruction.

Pseudocode Operation

if TX=0 & MSR.FP=0 then FP_Unavailable()
if TX=1 & MSR.VEC=0 then Vector_Unavailable()
Let XT be the value 32×TX + T.
VSR[XT].dword[0] ← GPR[RA]
VSR[XT].dword[1] ← 0xUUUU_UUUU_UUUU_UUUU

Programming Note

The mtvsrd instruction is commonly used to transfer data from a general-purpose register to the first doubleword of a vector-scalar register. Ensure that the appropriate privilege level (FP or VEC) is enabled in the MSR register, otherwise, an exception will be raised. Note that the second doubleword of the VSR is zeroed out during this operation.

Example

mtvsrd vs1, r4

Encoding

Binary Layout
31
0
XT
6
RA
11
0
16
179
21
 
Format XX1-form
Opcode 0x7C0000B3
Extension VSX
Registers Altered MSR

Operands

  • XT
    Target VSR
  • RA
    Source GPR