use RVTEST_RV64UF macro for FPU tests
[riscv-tests.git] / isa / rv64uf / move.S
1 #*****************************************************************************
2 # move.S
3 #-----------------------------------------------------------------------------
4 #
5 # This test verifies that mxtf.[s,d], mftx.[s,d], mtfsr, mffsr,
6 # and fsgnj[x|n].[s|d] work properly.
7 #
8
9 #include "riscv_test.h"
10 #include "test_macros.h"
11
12 RVTEST_RV64UF
13 RVTEST_CODE_BEGIN
14
15 li a0, 1
16 mtfsr a0
17
18 TEST_CASE(2, a1, 1, li a0, 0x1234; mtfsr a1, a0)
19 TEST_CASE(3, a0, 0x34, mffsr a0)
20 TEST_CASE(4, a0, 0x34, mffsr a0)
21
22 TEST_CASE(5, a0, 0xFFFFFFFFBF812345, li a1, 0xFFFFFFFFBF812345; mxtf.s f0, a1; mftx.s a0, f0)
23 TEST_CASE(6, a0, 0x3FF02468A0000000, li a1, 0x3FF02468A0000000; mxtf.d f1, a1; mftx.d a0, f1)
24
25 TEST_CASE(7, a0, 0xFFFFFFFFBF812345, li a1, 0xFFFFFFFFBF812345; mxtf.s f0, a1; fsgnj.s f1, f0, f0; mftx.s a0, f1)
26 TEST_CASE(8, a0, 0x000000004BA98765, li a1, 0xFFFFFFFFCBA98765; mxtf.s f0, a1; fsgnjx.s f1, f0, f0; mftx.s a0, f1)
27 TEST_CASE(9, a0, 0x000000005EADBEEF, li a1, 0xFFFFFFFFDEADBEEF; mxtf.s f0, a1; fsgnjn.s f1, f0, f0; mftx.s a0, f1)
28 TEST_CASE(10, a0, 0xBFF02468A0001000, li a1, 0x3FF02468A0001000; li a2, -1; mxtf.d f1, a1; mxtf.d f2, a2; fsgnj.d f0, f1, f2; mftx.d a0, f0)
29
30 TEST_PASSFAIL
31
32 RVTEST_CODE_END
33
34 .data
35 RVTEST_DATA_BEGIN
36
37 TEST_DATA
38
39 RVTEST_DATA_END