From: Luke Kenneth Casson Leighton Date: Sun, 26 Jun 2022 08:20:41 +0000 (+0100) Subject: whoops hack-use of DOUBLE2SINGLE in test_caller_transcendentals.py X-Git-Tag: sv_maxu_works-initial~324 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=58124f45bbd494915aaa0120b3e548896977bd19;p=openpower-isa.git whoops hack-use of DOUBLE2SINGLE in test_caller_transcendentals.py --- diff --git a/src/openpower/decoder/isa/test_caller_transcendentals.py b/src/openpower/decoder/isa/test_caller_transcendentals.py index fbc5bfde..f5536f06 100644 --- a/src/openpower/decoder/isa/test_caller_transcendentals.py +++ b/src/openpower/decoder/isa/test_caller_transcendentals.py @@ -14,7 +14,12 @@ from openpower.decoder.isa.test_caller import Register, run_tst from copy import deepcopy from openpower.sv.trans.svp64 import SVP64Asm from openpower.decoder.helpers import fp64toselectable -from openpower.decoder.isafunctions.double2single import DOUBLE2SINGLE +from openpower.decoder.isafunctions.double2single import ISACallerFnHelper + +# really bad hack. need to access the DOUBLE2SINGLE function auto-generated +# from pseudo-code. +fph = ISACallerFnHelper(XLEN=64) + import math @@ -44,8 +49,8 @@ class FPTranscendentalsTestCase(FHDLTestCase): t = math.sin(a) u = math.cos(a) a1 = fp64toselectable(a) # convert to Power single - t = DOUBLE2SINGLE(fp64toselectable(t)) # convert to Power single - u = DOUBLE2SINGLE(fp64toselectable(u)) # convert to Power single + t = fph.DOUBLE2SINGLE(fp64toselectable(t)) # to Power single + u = fph.DOUBLE2SINGLE(fp64toselectable(u)) # to Power single with self.subTest(): sim = self.run_tst_program(program, initial_fprs=fprs) @@ -86,10 +91,10 @@ class FPTranscendentalsTestCase(FHDLTestCase): for i in range(7, 8): a = math.pi * ((i+0.5) / 4.0) gprs[1] = i - a1 = DOUBLE2SINGLE(fp64toselectable(a)) # to Power single + a1 = fph.DOUBLE2SINGLE(fp64toselectable(a)) # to Power single a = float(a1) u = math.cos(a) - u = DOUBLE2SINGLE(fp64toselectable(u)) # convert to Power single + u = fph.DOUBLE2SINGLE(fp64toselectable(u)) # to Power single with self.subTest(): sim = self.run_tst_program(program, gprs, initial_fprs=fprs)