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:
9f1624d
)
oppc/code: drop explicit ctx argument
author
Dmitry Selyutin
<ghostmansd@gmail.com>
Sun, 14 Jan 2024 12:30:42 +0000
(15:30 +0300)
committer
Dmitry Selyutin
<ghostmansd@gmail.com>
Tue, 16 Jan 2024 19:10:07 +0000
(22:10 +0300)
src/openpower/oppc/pc_code.py
patch
|
blob
|
history
diff --git
a/src/openpower/oppc/pc_code.py
b/src/openpower/oppc/pc_code.py
index f351f5b825678fc4632807e01c13ad0abdf19cff..1b66a1ca1e027505faaedf1382ffd09441907ead 100644
(file)
--- a/
src/openpower/oppc/pc_code.py
+++ b/
src/openpower/oppc/pc_code.py
@@
-7,7
+7,7
@@
import openpower.oppc.pc_pseudocode as pc_pseudocode
class Transient(pc_ast.Node):
class Transient(pc_ast.Node):
- def __init__(self, value="UINT64_C(0)", bits="(uint8_t)
ctx->
XLEN"):
+ def __init__(self, value="UINT64_C(0)", bits="(uint8_t)
OPPC_
XLEN"):
self.__value = value
self.__bits = bits
self.__value = value
self.__bits = bits
@@
-51,7
+51,7
@@
class CodeVisitor(pc_util.Visitor):
def __getitem__(self, node):
return self.__code[node]
def __getitem__(self, node):
return self.__code[node]
- def transient(self, node, value="UINT64_C(0)", bits="(uint8_t)
ctx->
XLEN"):
+ def transient(self, node, value="UINT64_C(0)", bits="(uint8_t)
OPPC_
XLEN"):
transient = Transient(value=value, bits=bits)
with self.pseudocode(node=node):
self.traverse(root=transient)
transient = Transient(value=value, bits=bits)
with self.pseudocode(node=node):
self.traverse(root=transient)
@@
-209,7
+209,7
@@
class CodeVisitor(pc_util.Visitor):
bits = f"UINT8_C({str(len(value[2:]) * 4)})"
value = int(value, 16)
else:
bits = f"UINT8_C({str(len(value[2:]) * 4)})"
value = int(value, 16)
else:
- bits = "
ctx->
XLEN"
+ bits = "
(uint8_t)OPPC_
XLEN"
value = int(value)
fmt = str
if (value > ((2**64) - 1)):
value = int(value)
fmt = str
if (value > ((2**64) - 1)):
@@
-251,13
+251,13
@@
class CodeVisitor(pc_util.Visitor):
def GPR(self, node):
yield node
with self.pseudocode(node=node):
def GPR(self, node):
yield node
with self.pseudocode(node=node):
- self[node].emit(stmt=f"&
ctx->gpr
[OPPC_GPR_{str(node)}]")
+ self[node].emit(stmt=f"&
OPPC_GPR
[OPPC_GPR_{str(node)}]")
@pc_util.Hook(pc_ast.FPR)
def FPR(self, node):
yield node
with self.pseudocode(node=node):
@pc_util.Hook(pc_ast.FPR)
def FPR(self, node):
yield node
with self.pseudocode(node=node):
- self[node].emit(stmt=f"&
ctx->fpr
[OPPC_FPR_{str(node)}]")
+ self[node].emit(stmt=f"&
OPPC_FPR
[OPPC_FPR_{str(node)}]")
@pc_util.Hook(pc_ast.RepeatExpr)
def RepeatExpr(self, node):
@pc_util.Hook(pc_ast.RepeatExpr)
def RepeatExpr(self, node):
@@
-274,7
+274,7
@@
class CodeVisitor(pc_util.Visitor):
@pc_util.Hook(pc_ast.XLEN)
def XLEN(self, node):
yield node
@pc_util.Hook(pc_ast.XLEN)
def XLEN(self, node):
yield node
- (value, bits) = ("
ctx->XLEN", "(uint8_t)ctx->
XLEN")
+ (value, bits) = ("
OPPC_XLEN", "(uint8_t)OPPC_
XLEN")
transient = self.transient(node=node, value=value, bits=bits)
for (level, stmt) in self[transient]:
self[node].emit(stmt=stmt, level=level)
transient = self.transient(node=node, value=value, bits=bits)
for (level, stmt) in self[transient]:
self[node].emit(stmt=stmt, level=level)