From: Dmitry Selyutin Date: Wed, 17 Aug 2022 20:43:04 +0000 (+0300) Subject: selectable_int: allow further fields slicing X-Git-Tag: sv_maxu_works-initial~40 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a9d05f94529f82761a1372f85df4a02b69901234;p=openpower-isa.git selectable_int: allow further fields slicing --- diff --git a/src/openpower/decoder/selectable_int.py b/src/openpower/decoder/selectable_int.py index d666bd9b..7e7eb97d 100644 --- a/src/openpower/decoder/selectable_int.py +++ b/src/openpower/decoder/selectable_int.py @@ -74,12 +74,15 @@ class FieldSelectableInt: log("getitem", key, self.br) if isinstance(key, SelectableInt): key = key.value + if isinstance(key, int): key = self.br[key] # don't do POWER 1.3.4 bit-inversion return self.si[key] - if isinstance(key, slice): + elif isinstance(key, slice): key = self.br[key] return selectconcat(*[self.si[x] for x in key]) + elif isinstance(key, (tuple, list, range)): + return FieldSelectableInt(si=self, br=key) def __setitem__(self, key, value): if isinstance(key, SelectableInt):