initial_regs[2] = random.randint(0, (1 << 64)-1)
self.add_case(Program(lst, bigendian), initial_regs)
+ def case_addis_nonzero_r0(self):
+ for i in range(10):
+ imm = random.randint(-(1 << 15), (1 << 15)-1)
+ lst = [f"addis 3, 0, {imm}"]
+ print(lst)
+ initial_regs = [0] * 32
+ initial_regs[0] = random.randint(0, (1 << 64)-1)
+ self.add_case(Program(lst, bigendian), initial_regs)
+
def case_rand_imm(self):
insns = ["addi", "addis", "subfic"]
for i in range(10):
with Program(lst, bigendian) as program:
self.run_tst_program(program, [12])
+ #@unittest.skip("disable")
+ def test_31_addis(self):
+ """tests for zero not in register zero
+ """
+ lst = [ "rldicr 0, 0,32,31",
+ "oris 0, 0,32767",
+ "ori 0, 0,65535",
+ "addis 1, 0, 1",
+ ]
+ with Program(lst, bigendian) as program:
+ self.run_tst_program(program, [0, 1])
+
def run_tst_program(self, prog, initial_regs=None, initial_sprs=None,
initial_mem=None):
initial_regs = [0] * 32