From a9d05f94529f82761a1372f85df4a02b69901234 Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Wed, 17 Aug 2022 23:43:04 +0300 Subject: [PATCH] selectable_int: allow further fields slicing --- src/openpower/decoder/selectable_int.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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): -- 2.30.2