From: Luke Kenneth Casson Leighton Date: Sat, 8 Oct 2022 12:14:13 +0000 (+0100) Subject: separate out DQ and DS to separate custom_immediates X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fde7013e99732bc502c65a9fd233043e168797dc;p=openpower-isa.git separate out DQ and DS to separate custom_immediates D was unhappy about being a custom_field as an immediate. better: create SignedImmediate class deriving from ImmediateOperand --- diff --git a/src/openpower/decoder/power_insn.py b/src/openpower/decoder/power_insn.py index 8b68e02e..26fc7591 100644 --- a/src/openpower/decoder/power_insn.py +++ b/src/openpower/decoder/power_insn.py @@ -872,9 +872,7 @@ class Operands(tuple): "SVyd": NonZeroOperand, "SVzd": NonZeroOperand, "BD": SignedOperand, - "D": SignedOperand, - "DQ": EXTSOperandDQ, - "DS": EXTSOperandDS, + "D": SignedOperand, # TODO, make a SignedImmediate class? "SI": SignedOperand, "IB": SignedOperand, "LI": SignedOperand, @@ -882,6 +880,10 @@ class Operands(tuple): "SVD": SignedOperand, "SVDS": SignedOperand, } + custom_immediates = { + "DQ": EXTSOperandDQ, + "DS": EXTSOperandDS, + } operands = [] for operand in iterable: @@ -900,8 +902,8 @@ class Operands(tuple): immediate = None if immediate is not None: - if immediate in custom_fields: - dynamic_cls = custom_fields[immediate] + if immediate in custom_immediates: + dynamic_cls = custom_immediates[immediate] operands.append(dynamic_cls(name=immediate)) else: operands.append(ImmediateOperand(name=immediate))