power_insn: drop redundant dataclass incantations
authorDmitry Selyutin <ghostmansd@gmail.com>
Fri, 9 Sep 2022 22:05:40 +0000 (01:05 +0300)
committerDmitry Selyutin <ghostmansd@gmail.com>
Sat, 10 Sep 2022 05:35:38 +0000 (08:35 +0300)
src/openpower/decoder/power_insn.py

index 565ec85cc47904ccb7bc38c085185848253d212a..bf6da71fec7fc9fdde859ec343c841523b18da8c 100644 (file)
@@ -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"]