libsvp64: support CR operands
authorDmitry Selyutin <ghostmansd@gmail.com>
Thu, 7 Sep 2023 19:40:37 +0000 (22:40 +0300)
committerDmitry Selyutin <ghostmansd@gmail.com>
Thu, 7 Sep 2023 19:40:37 +0000 (22:40 +0300)
src/libsvp64/codegen.py
src/libsvp64/svp64.h

index 8bad6a162e1ebae799b21db404334e3c4c2d3b47..3fc550d60259a073a1c8136461a1368a571593f9 100644 (file)
@@ -313,12 +313,20 @@ class DisGenSource(Source):
             else:
                 yield from generic_handler(span, "(SVP64_OPERAND_FPR | SVP64_OPERAND_PAIR)")
 
+        def cr3_handler(span):
+            yield from generic_handler(span, "SVP64_OPERAND_CR3")
+
+        def cr5_handler(span):
+            yield from generic_handler(span, "SVP64_OPERAND_CR5")
+
         handlers = {
             insndb.SignedOperand: signed_handler,
             insndb.GPROperand: gpr_handler,
             insndb.GPROperand: fpr_handler,
             insndb.GPRPairOperand: lambda span: gpr_handler(span, True),
             insndb.FPRPairOperand: lambda span: fpr_handler(span, True),
+            insndb.CR3Operand: cr3_handler,
+            insndb.CR5Operand: cr5_handler,
         }
         self.emit(f"case 0x{(path + 1):02x}: /* {', '.join(node.names)} */")
         with self:
index f377c97a8e063e39f2f384eb75ce0fda16e19da7..c45a7e5403f5497f8429a02a27de53dcb74f2658 100644 (file)
@@ -36,6 +36,8 @@ struct svp64_operand {
 #define SVP64_OPERAND_GPR       (UINT32_C(1) << UINT32_C(1))
 #define SVP64_OPERAND_FPR       (UINT32_C(1) << UINT32_C(2))
 #define SVP64_OPERAND_PAIR      (UINT32_C(1) << UINT32_C(3))
+#define SVP64_OPERAND_CR3       (UINT32_C(1) << UINT32_C(4))
+#define SVP64_OPERAND_CR5       (UINT32_C(1) << UINT32_C(5))
 
 struct svp64_ctx {
     struct svp64_record const *record;