From 60cc39608dfe3a45251578e58a57a1d3907e6e23 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Mon, 8 Jun 2020 15:28:02 +0100 Subject: [PATCH] copy 64-bit OV, try creating 32-bit OV32 in simulator caller.py --- src/soc/decoder/isa/caller.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/soc/decoder/isa/caller.py b/src/soc/decoder/isa/caller.py index 3f94019e..7160d53d 100644 --- a/src/soc/decoder/isa/caller.py +++ b/src/soc/decoder/isa/caller.py @@ -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 -- 2.30.2