From: Luke Kenneth Casson Leighton Date: Sun, 18 Sep 2022 14:52:41 +0000 (+0100) Subject: code-morph in power_insn.py - move table-search to separate area X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1c9112b21d6ddfb8b9e0f1f0e0e0b435f9e5d545;p=openpower-isa.git code-morph in power_insn.py - move table-search to separate area --- diff --git a/src/openpower/decoder/power_insn.py b/src/openpower/decoder/power_insn.py index 88810210..7b4b5237 100644 --- a/src/openpower/decoder/power_insn.py +++ b/src/openpower/decoder/power_insn.py @@ -1751,6 +1751,7 @@ class RM(BaseRM): def select(self, record, Rc): rm = self + table = None if record.svp64.mode is _SVMode.NORMAL: # concatenate mode 5-bit with Rc (LSB) then do a mask/map search # mode Rc mask Rc action(getattr) @@ -1762,13 +1763,8 @@ class RM(BaseRM): (0b110000, 0b110001, "prrc0"), # predicate, Rc=0 (0b110001, 0b110001, "prrc1"), # predicate, Rc=1 ] - rm = rm.normal search = (int(rm.mode) << 1) | Rc - for (val, mask, action) in table: - if (val&search) == (mask&search): - rm = getattr(rm, action) - break elif record.svp64.mode is _SVMode.LDST_IMM: # concatenate mode 5-bit with Rc (LSB) then do a mask/map search @@ -1785,10 +1781,6 @@ class RM(BaseRM): ] rm = rm.ldst_imm search = (int(rm.mode) << 1) | Rc - for (val, mask, action) in table: - if (val&search) == (mask&search): - rm = getattr(rm, action) - break elif record.svp64.mode is _SVMode.LDST_IDX: # concatenate mode 5-bit with Rc (LSB) then do a mask/map search @@ -1801,6 +1793,9 @@ class RM(BaseRM): ] rm = rm.ldst_idx search = (int(rm.mode) << 1) | Rc + + # look up in table + if table is not None: for (val, mask, action) in table: if (val&search) == (mask&search): rm = getattr(rm, action)