From 0a33a59175def52235699db582e223408c8b62d4 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Mon, 11 Jul 2022 13:21:44 +0100 Subject: [PATCH] fix issue in SelectableInt.__rsub__ causing truncation of values --- src/openpower/decoder/selectable_int.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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): -- 2.30.2