vstrir_p

Vector String Isolate Right and Record

vstrir. vD, vB

Isolates the rightmost element and updates CR6.

Details

Isolates the rightmost element in vB that is not the null terminator (0x00) and records properties in CR6. This instruction scans from right to left across bytes, identifies the position of the rightmost non-null byte, and updates vD with the result. CR6 is set based on whether a non-null byte was found; it sets EQ if null bytes occupy the entire register, and clears EQ otherwise.

Pseudocode Operation

idx ← 15
do while idx ≥ 0
  if vB[idx] ≠ 0x00 then break
  idx ← idx - 1
if idx < 0 then
  vD ← [zeros]
  CR6 ← 0b0010
else
  vD ← vB with only byte at idx non-zero, rest zeros
  CR6 ← 0b1000

Example

vstrir. vd, vb

Encoding

Binary Layout
4
0
vD
6
0
11
vB
16
1671
21
 
Format VX-form
Opcode 0x10000687
Extension VMX (AltiVec)

Operands

  • vD
    Target
  • vB
    Source