Add computed CR0 to expected version of case_adde_0
authorR Veera Kumar <vklr@vkten.in>
Tue, 23 Nov 2021 06:09:04 +0000 (11:39 +0530)
committerR Veera Kumar <vklr@vkten.in>
Tue, 23 Nov 2021 06:09:04 +0000 (11:39 +0530)
src/openpower/test/alu/alu_cases.py

index 1eead0fab0587f462d1f3fce13e367da2accc021..2afff938e88eb5f2c21206d3a98b052f5c444c53 100644 (file)
@@ -248,13 +248,19 @@ class ALUTestCase(TestAccumulatorBase):
             eq = 0
             gt = 0
             le = 0
+            if (result & (1<<63)) != 0:
+                le = 1
+            elif result == 0:
+                eq = 1
+            else:
+                gt = 1
             # now construct the state
             e = ExpectedState(pc=4)
             e.intregs[6] = initial_regs[6] # should be same as initial
             e.intregs[7] = initial_regs[7] # should be same as initial
             e.intregs[5] = result
             e.ca = carry_out | (carry_out32<<1)  # maybe other way round
-            e.crregs[0] = eq | (gt<<1) | (le<<2) # something like this
+            e.crregs[0] = (eq<<1) | (gt<<2) | (le<<3) # something like this
 
             self.add_case(Program(lst, bigendian),
                           initial_regs, initial_sprs, expected=e)