projects
/
openpower-isa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e36f7bb
)
libopid: fix nonzero operand
author
Dmitry Selyutin
<ghostmansd@gmail.com>
Sat, 9 Sep 2023 18:16:17 +0000
(21:16 +0300)
committer
Dmitry Selyutin
<ghostmansd@gmail.com>
Sat, 9 Sep 2023 18:16:17 +0000
(21:16 +0300)
src/libopid/codegen.py
patch
|
blob
|
history
diff --git
a/src/libopid/codegen.py
b/src/libopid/codegen.py
index 1d0f11d7d00f937b638c6468e89f48b5c6449289..349b2e572bb114a781462e4e6fe60e5162c1159c 100644
(file)
--- 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))"