result <- [0] * XLEN
do i = 0 to XLEN - 1
idx <- (RT)[i] || (RA)[i] || (RB)[i]
- result[i] <- TLI[7-idx]
+ result[i] <- TLI[idx]
RT <- result
Special Registers Altered:
result <- [0] * 64
do i = 0 to 63
idx <- (RA)[i] || (RB)[i]
- result[i] <- lut[3-idx]
+ result[i] <- lut[idx]
RT <- result
Description:
result <- [0] * 4
do i = 0 to 3
idx <- bf[i] || bfa[i] || bfb[i]
- result[i] <- TLI[7-idx]
+ result[i] <- TLI[idx]
do i = 0 to 3
if msk[i] = 1 then
CR[4*BF+32+i] <- result[i]
Pseudo-code:
idx <- CR[BT+32] || CR[BA+32] || CR[BB+32]
- CR[BT+32] <- TLI[7-idx]
+ CR[BT+32] <- TLI[idx]
Special Registers Altered:
result <- [0] * 4
do i = 0 to 3
idx <- a[i] || b[i]
- result[i] <- lut[3-idx]
+ result[i] <- lut[idx]
do i = 0 to 3
if msk[i] = 1 then
CR[4*BF+32+i] <- result[i]
lut <- CR[4*BFB+32:4*BFB+35]
idx <- CR[BT+32] || CR[BA+32]
- CR[BT+32] <- lut[3-idx]
+ CR[BT+32] <- lut[idx]
Special registers altered:
if check & (1<<i):
lut_index |= 1<<j
maskbit = (mask >> i) & 0b1
+ lut_index = 3-lut_index # MSB0 inversion
if (lut & (1<<lut_index)) and maskbit:
expected |= 1<<i
return expected
for i in range(64):
lut_index = 0
if rb & 2 ** i:
- lut_index |= 2 ** 0
+ lut_index |= 2 ** 2
if ra & 2 ** i:
lut_index |= 2 ** 1
if rt & 2 ** i:
- lut_index |= 2 ** 2
+ lut_index |= 2 ** 0
if imm & 2 ** lut_index:
expected |= 2 ** i
return expected
for j, check in enumerate(checks):
if check & 1:
lut_index |= 1<<j
+ lut_index = 7-lut_index # MSB0 inversion
if imm & (1<<lut_index):
expected |= 1
return expected
if check & (1<<i):
lut_index |= 1<<j
maskbit = (mask >> i) & 0b1
+ lut_index = 7-lut_index # MSB0 inversion
if (imm & (1<<lut_index)) and maskbit:
expected |= 1<<i
return expected
lut_index |= 2 ** 1
if rt & 2 ** i:
lut_index |= 2 ** 2
+ lut_index = 7-lut_index # MSB0 inversion
if imm & 2 ** lut_index:
expected |= 2 ** i
e.intregs[3] = expected
lut_index |= 2 ** 0
if ra & 2 ** i:
lut_index |= 2 ** 1
+ lut_index = 3-lut_index # MSB0 inversion
if lut & 2 ** lut_index:
expected |= 2 ** i
e.intregs[3] = expected