From 3eccec7c6a475b728bf8a370c53d9c942fc1999a Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Wed, 23 Jun 2021 16:33:32 +0100 Subject: [PATCH] add VL and srcstep to ISACaller namespace --- src/openpower/decoder/helpers.py | 2 +- src/openpower/decoder/isa/caller.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/openpower/decoder/helpers.py b/src/openpower/decoder/helpers.py index dfbd0d1f..b8ec70b7 100644 --- a/src/openpower/decoder/helpers.py +++ b/src/openpower/decoder/helpers.py @@ -82,7 +82,7 @@ def SHL64(value, bits, wordlen=64): bits = bits.value mask = (1 << wordlen) - 1 bits = bits & (wordlen - 1) - return (value << bits) & mask + return SelectableInt((value << bits) & mask, 64) def ROTL64(value, bits): diff --git a/src/openpower/decoder/isa/caller.py b/src/openpower/decoder/isa/caller.py index e3ecbed6..141b6889 100644 --- a/src/openpower/decoder/isa/caller.py +++ b/src/openpower/decoder/isa/caller.py @@ -705,6 +705,12 @@ class ISACaller: self.namespace['CA'] = self.spr['XER'][XER_bits['CA']].value self.namespace['CA32'] = self.spr['XER'][XER_bits['CA32']].value + # add some SVSTATE convenience variables + vl = self.svstate.vl.asint(msb0=True) + srcstep = self.svstate.srcstep.asint(msb0=True) + self.namespace['VL'] = vl + self.namespace['srcstep'] = srcstep + def handle_carry_(self, inputs, outputs, already_done): inv_a = yield self.dec2.e.do.invert_in if inv_a: @@ -1392,6 +1398,7 @@ class ISACaller: self.namespace['NIA'] = self.pc.NIA self.namespace['SVSTATE'] = self.svstate.spr + def inject(): """Decorator factory. -- 2.30.2