From: Jacob Lifshay Date: Wed, 10 May 2023 02:16:37 +0000 (-0700) Subject: add self.FPSCR X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c66b956126e5f1343046b6bbf62c178ff95aed63;p=openpower-isa.git add self.FPSCR --- diff --git a/src/openpower/decoder/helpers.py b/src/openpower/decoder/helpers.py index 0bdd4f29..5f31b800 100644 --- a/src/openpower/decoder/helpers.py +++ b/src/openpower/decoder/helpers.py @@ -9,6 +9,7 @@ from operator import floordiv, mod from openpower.decoder.selectable_int import selectltu as ltu from openpower.decoder.selectable_int import selectgtu as gtu from openpower.decoder.selectable_int import check_extsign +from openpower.fpscr import FPSCRState from openpower.util import log import math @@ -848,6 +849,13 @@ class ISACallerHelper: def XLEN(self): return self.__XLEN + @property + def FPSCR(self): + # fallback for when not used through ISACaller + # needed for tests that use DOUBLE2SINGLE without using ISACaller + self.__dict__["FPSCR"] = retval = FPSCRState() + return retval + def EXTZXL(self, value, bits=None): if bits is None: bits = self.XLEN diff --git a/src/openpower/decoder/isa/caller.py b/src/openpower/decoder/isa/caller.py index 5e4382d2..22fcd8d0 100644 --- a/src/openpower/decoder/isa/caller.py +++ b/src/openpower/decoder/isa/caller.py @@ -1271,6 +1271,10 @@ class ISACaller(ISACallerHelper, ISAFPHelpers, StepLoop): def XLEN(self): return self.namespace["XLEN"] + @property + def FPSCR(self): + return self.fpscr + def call_trap(self, trap_addr, trap_bit): """calls TRAP and sets up NIA to the new execution location. next instruction will begin at trap_addr.