From: Dmitry Selyutin Date: Tue, 15 Nov 2022 19:41:13 +0000 (+0300) Subject: power_enums: support predicate type property X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5312817d79b7483f31cfc279092a191113022450;p=openpower-isa.git power_enums: support predicate type property --- 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, ))