From 679408fbd0d5c12c5cb71dfcc3f860574c2c0172 Mon Sep 17 00:00:00 2001 From: Jacob Lifshay Date: Thu, 20 Apr 2023 20:13:57 -0700 Subject: [PATCH] add EXTZ since it's in PowerISA v3.1B (see lbz for an example) --- src/openpower/decoder/helpers.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/openpower/decoder/helpers.py b/src/openpower/decoder/helpers.py index c009431d..76dad8a2 100644 --- a/src/openpower/decoder/helpers.py +++ b/src/openpower/decoder/helpers.py @@ -46,6 +46,14 @@ def EXTS(value): return SelectableInt(exts(value.value, value.bits) & ((1 << 256)-1), 256) +def EXTZ(value): + """ zero extend to 256 bits + """ + if isinstance(value, SelectableInt): + value = value.value + return SelectableInt(value & ((1 << 256) - 1), 256) + + def EXTS64(value): """ extends sign bit out from current MSB to 64 bits """ -- 2.30.2