aboutsummaryrefslogtreecommitdiff
path: root/isa/rv64uf/fcvt_w.S
blob: 5492a09f4558181f2232ef09c7f3976170f9e681 (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
78
79
80
81
82
83
#*****************************************************************************
# fcvt_w.S
#-----------------------------------------------------------------------------
#
# Test fcvt{wu|w|lu|l}.{s|d} instructions.
#

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

RVTEST_RV64UF
RVTEST_CODE_BEGIN

  #-------------------------------------------------------------
  # Arithmetic tests
  #-------------------------------------------------------------

  TEST_FP_INT_OP_S( 2,  fcvt.w.s, -1, -1.1, rtz);
  TEST_FP_INT_OP_S( 3,  fcvt.w.s, -1, -1.0, rtz);
  TEST_FP_INT_OP_S( 4,  fcvt.w.s,  0, -0.9, rtz);
  TEST_FP_INT_OP_S( 5,  fcvt.w.s,  0,  0.9, rtz);
  TEST_FP_INT_OP_S( 6,  fcvt.w.s,  1,  1.0, rtz);
  TEST_FP_INT_OP_S( 7,  fcvt.w.s,  1,  1.1, rtz);

  TEST_FP_INT_OP_S(12, fcvt.wu.s, -1, -3.0, rtz); # invalid
  TEST_FP_INT_OP_S(13, fcvt.wu.s, -1, -1.0, rtz); # invalid
  TEST_FP_INT_OP_S(14, fcvt.wu.s,  0, -0.9, rtz);
  TEST_FP_INT_OP_S(15, fcvt.wu.s,  0,  0.9, rtz);
  TEST_FP_INT_OP_S(16, fcvt.wu.s,  1,  1.0, rtz);
  TEST_FP_INT_OP_S(17, fcvt.wu.s,  1,  1.1, rtz);

  TEST_FP_INT_OP_S(22,  fcvt.l.s, -1, -1.1, rtz);
  TEST_FP_INT_OP_S(23,  fcvt.l.s, -1, -1.0, rtz);
  TEST_FP_INT_OP_S(24,  fcvt.l.s,  0, -0.9, rtz);
  TEST_FP_INT_OP_S(25,  fcvt.l.s,  0,  0.9, rtz);
  TEST_FP_INT_OP_S(26,  fcvt.l.s,  1,  1.0, rtz);
  TEST_FP_INT_OP_S(27,  fcvt.l.s,  1,  1.1, rtz);

  TEST_FP_INT_OP_S(32, fcvt.lu.s, -1, -3.0, rtz); # invalid
  TEST_FP_INT_OP_S(33, fcvt.lu.s, -1, -1.0, rtz); # invalid
  TEST_FP_INT_OP_S(34, fcvt.lu.s,  0, -0.9, rtz);
  TEST_FP_INT_OP_S(35, fcvt.lu.s,  0,  0.9, rtz);
  TEST_FP_INT_OP_S(36, fcvt.lu.s,  1,  1.0, rtz);
  TEST_FP_INT_OP_S(37, fcvt.lu.s,  1,  1.1, rtz);

  TEST_FP_INT_OP_D(42,  fcvt.w.d, -1, -1.1, rtz);
  TEST_FP_INT_OP_D(43,  fcvt.w.d, -1, -1.0, rtz);
  TEST_FP_INT_OP_D(44,  fcvt.w.d,  0, -0.9, rtz);
  TEST_FP_INT_OP_D(45,  fcvt.w.d,  0,  0.9, rtz);
  TEST_FP_INT_OP_D(46,  fcvt.w.d,  1,  1.0, rtz);
  TEST_FP_INT_OP_D(47,  fcvt.w.d,  1,  1.1, rtz);

  TEST_FP_INT_OP_D(52, fcvt.wu.d, -1, -3.0, rtz); # invalid
  TEST_FP_INT_OP_D(53, fcvt.wu.d, -1, -1.0, rtz); # invalid
  TEST_FP_INT_OP_D(54, fcvt.wu.d,  0, -0.9, rtz);
  TEST_FP_INT_OP_D(55, fcvt.wu.d,  0,  0.9, rtz);
  TEST_FP_INT_OP_D(56, fcvt.wu.d,  1,  1.0, rtz);
  TEST_FP_INT_OP_D(57, fcvt.wu.d,  1,  1.1, rtz);

  TEST_FP_INT_OP_D(62,  fcvt.l.d, -1, -1.1, rtz);
  TEST_FP_INT_OP_D(63,  fcvt.l.d, -1, -1.0, rtz);
  TEST_FP_INT_OP_D(64,  fcvt.l.d,  0, -0.9, rtz);
  TEST_FP_INT_OP_D(65,  fcvt.l.d,  0,  0.9, rtz);
  TEST_FP_INT_OP_D(66,  fcvt.l.d,  1,  1.0, rtz);
  TEST_FP_INT_OP_D(67,  fcvt.l.d,  1,  1.1, rtz);

  TEST_FP_INT_OP_D(72, fcvt.lu.d, -1, -3.0, rtz); # invalid
  TEST_FP_INT_OP_D(73, fcvt.lu.d, -1, -1.0, rtz); # invalid
  TEST_FP_INT_OP_D(74, fcvt.lu.d,  0, -0.9, rtz);
  TEST_FP_INT_OP_D(75, fcvt.lu.d,  0,  0.9, rtz);
  TEST_FP_INT_OP_D(76, fcvt.lu.d,  1,  1.0, rtz);
  TEST_FP_INT_OP_D(77, fcvt.lu.d,  1,  1.1, rtz);

  TEST_PASSFAIL

RVTEST_CODE_END

  .data
RVTEST_DATA_BEGIN

  TEST_DATA

RVTEST_DATA_END