correctly set SR_EA bit for all vector physical tests
[riscv-tests.git] / isa / rv64uv / fma.S
1 #*****************************************************************************
2 # fma.S
3 #-----------------------------------------------------------------------------
4 #
5 # Test fma instruction in a vf block.
6 #
7
8 #include "riscv_test.h"
9 #include "test_macros.h"
10
11 RVTEST_RV64UV
12 RVTEST_CODE_BEGIN
13
14 vsetcfg 3,2
15 li a3,2048
16 vsetvl a3,a3
17
18 la a4,src
19 fld f0,0(a4)
20 fld f1,8(a4)
21 fmv.x.d s0,f0
22 fmv.x.d s1,f1
23 vmsv vx1,s0
24 vmsv vx2,s1
25 lui a0,%hi(vtcode)
26 vf %lo(vtcode)(a0)
27
28 li a7,0
29 li a6,400
30 wait:
31 addi a7,a7,1
32 bne a7,a6,wait
33
34 fadd.d f0,f0,f1
35 fmv.x.d s2,f0
36
37 la a5,dest
38 vfsd vf0,a5
39 fence
40
41 la s3,result
42 ld s4,0(s3)
43 li x28,2
44 bne s2,s4,fail
45
46 li a2,0
47 loop:
48 ld a0,0(a5)
49 addi x28,a2,3
50 bne a0,s4,fail
51 addi a5,a5,8
52 addi a2,a2,1
53 bne a2,a3,loop
54 j pass
55
56 vtcode:
57 fmv.d.x f0,x1
58 fmv.d.x f1,x2
59 fadd.d f0,f0,f1
60 stop
61
62 TEST_PASSFAIL
63
64 RVTEST_CODE_END
65
66 .data
67 RVTEST_DATA_BEGIN
68
69 TEST_DATA
70
71 src:
72 .double 1.0
73 .double 2.0
74 result:
75 .double 3.0
76 dest:
77 .skip 16384
78
79 RVTEST_DATA_END