add logging into ISACaller.handle_overflow to see what gets set
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 29 Aug 2022 11:13:34 +0000 (12:13 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 29 Aug 2022 11:13:34 +0000 (12:13 +0100)
src/openpower/decoder/isa/caller.py

index 9ce3b11f5f774eee3be99db96a4fa14db14f43df..03db3ff7e015b98d88283ced9cdf42e971f875c5 100644 (file)
@@ -930,11 +930,13 @@ class ISACaller(ISACallerHelper, ISAFPHelpers):
             ov32 = 1 if input32_sgn[0] == input32_sgn[1] and \
                 output32_sgn != input32_sgn[0] else 0
 
+        # now update XER OV/OV32/SO
+        so = self.spr['XER'][XER_bits['SO']]
+        new_so = so | ov # sticky overflow ORs in old with new
         self.spr['XER'][XER_bits['OV']] = ov
         self.spr['XER'][XER_bits['OV32']] = ov32
-        so = self.spr['XER'][XER_bits['SO']]
-        so = so | ov
-        self.spr['XER'][XER_bits['SO']] = so
+        self.spr['XER'][XER_bits['SO']] = new_so
+        log("    set overflow", ov, ov32, so, new_so)
 
     def handle_comparison(self, outputs, cr_idx=0, overflow=None, no_so=False):
         out = outputs[0]