mtvsrbmi

Move to Vector Scalar Register with Bit Mask Immediate

N/A

Moves a bit mask immediate value into a vector scalar register, setting each byte element based on corresponding bits of the immediate.

Details

Moves an 8-bit immediate value into a VSR (Vector Scalar Register) with each bit of the immediate controlling whether the corresponding byte element is set to all-ones (0xFF) or all-zeros (0x00). This is a Base category instruction that does not affect condition register or other status fields. The instruction provides a quick way to create byte-level masks in vector registers.

Pseudocode Operation

for i in 0 to 7 do
  if IMM[i] = 1 then
    VSR_target[i*8:(i+1)*8] ← 0xFF
  else
    VSR_target[i*8:(i+1)*8] ← 0x00
end for

Programming Note

The mtvsrbmi instruction is useful for initializing vector registers with specific byte patterns based on an immediate bit mask. Ensure that the immediate value correctly reflects the desired byte-wise initialization to avoid unexpected results. This instruction operates at user privilege level and does not raise exceptions under normal conditions.

Example

mtvsrbmi vs1, 0, 0xFF

Encoding

Binary Layout
4
0
VRT
6
b1
11
b0
16
10
26
b2
31
 
Format XO-form
Opcode 0x10000014
Extension Base

Operands

  • VRT
    Target vector scalar register that receives the byte mask pattern generated from the immediate value.
  • IMM8
    8-bit immediate value where each bit controls the corresponding byte element (1 = 0xFF, 0 = 0x00).