From: Dmitry Selyutin Date: Sat, 9 Sep 2023 18:16:17 +0000 (+0300) Subject: libopid: fix nonzero operand X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=990dde5bbf6a6ab539a69d44acb10fe46b3732f8;p=openpower-isa.git libopid: fix nonzero operand --- diff --git a/src/libopid/codegen.py b/src/libopid/codegen.py index 1d0f11d7..349b2e57 100644 --- a/src/libopid/codegen.py +++ b/src/libopid/codegen.py @@ -279,7 +279,12 @@ class DisGenSource(Source): self.emit("break;") def nonzero_handler(span): - yield from generic_handler(span, "OPID_OPERAND_NONZERO") + yield f"value = (UINT32_C(1) + (" + with self: + yield from fetch(span) + yield f"));" + yield f"flags = OPID_OPERAND_NONZERO;" + self.emit("break;") def signed_handler(span, flags="OPID_OPERAND_SIGNED"): mask = f"(UINT32_C(1) << (UINT32_C({len(span)}) - 1))"