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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gdb-6.8/] [sim/] [testsuite/] [sim/] [sh64/] [compact/] [fdiv.cgs] - Blame information for rev 280

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 24 jeremybenn
# sh testcase for fdiv -*- Asm -*-
2
# mach: all
3
# as: -isa=shcompact
4
# ld: -m shelf32
5
 
6
        .include "compact/testutils.inc"
7
 
8
        start
9
        _clrpr
10
 
11
        # 1.0 / 0.0 should be INF
12
        # (and not crash the sim).
13
        fldi0 fr0
14
        fldi1 fr1
15
        fdiv fr0, fr1
16
 
17
        # 0.0 / 1.0 == 0.0.
18
        fldi0 fr0
19
        fldi1 fr1
20
        fdiv fr1, fr0
21
        fldi0 fr2
22
        fcmp/eq fr0, fr2
23
        bf wrong
24
 
25
        # 2.0 / 1.0 == 2.0.
26
        fldi1 fr1
27
        fldi1 fr2
28
        fadd fr2, fr2
29
        fdiv fr1, fr2
30
        # Load 2.0 into fr3.
31
        fldi1 fr3
32
        fadd fr3, fr3
33
        fcmp/eq fr2, fr3
34
        bf wrong
35
 
36
        # (1.0 / 2.0) + (1.0 / 2.0) == 1.0.
37
        fldi1 fr1
38
        fldi1 fr2
39
        fadd fr2, fr2
40
        fdiv fr2, fr1
41
        # fr1 should contain 0.5.
42
        fadd fr1, fr1
43
        # Load 1.0 into fr3.
44
        fldi1 fr3
45
        # Compare fr1 with fr3.
46
        fcmp/eq fr1, fr3
47
        bf wrong
48
 
49
        bra double
50
        nop
51
 
52
wrong:
53
        fail
54
 
55
double:
56
        # double test
57
        # (1.0 / 2.0) + (1.0 / 2.0) == 1.0.
58
        fldi1 fr1
59
        _s2d fr1, dr6
60
        fldi1 fr2
61
        fadd fr2, fr2
62
        _s2d fr2, dr8
63
        _setpr
64
        fdiv dr8, dr6
65
        # dr0 should contain 0.5.
66
        # double it, expect 1.0.
67
        fadd dr6, dr6
68
        _clrpr
69
foo:
70
        # Load 1.0 into dr4.
71
        fldi1 fr1
72
        _s2d fr1, dr10
73
        # Compare dr0 with dr10.
74
        _setpr
75
        fcmp/eq dr6, dr10
76
        bf wrong2
77
        _clrpr
78
 
79
okay:
80
        pass
81
 
82
wrong2:
83
        fail

powered by: WebSVN 2.1.0

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