add VL and srcstep to ISACaller namespace
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 23 Jun 2021 15:33:32 +0000 (16:33 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 23 Jun 2021 15:33:32 +0000 (16:33 +0100)
src/openpower/decoder/helpers.py
src/openpower/decoder/isa/caller.py

index dfbd0d1f9d1215eb2a6f8283f4ef75d1e10d6886..b8ec70b782a110f5970843e553ff1d228d288a6d 100644 (file)
@@ -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):
index e3ecbed672eb128d64567b5f9b6e207b2871f6fa..141b68894eeec915df64954f5e76f7f26ca19f54 100644 (file)
@@ -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.