From: Luke Kenneth Casson Leighton Date: Fri, 19 Jun 2020 09:54:14 +0000 (+0100) Subject: add true and floor div to SelectableInt X-Git-Tag: div_pipeline~321 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7e3ecd1020179dcd0eafb27c93270a2edcb0e559;p=soc.git add true and floor div to SelectableInt --- diff --git a/src/soc/decoder/selectable_int.py b/src/soc/decoder/selectable_int.py index 716ad682..72640909 100644 --- a/src/soc/decoder/selectable_int.py +++ b/src/soc/decoder/selectable_int.py @@ -1,8 +1,8 @@ import unittest from copy import copy from soc.decoder.power_fields import BitRange -from operator import (add, sub, mul, truediv, mod, or_, and_, xor, neg, inv, - lshift, rshift) +from operator import (add, sub, mul, floordiv, truediv, mod, or_, and_, xor, + neg, inv, lshift, rshift) def check_extsign(a, b): @@ -169,7 +169,9 @@ class SelectableInt: return self._op(sub, b) def __mul__(self, b): return self._op(mul, b) - def __div__(self, b): + def __floordiv__(self, b): + return self._op(floordiv, b) + def __truediv__(self, b): return self._op(truediv, b) def __mod__(self, b): return self._op(mod, b)