From 161cdc781f31462edd9f0c42ac5e6c4b1b5d04be Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Tue, 20 Sep 2022 13:23:44 +0300 Subject: [PATCH] power_insn: custom sz handling for branches --- src/openpower/decoder/power_insn.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/openpower/decoder/power_insn.py b/src/openpower/decoder/power_insn.py index 98fd44c9..600d8fd4 100644 --- a/src/openpower/decoder/power_insn.py +++ b/src/openpower/decoder/power_insn.py @@ -1723,7 +1723,7 @@ class CROpRM(CROpBaseRM): # ******************** # Branches mode # https://libre-soc.org/openpower/sv/branches/ -class BranchBaseRM(SZBaseRM, BaseRM): +class BranchBaseRM(BaseRM): ALL: BaseRM[4] SNZ: BaseRM[5] SL: BaseRM[17] @@ -1736,8 +1736,20 @@ class BranchBaseRM(SZBaseRM, BaseRM): def specifiers(self, record): if self.ALL: yield "all" + + # /sz + # branch.sz=1 + # branch.snz=0 + # /snz + # branch.sz=1 + # branch.snz=1 if self.SNZ: + if not self.sz: + raise ValueError(self.sz) yield "snz" + elif self.sz: + yield "sz" + if self.SL: yield "sl" if self.SLu: -- 2.30.2