From: Dmitry Selyutin Date: Thu, 1 Sep 2022 12:32:06 +0000 (+0300) Subject: power_fields: allow comparing references X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f1008cb2a72ef941565764cea222a41906b82b7f;p=openpower-isa.git power_fields: allow comparing references --- 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: