From: Luke Kenneth Casson Leighton Date: Mon, 11 Jul 2022 12:21:44 +0000 (+0100) Subject: fix issue in SelectableInt.__rsub__ causing truncation of values X-Git-Tag: sv_maxu_works-initial~256 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0a33a59175def52235699db582e223408c8b62d4;p=openpower-isa.git fix issue in SelectableInt.__rsub__ causing truncation of values --- diff --git a/src/openpower/decoder/selectable_int.py b/src/openpower/decoder/selectable_int.py index a3eca3d4..675243a2 100644 --- a/src/openpower/decoder/selectable_int.py +++ b/src/openpower/decoder/selectable_int.py @@ -253,11 +253,12 @@ class SelectableInt: return self def __rsub__(self, b): + log("rsub", b, self.value) if isinstance(b, int): - b = SelectableInt(b, self.bits) - b = check_extsign(self, b) - assert b.bits == self.bits - return SelectableInt(b.value - self.value, self.bits) + b = SelectableInt(b, 256) # max extent + #b = check_extsign(self, b) + #assert b.bits == self.bits + return SelectableInt(b.value - self.value, b.bits) def __radd__(self, b): if isinstance(b, int):