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.

Encoding

Binary Layout
1
0:5
1
6:7
0
8:11
/
12:13
/
14:23
IMM
24:31
34
32:37
T
38:42
A
43:47
B
48:52
C
53:57
1
58:59
CX
60
AX
61
BX
62
TX
63
 
Format 8RR:XX4-form
Opcode 0x0500000088000010
Extension VSX

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

Example

xxeval 0, 1, 2, 3, 0x96

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

Registers Altered

MSR

Related

More in VSX

Reference

Description

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.

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.