From f25aad525dfc184b5a8407e52b62a499dfb182f4 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Fri, 10 Jul 2020 16:04:08 +0100 Subject: [PATCH] check for div_overflow equal to None rather than == 1 --- src/soc/decoder/isa/caller.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/soc/decoder/isa/caller.py b/src/soc/decoder/isa/caller.py index bf78fb19..711c9650 100644 --- a/src/soc/decoder/isa/caller.py +++ b/src/soc/decoder/isa/caller.py @@ -419,13 +419,13 @@ class ISACaller: inputs.append(SelectableInt(imm, 64)) assert len(outputs) >= 1 print ("handle_overflow", inputs, outputs, div_overflow) - if len(inputs) < 2 and div_overflow != 1: + if len(inputs) < 2 and div_overflow is None: return # div overflow is different: it's returned by the pseudo-code # because it's more complex than can be done by analysing the output - if div_overflow == 1: - ov, ov32 = 1, 1 + if div_overflow is not None: + ov, ov32 = div_overflow, div_overflow # arithmetic overflow can be done by analysing the input and output elif len(inputs) >= 2: output = outputs[0] -- 2.30.2