From 28788ded31f7b662ec3cdca3051af1aa757a5a93 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Fri, 23 Apr 2021 17:10:21 +0100 Subject: [PATCH] move mask_extend function to utils --- src/openpower/test/common.py | 3 --- src/openpower/util.py | 12 ++++++++++++ 2 files changed, 12 insertions(+), 3 deletions(-) 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<