From: Dmitry Selyutin Date: Thu, 7 Sep 2023 20:02:57 +0000 (+0300) Subject: libsvp64: support non-zero operands X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=69755aff4f33f447b2a2a05f4c252d1b609f8e45;p=openpower-isa.git libsvp64: support non-zero operands --- diff --git a/src/libsvp64/codegen.py b/src/libsvp64/codegen.py index 8508bdca..81008806 100644 --- a/src/libsvp64/codegen.py +++ b/src/libsvp64/codegen.py @@ -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, } diff --git a/src/libsvp64/svp64.h b/src/libsvp64/svp64.h index c45a7e54..d0907a08 100644 --- a/src/libsvp64/svp64.h +++ b/src/libsvp64/svp64.h @@ -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;