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

Subversion Repositories fwrisc

[/] [fwrisc/] [trunk/] [ve/] [fwrisc/] [tests/] [riscv-compliance/] [riscv-test-suite/] [rv32ud/] [rv64ud/] [structural.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
# structural.S
5
#-----------------------------------------------------------------------------
6
#
7
# This test verifies that the FPU correctly obviates structural hazards on its
8
# writeback port (e.g. fadd followed by fsgnj)
9
#
10
 
11
#include "riscv_test.h"
12
#include "test_macros.h"
13
 
14
RVTEST_RV64UF
15
RVTEST_CODE_BEGIN
16
 
17
li x25, 1
18
 
19
li x2, 0x3FF0000000000000
20
li x1, 0x3F800000
21
 
22
#define TEST(nops, errcode)     \
23
  fmv.d.x  f4, x0    ;\
24
  fmv.s.x  f3, x0    ;\
25
  fmv.d.x  f2, x2    ;\
26
  fmv.s.x  f1, x1    ;\
27
  j 1f ;\
28
  .align 5        ;\
29
1:fmul.d  f4, f2, f2  ;\
30
  nops          ;\
31
  fsgnj.s f3, f1, f1 ;\
32
  fmv.x.d  x4, f4    ;\
33
  fmv.x.s  x5, f3    ;\
34
  beq     x1, x5, 2f  ;\
35
  RVTEST_FAIL ;\
36
2:beq     x2, x4, 2f  ;\
37
  RVTEST_FAIL; \
38
2:fmv.d.x  f2, zero    ;\
39
  fmv.s.x  f1, zero    ;\
40
 
41
TEST(;,2)
42
TEST(nop,4)
43
TEST(nop;nop,6)
44
TEST(nop;nop;nop,8)
45
TEST(nop;nop;nop;nop,10)
46
TEST(nop;nop;nop;nop;nop,12)
47
TEST(nop;nop;nop;nop;nop;nop,14)
48
 
49
RVTEST_PASS
50
 
51
RVTEST_CODE_END
52
 
53
  .data
54
RVTEST_DATA_BEGIN
55
 
56
  TEST_DATA
57
 
58
RVTEST_DATA_END

powered by: WebSVN 2.1.0

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