From: Dmitry Selyutin Date: Sun, 6 Nov 2022 09:29:55 +0000 (+0300) Subject: power_insn: cache operands X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a6406c044d2a1415b50a6fb3edfd87cde2dcaa38;p=openpower-isa.git power_insn: cache operands --- diff --git a/src/openpower/decoder/power_insn.py b/src/openpower/decoder/power_insn.py index af6fb80c..72aea8bd 100644 --- a/src/openpower/decoder/power_insn.py +++ b/src/openpower/decoder/power_insn.py @@ -691,21 +691,29 @@ class Record: def XO(self): return self.PO_XO[1] - @property + @cached_property def static_operands(self): + operands = [] (PO, XO) = self.PO_XO - yield POStaticOperand(record=self, - name="PO", value=(PO.value & PO.mask)) + + operands.append(POStaticOperand(record=self, + name="PO", value=(PO.value & PO.mask))) if XO is not None: - yield XOStaticOperand(record=self, - name="XO", value=(XO.value & XO.mask)) + operands.append(XOStaticOperand(record=self, + name="XO", value=(XO.value & XO.mask))) for (cls, kwargs) in self.mdwn.operands.static: - yield cls(record=self, **kwargs) + operands.append(cls(record=self, **kwargs)) - @property + return tuple(operands) + + @cached_property def dynamic_operands(self): + operands = [] + for (cls, kwargs) in self.mdwn.operands.dynamic: - yield cls(record=self, **kwargs) + operands.append(cls(record=self, **kwargs)) + + return tuple(operands) @property def opcodes(self):