copy 64-bit OV, try creating 32-bit OV32 in
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 8 Jun 2020 14:28:02 +0000 (15:28 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 8 Jun 2020 14:28:02 +0000 (15:28 +0100)
simulator caller.py

src/soc/decoder/isa/caller.py

index 3f94019e257c2d3203df7770122a5e05035f407b..7160d53dc2fb69e1edcd722648d2a61c2d147d5f 100644 (file)
@@ -298,12 +298,21 @@ class ISACaller:
         assert len(outputs) >= 1
         if len(inputs) >= 2:
             output = outputs[0]
+
+            # OV (64-bit)
             input_sgn = [exts(x.value, x.bits) < 0 for x in inputs]
             output_sgn = exts(output.value, output.bits) < 0
             ov = 1 if input_sgn[0] == input_sgn[1] and \
                 output_sgn != input_sgn[0] else 0
 
+            # OV (32-bit)
+            input32_sgn = [exts(x.value, 32) < 0 for x in inputs]
+            output32_sgn = exts(output.value, 32) < 0
+            ov32 = 1 if input32_sgn[0] == input32_sgn[1] and \
+                output32_sgn != input32_sgn[0] else 0
+
             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