From 5312817d79b7483f31cfc279092a191113022450 Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Tue, 15 Nov 2022 22:41:13 +0300 Subject: [PATCH] power_enums: support predicate type property --- src/openpower/decoder/power_enums.py | 4 ++++ src/openpower/decoder/power_insn.py | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/openpower/decoder/power_enums.py b/src/openpower/decoder/power_enums.py index cd05891b..3311b109 100644 --- a/src/openpower/decoder/power_enums.py +++ b/src/openpower/decoder/power_enums.py @@ -393,6 +393,10 @@ class SVP64Predicate(Enum): def __str__(self): return self.value[0] + @property + def type(self): + return SVP64PredicateType(self) + @property def inv(self): return self.value[1] diff --git a/src/openpower/decoder/power_insn.py b/src/openpower/decoder/power_insn.py index 6b94719b..7e653123 100644 --- a/src/openpower/decoder/power_insn.py +++ b/src/openpower/decoder/power_insn.py @@ -2529,7 +2529,7 @@ class SpecifierFFPR(SpecifierPredicate): def match(cls, desc, record, mode): return super().match(desc=desc, record=record, mode_match=lambda mode_arg: mode_arg == mode, - pred_match=lambda pred_arg: _SVP64PredicateType(pred_arg) in ( + pred_match=lambda pred_arg: pred_arg.type in ( _SVP64PredicateType.CR, _SVP64PredicateType.RC1, )) @@ -2597,7 +2597,7 @@ class SpecifierMask(SpecifierPredicate): def match(cls, desc, record, mode): return super().match(desc=desc, record=record, mode_match=lambda mode_arg: mode_arg == mode, - pred_match=lambda pred_arg: _SVP64PredicateType(pred_arg) in ( + pred_match=lambda pred_arg: pred_arg.type in ( _SVP64PredicateType.INTEGER, _SVP64PredicateType.CR, )) -- 2.30.2