add a DIVS function as separate and discrete from floor_div
[soc.git] / src / soc / decoder / isa / caller.py
index bf78fb19cf778e9054970bb566f17bb3b39217bd..ef6e46dd6d8bea6c18266cf72a0df5ceb4c1fdad 100644 (file)
@@ -15,7 +15,7 @@ from soc.decoder.selectable_int import (FieldSelectableInt, SelectableInt,
                                         selectconcat)
 from soc.decoder.power_enums import (spr_dict, spr_byname, XER_bits,
                                      insns, InternalOp)
-from soc.decoder.helpers import exts, trunc_div, trunc_rem
+from soc.decoder.helpers import exts
 from soc.consts import PI, MSR
 
 from collections import namedtuple
@@ -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]