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