From: Dmitry Selyutin Date: Mon, 19 Sep 2022 22:09:45 +0000 (+0300) Subject: power_insn: support common branch disassembly X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=051b8e6688cf6d78ea283de1a20bdf1983ab17e4;p=openpower-isa.git power_insn: support common branch disassembly --- diff --git a/src/openpower/decoder/power_insn.py b/src/openpower/decoder/power_insn.py index 5fc8f00c..073d4d77 100644 --- a/src/openpower/decoder/power_insn.py +++ b/src/openpower/decoder/power_insn.py @@ -1733,6 +1733,20 @@ class BranchBaseRM(SZBaseRM, BaseRM): CTR: BaseRM[19] VLS: BaseRM[20] + def specifiers(self, record): + if self.ALL: + yield "all" + if self.SNZ: + yield "snz" + if self.SL: + yield "sl" + if self.SLu: + yield "slu" + if self.LRu: + yield "lru" + + yield from super().specifiers(record=record) + class BranchSimpleRM(BranchBaseRM): """branch: simple mode""" diff --git a/src/openpower/sv/trans/test_pysvp64dis.py b/src/openpower/sv/trans/test_pysvp64dis.py index f3f014f8..53d854ca 100644 --- a/src/openpower/sv/trans/test_pysvp64dis.py +++ b/src/openpower/sv/trans/test_pysvp64dis.py @@ -255,6 +255,15 @@ class SVSTATETestCase(unittest.TestCase): ] self._do_tst(expected) + def test_16_bc(self): + expected = [ + "sv.bc/all 12,*1,0xc", + "sv.bc/snz 12,*1,0xc", + "sv.bc/all/sl/slu 12,*1,0xc", + "sv.bc/all/snz/sl/slu/lru 12,*1,0xc", + ] + self._do_tst(expected) + if __name__ == "__main__": unittest.main()