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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gdb-6.8/] [sim/] [testsuite/] [sim/] [sh64/] [compact/] [fsqrt.cgs] - Blame information for rev 816

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

Line No. Rev Author Line
1 24 jeremybenn
# sh testcase for fsqrt -*- Asm -*-
2
# mach: all
3
# as: -isa=shcompact
4
# ld: -m shelf32
5
 
6
        .include "compact/testutils.inc"
7
 
8
        start
9
 
10
        # sqrt(0.0) = 0.0.
11
        fldi0 fr0
12
        fsqrt fr0
13
        fldi0 fr1
14
        fcmp/eq fr0, fr1
15
        bf wrong
16
 
17
        # sqrt(1.0) = 1.0.
18
        fldi1 fr0
19
        fsqrt fr0
20
        fldi1 fr1
21
        fcmp/eq fr0, fr1
22
        bf wrong
23
 
24
        # sqrt(4.0) = 2.0
25
        fldi1 fr0
26
        # Double it.
27
        fadd fr0, fr0
28
        # Double it again.
29
        fadd fr0, fr0
30
        fsqrt fr0
31
        fldi1 fr1
32
        # Double it.
33
        fadd fr1, fr1
34
        fcmp/eq fr0, fr1
35
        bf wrong
36
 
37
        bra double
38
        nop
39
 
40
wrong:
41
        fail
42
 
43
double:
44
        # sqrt(0.0) = 0.0.
45
        fldi0 fr0
46
        _s2d fr0, dr0
47
        _setpr
48
        fsqrt dr0
49
        _clrpr
50
        fldi0 fr2
51
        _s2d fr2, dr2
52
        _setpr
53
        fcmp/eq dr0, dr2
54
        bf wrong2
55
        _clrpr
56
 
57
        # sqrt(1.0) = 1.0.
58
        fldi1 fr0
59
        _s2d fr0, dr0
60
        _setpr
61
        fsqrt dr0
62
        _clrpr
63
        fldi1 fr2
64
        _s2d fr2, dr2
65
        _setpr
66
        fcmp/eq fr0, fr2
67
        bf wrong2
68
        _clrpr
69
 
70
        # sqrt(4.0) = 2.0.
71
        fldi1 fr0
72
        # Double it.
73
        fadd fr0, fr0
74
        # Double it again.
75
        fadd fr0, fr0
76
        _s2d fr0, dr0
77
        _setpr
78
        fsqrt dr0
79
        _clrpr
80
        fldi1 fr2
81
        # Double it.
82
        fadd fr2, fr2
83
        _s2d fr2, dr2
84
        _setpr
85
        fcmp/eq fr0, fr2
86
        bf wrong2
87
        _clrpr
88
 
89
okay:
90
        pass
91
 
92
wrong2:
93
        fail

powered by: WebSVN 2.1.0

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