OpenCores
URL https://opencores.org/ocsvn/fwrisc/fwrisc/trunk

Subversion Repositories fwrisc

[/] [fwrisc/] [trunk/] [ve/] [fwrisc/] [tests/] [riscv-compliance/] [riscv-test-suite/] [rv32uf/] [rv64uf/] [move.S] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 mballance
# See LICENSE for license details.
2
 
3
#*****************************************************************************
4
# move.S
5
#-----------------------------------------------------------------------------
6
#
7
# This test verifies that the fmv.s.x, fmv.x.s, and fsgnj[x|n].d instructions
8
# and the fcsr work properly.
9
#
10
 
11
#include "riscv_test.h"
12
#include "compliance_test.h"
13
#include "compliance_io.h"
14
#include "aw_test_macros.h"
15
 
16
RVTEST_RV64UF
17
RVTEST_CODE_BEGIN
18
 
19
  TEST_CASE(2, a1, 1, csrwi fcsr, 1; li a0, 0x1234; fssr a1, a0)
20
  TEST_CASE(3, a0, 0x34, frsr a0)
21
  TEST_CASE(4, a0, 0x14, frflags a0)
22
  TEST_CASE(5, a0, 0x01, csrrwi a0, frm, 2)
23
  TEST_CASE(6, a0, 0x54, frsr a0)
24
  TEST_CASE(7, a0, 0x14, csrrci a0, fflags, 4)
25
  TEST_CASE(8, a0, 0x50, frsr a0)
26
 
27
#define TEST_FSGNJS(n, insn, new_sign, rs1_sign, rs2_sign) \
28
  TEST_CASE(n, a0, 0x12345678 | (-(new_sign) << 31), \
29
    li a1, ((rs1_sign) << 31) | 0x12345678; \
30
    li a2, -(rs2_sign); \
31
    fmv.s.x f1, a1; \
32
    fmv.s.x f2, a2; \
33
    insn f0, f1, f2; \
34
    fmv.x.s a0, f0)
35
 
36
  TEST_FSGNJS(10, fsgnj.s, 0, 0, 0)
37
  TEST_FSGNJS(11, fsgnj.s, 1, 0, 1)
38
  TEST_FSGNJS(12, fsgnj.s, 0, 1, 0)
39
  TEST_FSGNJS(13, fsgnj.s, 1, 1, 1)
40
 
41
  TEST_FSGNJS(20, fsgnjn.s, 1, 0, 0)
42
  TEST_FSGNJS(21, fsgnjn.s, 0, 0, 1)
43
  TEST_FSGNJS(22, fsgnjn.s, 1, 1, 0)
44
  TEST_FSGNJS(23, fsgnjn.s, 0, 1, 1)
45
 
46
  TEST_FSGNJS(30, fsgnjx.s, 0, 0, 0)
47
  TEST_FSGNJS(31, fsgnjx.s, 1, 0, 1)
48
  TEST_FSGNJS(32, fsgnjx.s, 1, 1, 0)
49
  TEST_FSGNJS(33, fsgnjx.s, 0, 1, 1)
50
 
51
  TEST_PASSFAIL
52
 
53
RVTEST_CODE_END
54
 
55
  .data
56
RV_COMPLIANCE_DATA_BEGIN
57
test_res:
58
    .fill 40, 4, -1
59
RV_COMPLIANCE_DATA_END
60
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.