From 58124f45bbd494915aaa0120b3e548896977bd19 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Sun, 26 Jun 2022 09:20:41 +0100 Subject: [PATCH] whoops hack-use of DOUBLE2SINGLE in test_caller_transcendentals.py --- .../decoder/isa/test_caller_transcendentals.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) 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) -- 2.30.2