URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Subversion Repositories openrisc_2011-10-31
[/] [openrisc/] [tags/] [gnu-src/] [gdb-7.2/] [gdb-7.2-or32-1.0rc1/] [sim/] [testsuite/] [sim/] [sh64/] [compact/] [fabs.cgs] - Rev 341
Compare with Previous | Blame | View Log
# sh testcase for fabs -*- Asm -*-
# mach: all
# as: -isa=shcompact
# ld: -m shelf32
.include "compact/testutils.inc"
start
_clrpr
# fabs(0.0) = 0.0.
fldi0 fr0
fabs fr0
fldi0 fr1
fcmp/eq fr0, fr1
bf wrong
# fabs(1.0) = 1.0.
fldi1 fr0
fabs fr0
fldi1 fr1
fcmp/eq fr0, fr1
bf wrong
# fabs(-1.0) = 1.0.
fldi1 fr0
fneg fr0
fabs fr0
fldi1 fr1
fcmp/eq fr0, fr1
bf wrong
bra double
nop
wrong:
fail
double:
# double precision tests.
# fabs(0.0) = 0.0.
fldi0 fr0
_s2d fr0, dr0
_setpr
fabs dr0
_clrpr
# check.
fldi0 fr2
_s2d fr2, dr2
_setpr
fcmp/eq dr0, dr2
bf wrong
_clrpr
one:
# fabs(1.0) = 1.0.
fldi1 fr0
_s2d fr0, dr0
_setpr
fabs dr0
_clrpr
# check.
fldi1 fr2
_s2d fr2, dr2
_setpr
fcmp/eq dr0, dr2
bf wrong2
_clrpr
minusone:
# fabs(-1.0) = 1.0.
fldi1 fr0
fneg fr0
_s2d fr0, dr0
_setpr
fabs dr0
_clrpr
# check.
fldi1 fr2
_s2d fr2, dr2
_setpr
fcmp/eq dr0, dr2
bf wrong2
_clrpr
okay:
pass
wrong2:
fail