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>
Fri, 8 Sep 2023 17:44:29 +0000 (20:44 +0300)
src/libsvp64/codegen.py
src/libsvp64/svp64.h

index f6d16307b500c76c7c2b3f4b718b5f2dbeb87289..748796c597fc962e5ae5999aaa6a3aac859d73ae 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;