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:
6fe2b6c
)
power_insn: support int and index opcode methods
author
Dmitry Selyutin
<ghostmansd@gmail.com>
Thu, 27 Apr 2023 19:08:39 +0000
(22:08 +0300)
committer
Dmitry Selyutin
<ghostmansd@gmail.com>
Sun, 30 Apr 2023 18:38:53 +0000
(21:38 +0300)
src/openpower/decoder/power_insn.py
patch
|
blob
|
history
diff --git
a/src/openpower/decoder/power_insn.py
b/src/openpower/decoder/power_insn.py
index 483b7ac52c8a223aa4842f002b39a725cd0ebd1a..b27fdb9f0d5c09123e1ec44a591a0b926aeb9ed0 100644
(file)
--- a/
src/openpower/decoder/power_insn.py
+++ b/
src/openpower/decoder/power_insn.py
@@
-155,6
+155,12
@@
class Opcode:
return NotImplemented
return ((self.value, self.mask) < (other.value, other.mask))
+ def __int__(self):
+ return (self.value & self.mask)
+
+ def __index__(self):
+ return int(self).__index__()
+
def __repr__(self):
def pattern(value, mask, bit_length):
for bit in range(bit_length):