From: Luke Kenneth Casson Leighton Date: Fri, 23 Apr 2021 16:10:21 +0000 (+0100) Subject: move mask_extend function to utils X-Git-Tag: 0.0.1~21 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=28788ded31f7b662ec3cdca3051af1aa757a5a93;p=openpower-isa.git move mask_extend function to utils --- diff --git a/src/openpower/test/common.py b/src/openpower/test/common.py index 3bdb7d49..c62a803b 100644 --- a/src/openpower/test/common.py +++ b/src/openpower/test/common.py @@ -10,9 +10,6 @@ import types from openpower.decoder.power_enums import XER_bits, CryIn, spr_dict from openpower.util import fast_reg_to_spr, slow_reg_to_spr # HACK! from openpower.consts import XERRegsEnum -from openpower.test.common import (mask_extend, SkipCase, _id, skip_case, - skip_case_if, TestAccumulatorBase, - TestCase) # TODO: make this a util routine (somewhere) diff --git a/src/openpower/util.py b/src/openpower/util.py index e4f2fe04..71d60b73 100644 --- a/src/openpower/util.py +++ b/src/openpower/util.py @@ -39,3 +39,15 @@ def spr_to_slow_reg(spr_num): for i, x in enumerate(SPR): if spr_num == x.value: return i + + +# TODO: make this a util routine (somewhere) +def mask_extend(x, nbits, repeat): + res = 0 + extended = (1<