---- comparefixed.py.orig 2020-05-07 14:19:47.384535384 -0400
-+++ comparefixed.py 2020-05-07 14:19:11.220806542 -0400
+--- comparefixed.py.orig 2020-05-15 10:02:00.087668937 -0400
++++ comparefixed.py 2020-05-15 12:32:36.834556205 -0400
@@ -21,7 +21,7 @@
c = SelectableInt(value=0x2, bits=3)
else:
return (CR,)
@inject()
-@@ -85,10 +85,10 @@
+@@ -85,23 +85,22 @@
else:
in_range = le(src21lo, src1) & le(src1, src21hi) | le(src22lo, src1) & le(
src1, src22hi)
return (CR,)
@inject()
-@@ -98,10 +98,10 @@
+- def op_cmpeqb(self, RB, CR):
+- src1 = GPR[RA]
+- src1 = src1[56:64]
++ def op_cmpeqb(self, RA, RB, CR):
++ src1 = RA[56:64]
match = eq(src1, RB[0:8]) | eq(src1, RB[8:16]) | eq(src1, RB[16:24]) | eq(src1,
RB[24:32]) | eq(src1, RB[32:40]) | eq(src1, RB[40:48]) | eq(src1, RB[48:56]
) | eq(src1, RB[56:64])
return (CR,)
comparefixed_instrs = {}
+@@ -136,7 +135,7 @@
+ form='X',
+ asmregs=[['BF', 'L', 'RA', 'RB']])
+ comparefixed_instrs['cmpeqb'] = instruction_info(func=op_cmpeqb,
+- read_regs=OrderedSet(['RB']),
++ read_regs=OrderedSet(['RA', 'RB']),
+ uninit_regs=OrderedSet(), write_regs=OrderedSet(['CR']),
+ special_regs=OrderedSet(['CR']), op_fields=OrderedSet(['BF']),
+ form='X',
sim = self.run_tst_program(program, initial_regs)
self.assertEqual(sim.gpr(2), SelectableInt(16, 64))
self.assertEqual(sim.gpr(4), SelectableInt(8, 64))
+
+ def test_cmpeqb(self):
+ lst = ["cmpeqb cr0, 2, 1",
+ "cmpeqb cr1, 3, 1"]
+ initial_regs = [0] * 32
+ initial_regs[1] = 0x0102030405060708
+ initial_regs[2] = 0x04
+ initial_regs[3] = 0x10
+ with Program(lst) as program:
+ sim = self.run_tst_program(program, initial_regs)
+
def test_mtcrf(self):