From: Dmitry Selyutin Date: Fri, 9 Sep 2022 22:05:40 +0000 (+0300) Subject: power_insn: drop redundant dataclass incantations X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=dc285d1164128a250964ee0f3325192791f782b8;p=openpower-isa.git power_insn: drop redundant dataclass incantations --- diff --git a/src/openpower/decoder/power_insn.py b/src/openpower/decoder/power_insn.py index 565ec85c..bf6da71f 100644 --- a/src/openpower/decoder/power_insn.py +++ b/src/openpower/decoder/power_insn.py @@ -512,7 +512,6 @@ class Operand: raise NotImplementedError -@_dataclasses.dataclass(eq=True, frozen=True) class DynamicOperand(Operand): def disassemble(self, insn, record, verbosity=Verbosity.NORMAL, indent=""): @@ -530,11 +529,6 @@ class DynamicOperand(Operand): yield str(int(value)) -@_dataclasses.dataclass(eq=True, frozen=True) -class ImmediateOperand(DynamicOperand): - pass - - @_dataclasses.dataclass(eq=True, frozen=True) class StaticOperand(Operand): value: int @@ -555,7 +549,10 @@ class StaticOperand(Operand): yield str(int(value)) -@_dataclasses.dataclass(eq=True, frozen=True) +class ImmediateOperand(DynamicOperand): + pass + + class DynamicOperandReg(DynamicOperand): def spec(self, insn, record, merge): vector = False @@ -662,7 +659,6 @@ class DynamicOperandGPR(DynamicOperandGPRFPR): verbosity=verbosity, indent=indent) -@_dataclasses.dataclass(eq=True, frozen=True) class DynamicOperandFPR(DynamicOperandGPRFPR): def disassemble(self, insn, record, verbosity=Verbosity.NORMAL, indent=""): @@ -672,7 +668,6 @@ class DynamicOperandFPR(DynamicOperandGPRFPR): verbosity=verbosity, indent=indent) -@_dataclasses.dataclass(eq=True, frozen=True) class DynamicOperandTargetAddr(DynamicOperandReg): def disassemble(self, insn, record, field, verbosity=Verbosity.NORMAL, indent=""): @@ -692,7 +687,6 @@ class DynamicOperandTargetAddr(DynamicOperandReg): _SelectableInt(value=0b00, bits=2)))) -@_dataclasses.dataclass(eq=True, frozen=True) class DynamicOperandTargetAddrLI(DynamicOperandTargetAddr): def span(self, record): return record.fields["LI"]