From fde7013e99732bc502c65a9fd233043e168797dc Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Sat, 8 Oct 2022 13:14:13 +0100 Subject: [PATCH] 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 --- src/openpower/decoder/power_insn.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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)) -- 2.30.2