libsvp64: support non-zero operands
authorDmitry Selyutin <ghostmansd@gmail.com>
Thu, 7 Sep 2023 20:02:57 +0000 (23:02 +0300)
committerDmitry Selyutin <ghostmansd@gmail.com>
Thu, 7 Sep 2023 20:02:57 +0000 (23:02 +0300)
src/libsvp64/codegen.py
src/libsvp64/svp64.h

index 8508bdca7431f33f1ab3dec0e89919aebf489d39..81008806d729c836c2529eb8f3d7fdcc71d36857 100644 (file)
@@ -282,6 +282,9 @@ class DisGenSource(Source):
             yield f"flags = {flags};"
             self.emit("break;")
 
+        def nonzero_handler(span):
+            yield from generic_handler(span, "SVP64_OPERAND_NONZERO")
+
         def signed_handler(span):
             mask = f"(UINT32_C(1) << (UINT32_C({len(span)}) - 1))"
             yield "value = ("
@@ -327,6 +330,7 @@ class DisGenSource(Source):
             insndb.CR3Operand: cr3_handler,
             insndb.CR5Operand: cr5_handler,
             insndb.SignedOperand: signed_handler,
+            insndb.NonZeroOperand: nonzero_handler,
             insndb.DynamicOperand: generic_handler,
             object: None,
         }
index c45a7e5403f5497f8429a02a27de53dcb74f2658..d0907a081334fa5fea7f01315ec4f3ec0834e908 100644 (file)
@@ -38,6 +38,7 @@ struct svp64_operand {
 #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))
+#define SVP64_OPERAND_NONZERO   (UINT32_C(1) << UINT32_C(6))
 
 struct svp64_ctx {
     struct svp64_record const *record;