libsvp64: support paired operands
authorDmitry Selyutin <ghostmansd@gmail.com>
Thu, 7 Sep 2023 19:29:46 +0000 (22:29 +0300)
committerDmitry Selyutin <ghostmansd@gmail.com>
Fri, 8 Sep 2023 17:44:07 +0000 (20:44 +0300)
src/libsvp64/codegen.py
src/libsvp64/svp64.h

index 6faff32b2aac19b2284fff4eb7f195a2b74fdd9f..4e06e0ad46f41d2e3d4badee2780cb86fc3c2d19 100644 (file)
@@ -301,16 +301,24 @@ class DisGenSource(Source):
             yield "flags = SVP64_OPERAND_SIGNED;"
             self.emit("break;")
 
-        def gpr_handler(span):
-            yield from generic_handler(span, "SVP64_OPERAND_GPR")
-
-        def fpr_handler(span):
-            yield from generic_handler(span, "SVP64_OPERAND_FPR")
+        def gpr_handler(span, pair=False):
+            if not pair:
+                yield from generic_handler(span, "SVP64_OPERAND_GPR")
+            else:
+                yield from generic_handler(span, "(SVP64_OPERAND_GPR | SVP64_OPERAND_PAIR)")
+
+        def fpr_handler(span, pair=False):
+            if not pair:
+                yield from generic_handler(span, "SVP64_OPERAND_FPR")
+            else:
+                yield from generic_handler(span, "(SVP64_OPERAND_FPR | SVP64_OPERAND_PAIR)")
 
         handlers = {
             insndb.SignedOperand: signed_handler,
             insndb.GPROperand: gpr_handler,
             insndb.FPROperand: fpr_handler,
+            insndb.GPRPairOperand: lambda span: gpr_handler(span, True),
+            insndb.FPRPairOperand: lambda span: fpr_handler(span, True),
         }
         self.emit(f"case 0x{(path + 1):02x}: /* {', '.join(node.names)} */")
         with self:
index 7b502024926cd40c7c39e6cbff5bda69978faf06..f377c97a8e063e39f2f384eb75ce0fda16e19da7 100644 (file)
@@ -35,6 +35,7 @@ struct svp64_operand {
 #define SVP64_OPERAND_SIGNED    (UINT32_C(1) << UINT32_C(0))
 #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))
 
 struct svp64_ctx {
     struct svp64_record const *record;