oppc/code: support unsigned comparisons
authorDmitry Selyutin <ghostmansd@gmail.com>
Sun, 14 Jan 2024 13:43:00 +0000 (16:43 +0300)
committerDmitry Selyutin <ghostmansd@gmail.com>
Tue, 16 Jan 2024 19:10:07 +0000 (22:10 +0300)
src/openpower/oppc/pc_code.py

index c0e8ca1737175f8fad2774817081fe3cba2e87eb..19e8b7d87feb642d82d13dabf72941e07f225f06 100644 (file)
@@ -148,6 +148,7 @@ class CodeVisitor(pc_util.Visitor):
             pc_ast.Lt, pc_ast.Le,
             pc_ast.Eq, pc_ast.NotEq,
             pc_ast.Ge, pc_ast.Gt,
+            pc_ast.LtU, pc_ast.GtU,
         )
         if isinstance(node.left, pc_ast.IfExpr):
             self.ternary(node=node.left)
@@ -188,6 +189,7 @@ class CodeVisitor(pc_util.Visitor):
             pc_ast.Lt, pc_ast.Le,
             pc_ast.Eq, pc_ast.NotEq,
             pc_ast.Ge, pc_ast.Gt,
+            pc_ast.LtU, pc_ast.GtU,
             pc_ast.LShift, pc_ast.RShift,
             pc_ast.BitAnd, pc_ast.BitOr, pc_ast.BitXor,
         )
@@ -203,6 +205,8 @@ class CodeVisitor(pc_util.Visitor):
             pc_ast.Lt: "oppc_lt",
             pc_ast.Le: "oppc_le",
             pc_ast.Eq: "oppc_eq",
+            pc_ast.LtU: "oppc_ltu",
+            pc_ast.GtU: "oppc_gtu",
             pc_ast.NotEq: "oppc_noteq",
             pc_ast.Ge: "oppc_ge",
             pc_ast.Gt: "oppc_gt",