aboutsummaryrefslogtreecommitdiff
path: root/isa/rv64uv/vvadd_fd.S
blob: a9961afb7c0459f4424b54ffda10823260fc3409 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#*****************************************************************************
# vvadd_fd.S
#-----------------------------------------------------------------------------
#
# Test vvadd fd.
#

#include "riscv_test.h"
#include "test_macros.h"

RVTEST_RV64UV
RVTEST_CODE_BEGIN

  vsetcfg 32,32
  li a3,4
  vsetvl a3,a3

  la a3,src1
  la a4,src2
  vfld vf2,a3
  vfld vf3,a4
  lui a0,%hi(vtcode)
  vf %lo(vtcode)(a0)
  la a5,dest
  vfsd vf2,a5
  fence
  la a6,result
  ld a1,0(a5)
  ld a2,0(a6)
  li TESTNUM,2
  bne a1,a2,fail
  ld a1,8(a5)
  li TESTNUM,3
  bne a1,a2,fail
  ld a1,16(a5)
  li TESTNUM,4
  bne a1,a2,fail
  ld a1,24(a5)
  li TESTNUM,5
  bne a1,a2,fail
  j pass

vtcode:
  fadd.d f2,f2,f3
  stop

  TEST_PASSFAIL

RVTEST_CODE_END

  .data
RVTEST_DATA_BEGIN

  TEST_DATA

src1:
  .double 0.1
  .double 0.2
  .double 0.3
  .double 0.4
src2:
  .double 0.4
  .double 0.3
  .double 0.2
  .double 0.1
dest:
  .dword 0xdeadbeefcafebabe
  .dword 0xdeadbeefcafebabe
  .dword 0xdeadbeefcafebabe
  .dword 0xdeadbeefcafebabe
result:
  .double 0.5
  .double 0.5
  .double 0.5
  .double 0.5

RVTEST_DATA_END