From f1008cb2a72ef941565764cea222a41906b82b7f Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Thu, 1 Sep 2022 15:32:06 +0300 Subject: [PATCH] power_fields: allow comparing references --- src/openpower/decoder/power_fields.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/openpower/decoder/power_fields.py b/src/openpower/decoder/power_fields.py index f41b89e3..f168cab8 100644 --- a/src/openpower/decoder/power_fields.py +++ b/src/openpower/decoder/power_fields.py @@ -49,10 +49,9 @@ class Reference: span = dict.fromkeys(self.__class__.span).keys() lhs = _selectconcat(*(self.storage[bit] for bit in span)) - if isinstance(other, Field): - bits = len(other.__class__) - value = int(other) - rhs = _SelectableInt(value=value, bits=bits) + if isinstance(other, Reference): + span = dict.fromkeys(other.__class__.span).keys() + rhs = _selectconcat(*(other.storage[bit] for bit in span)) elif isinstance(other, int): bits = len(self.__class__) if other.bit_length() > bits: -- 2.30.2