From: Jacob Lifshay Date: Fri, 5 May 2023 02:19:29 +0000 (-0700) Subject: add initial fmv/fcvt tests, though they're broken due to FPSCR being unimplemented X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=08c098d8599f3e17385ff256ed99392bc3f5154f;p=openpower-isa.git add initial fmv/fcvt tests, though they're broken due to FPSCR being unimplemented --- diff --git a/openpower/isatables/fields.text b/openpower/isatables/fields.text index 89ad7530..6560b147 100644 --- a/openpower/isatables/fields.text +++ b/openpower/isatables/fields.text @@ -557,7 +557,7 @@ FRB (16:20) Field used to specify an FPR to be used as a source. - Formats: A, MM, X, XFL, Z23, DCT + Formats: A, MM, X, XFL, XO, Z23, DCT FRBp (16:20) Field used to specify an even/odd pair of FPRs to be concatenated and used as a source. diff --git a/src/openpower/decoder/isa/test_caller_fmv_fcvt.py b/src/openpower/decoder/isa/test_caller_fmv_fcvt.py new file mode 100644 index 00000000..cf5730b7 --- /dev/null +++ b/src/openpower/decoder/isa/test_caller_fmv_fcvt.py @@ -0,0 +1,34 @@ +""" fmv/fcvt tests +""" + +import unittest + +from openpower.test.fmv_fcvt.fmv_fcvt import (FMvFCvtCases, + SVP64FMvFCvtCases) +from openpower.test.runner import TestRunnerBase + +# writing the test_caller invocation this way makes it work with pytest + + +class TestFMvFCvtCases(TestRunnerBase): + def __init__(self, test): + assert test == 'test' + super().__init__(FMvFCvtCases().test_data, fp=True) + + def test(self): + # dummy function to make unittest try to test this class + pass + + +class TestSVP64FMvFCvtCases(TestRunnerBase): + def __init__(self, test): + assert test == 'test' + super().__init__(SVP64FMvFCvtCases().test_data, fp=True) + + def test(self): + # dummy function to make unittest try to test this class + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/src/openpower/test/fmv_fcvt/__init__.py b/src/openpower/test/fmv_fcvt/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/src/openpower/test/fmv_fcvt/fmv_fcvt.py b/src/openpower/test/fmv_fcvt/fmv_fcvt.py new file mode 100644 index 00000000..674bd96e --- /dev/null +++ b/src/openpower/test/fmv_fcvt/fmv_fcvt.py @@ -0,0 +1,193 @@ +from openpower.test.common import TestAccumulatorBase, skip_case +from openpower.sv.trans.svp64 import SVP64Asm +from openpower.test.state import ExpectedState +from openpower.simulator.program import Program +from openpower.decoder.isa.caller import SVP64State +import struct +import math + + +class FMvFCvtCases(TestAccumulatorBase): + def js_toint32(self, inp, expected, test_title=""): + inp = float(inp) + inp_bits = struct.unpack("