From 8a144619f8c4d6b86fb9a31c6582de251ed79aa5 Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Wed, 17 Aug 2022 21:43:58 +0300 Subject: [PATCH] power_insn: fix sv_extra algorithm --- src/openpower/decoder/power_insn.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/openpower/decoder/power_insn.py b/src/openpower/decoder/power_insn.py index cdd7ef98..e0af08d2 100644 --- a/src/openpower/decoder/power_insn.py +++ b/src/openpower/decoder/power_insn.py @@ -480,6 +480,9 @@ class Instruction: sel = getattr(self.svp64, key) if sel is _CRInSel.BA_BB: return _SVExtra.Idx_1_2 + reg = _SVExtraReg(sel) + if reg is _SVExtraReg.NONE: + return _SVExtra.NONE extra_map = { _SVExtraRegType.SRC: {}, @@ -490,7 +493,7 @@ class Instruction: extra_map[entry.regtype][entry.reg] = Instruction.__EXTRA[index] for regtype in (_SVExtraRegType.SRC, _SVExtraRegType.DST): - extra = extra_map[regtype][sel] + extra = extra_map[regtype].get(reg, _SVExtra.NONE) if extra is not _SVExtra.NONE: return extra -- 2.30.2