xxeval

VSX Vector Evaluation

xxeval XT, XA, XB, XC, IMM

Performs an arbitrary 3-input boolean logic function (LUT3) on vectors. The 8-bit immediate 'IMM' defines the truth table.

Details

VSX instruction that performs a three-input lookup-table (LUT3) boolean operation on 128-bit vectors. The 8-bit immediate IMM encodes a truth table; for each bit position, the corresponding bit is determined by treating the three input bits (from XA, XB, XC) as a 3-bit selector into IMM. Requires VSX support; no condition flags are affected.

Pseudocode Operation

for i in 0..127 do
  selector ← (XC[i] || XB[i] || XA[i])
  XT[i] ← IMM[selector]
end for

Programming Note

The xxeval instruction is used to perform complex logical operations on vector registers.

Example

xxeval 0, 1, 2, 3, 0x96

// Custom logic function (e.g., A^B^C).

Encoding

Binary Layout
1
0
1
6
0
8
/
9
60
32
XT
38
XA
43
XB
48
XC
53
IMM
56
 
Format 8RR:XX4-form
Opcode 0x0500000088000010
Extension VSX
Registers Altered MSR

Operands

  • XT
    Target
  • XA
    Source A
  • XB
    Source B
  • XC
    Source C
  • IMM
    Truth Table (8-bits)
  • RT
    Target Vector Register
  • RA
    Source Vector Register A
  • RB
    Source Vector Register B
  • RC
    Source Vector Register C