From: Luke Kenneth Casson Leighton Date: Mon, 6 Jul 2020 19:48:26 +0000 (+0100) Subject: do abs slightly differently in SelectableInt X-Git-Tag: div_pipeline~162^2~22 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e33d8b32d94ef1c68adfb7722eebf5df0a5dc7fc;p=soc.git do abs slightly differently in SelectableInt --- diff --git a/src/soc/decoder/selectable_int.py b/src/soc/decoder/selectable_int.py index 1bd2b94c..359afc97 100644 --- a/src/soc/decoder/selectable_int.py +++ b/src/soc/decoder/selectable_int.py @@ -199,7 +199,7 @@ class SelectableInt: def __abs__(self): print ("abs", self.value & (1<<(self.bits-1))) if self.value & (1<<(self.bits-1)) != 0: - return SelectableInt(0, self.bits) - self + return -self return self def __rsub__(self, b):