From: Luke Kenneth Casson Leighton Date: Fri, 10 Jul 2020 15:04:08 +0000 (+0100) Subject: check for div_overflow equal to None rather than == 1 X-Git-Tag: div_pipeline~107 X-Git-Url: https://git.libre-soc.org/?p=soc.git;a=commitdiff_plain;h=f25aad525dfc184b5a8407e52b62a499dfb182f4 check for div_overflow equal to None rather than == 1 --- 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]