From dc3aad3d5173f9be3c147db69798a0ed2c749a11 Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Thu, 1 Sep 2022 17:50:54 +0300 Subject: [PATCH] power_insn: support AA matching --- src/openpower/decoder/power_insn.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/openpower/decoder/power_insn.py b/src/openpower/decoder/power_insn.py index f0f476d7..1aee4737 100644 --- a/src/openpower/decoder/power_insn.py +++ b/src/openpower/decoder/power_insn.py @@ -864,11 +864,25 @@ class PPCDatabase: return exact_match(key[:-1], record) + def AA_match(key, record): + if not key.endswith("a"): + return False + + if record.intop not in {_MicrOp.OP_B, _MicrOp.OP_BC}: + return False + + if self.__mdwndb[key]["AA"] is None: + return False + + return (exact_match(key[:-1], record) or + LK_match(key[:-1], record)) + for (section, records) in self.__db.items(): for record in records: if (exact_match(key, record) or Rc_match(key, record) or - LK_match(key, record)): + LK_match(key, record) or + AA_match(key, record)): return (section, record) return (None, None) -- 2.30.2