mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Add some soft-float lirasm tests and automate testing of alternate configurations for ARM. [Bug 573998] [r=stejohns]
--HG-- extra : convert_revision : 491cac5771d8051c50ed3a5b304500400d9d8f0b
This commit is contained in:
parent
3af66d7d8e
commit
61d3b0e262
@ -1,5 +1,5 @@
|
|||||||
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||||
* vim: set ts=8 sw=4 et tw=0 ft=C:
|
* vim: set ts=8 sw=4 et tw=0 ft=c:
|
||||||
*
|
*
|
||||||
* ***** BEGIN LICENSE BLOCK *****
|
* ***** BEGIN LICENSE BLOCK *****
|
||||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||||
|
@ -2263,7 +2263,13 @@ processCmdLine(int argc, char **argv, CmdLineOptions& opts)
|
|||||||
avmplus::AvmCore::config.i386_use_cmov = avmplus::AvmCore::config.i386_sse2 = i386_sse;
|
avmplus::AvmCore::config.i386_use_cmov = avmplus::AvmCore::config.i386_sse2 = i386_sse;
|
||||||
avmplus::AvmCore::config.i386_fixed_esp = true;
|
avmplus::AvmCore::config.i386_fixed_esp = true;
|
||||||
#elif defined NANOJIT_ARM
|
#elif defined NANOJIT_ARM
|
||||||
// Note that we don't check for sensible configurations here!
|
// Warn about untested configurations.
|
||||||
|
if ( ((arm_arch == 5) && (arm_vfp)) || ((arm_arch >= 6) && (!arm_vfp)) ) {
|
||||||
|
char const * vfp_string = (arm_vfp) ? ("VFP") : ("no VFP");
|
||||||
|
cerr << "Warning: This configuration (ARMv" << arm_arch << ", " << vfp_string << ") " <<
|
||||||
|
"is not regularly tested." << endl;
|
||||||
|
}
|
||||||
|
|
||||||
avmplus::AvmCore::config.arm_arch = arm_arch;
|
avmplus::AvmCore::config.arm_arch = arm_arch;
|
||||||
avmplus::AvmCore::config.arm_vfp = arm_vfp;
|
avmplus::AvmCore::config.arm_vfp = arm_vfp;
|
||||||
avmplus::AvmCore::config.soft_float = !arm_vfp;
|
avmplus::AvmCore::config.soft_float = !arm_vfp;
|
||||||
|
@ -6,34 +6,75 @@ LIRASM=$1
|
|||||||
|
|
||||||
TESTS_DIR=`dirname "$0"`/tests
|
TESTS_DIR=`dirname "$0"`/tests
|
||||||
|
|
||||||
for infile in "$TESTS_DIR"/*.in
|
function runtest {
|
||||||
do
|
local infile=$1
|
||||||
outfile=`echo $infile | sed 's/\.in/\.out/'`
|
local options=${2-}
|
||||||
if [ ! -e "$outfile" ]
|
|
||||||
|
# Catch a request for the random tests.
|
||||||
|
if [[ $infile == --random* ]]
|
||||||
|
then
|
||||||
|
local outfile=$TESTS_DIR/random.out
|
||||||
|
else
|
||||||
|
local outfile=`echo $infile | sed 's/\.in/\.out/'`
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ! -e "$outfile" ]]
|
||||||
then
|
then
|
||||||
echo "$0: error: no out file $outfile"
|
echo "$0: error: no out file $outfile"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Treat "random.in" and "random-opt.in" specially.
|
if $LIRASM $options --execute $infile | tr -d '\r' > testoutput.txt && cmp -s testoutput.txt $outfile
|
||||||
if [ `basename $infile` = "random.in" ]
|
|
||||||
then
|
then
|
||||||
infile="--random 1000000"
|
echo "TEST-PASS | lirasm | lirasm $options --execute $infile"
|
||||||
elif [ `basename $infile` = "random-opt.in" ]
|
|
||||||
then
|
|
||||||
infile="--random 1000000 --optimize"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if $LIRASM --execute $infile | tr -d '\r' > testoutput.txt && cmp -s testoutput.txt $outfile
|
|
||||||
then
|
|
||||||
echo "TEST-PASS | lirasm | lirasm --execute $infile"
|
|
||||||
else
|
else
|
||||||
echo "TEST-UNEXPECTED-FAIL | lirasm | lirasm --execute $infile"
|
echo "TEST-UNEXPECTED-FAIL | lirasm | lirasm $options --execute $infile"
|
||||||
echo "expected output"
|
echo "expected output"
|
||||||
cat $outfile
|
cat $outfile
|
||||||
echo "actual output"
|
echo "actual output"
|
||||||
cat testoutput.txt
|
cat testoutput.txt
|
||||||
fi
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Tests common to all supported back-ends.
|
||||||
|
for infile in "$TESTS_DIR"/*.in
|
||||||
|
do
|
||||||
|
runtest $infile
|
||||||
done
|
done
|
||||||
|
|
||||||
|
runtest "--random 1000000"
|
||||||
|
runtest "--random 1000000 --optimize"
|
||||||
|
|
||||||
|
# ---- Platform-specific tests and configurations. ----
|
||||||
|
|
||||||
|
# ARM
|
||||||
|
if [[ $(uname -m) == arm* ]]
|
||||||
|
then
|
||||||
|
for infile in "$TESTS_DIR"/*.in
|
||||||
|
do
|
||||||
|
# Run standard tests, but set code generation for older architectures.
|
||||||
|
# It may also be beneficial to test ARMv6 and ARMv7 with --novfp, but such
|
||||||
|
# a platform seems so unlikely that it probably isn't worthwhile. It's also
|
||||||
|
# unlikely that it's worth testing ARMv5 with VFP.
|
||||||
|
runtest $infile "--arch 6"
|
||||||
|
runtest $infile "--arch 5 --novfp"
|
||||||
|
done
|
||||||
|
|
||||||
|
# Run specific soft-float tests, but only for ARMv5 without VFP.
|
||||||
|
# NOTE: It looks like MIPS ought to be able to run these tests, but I can't
|
||||||
|
# test this and _not_ running them seems like the safest option.
|
||||||
|
for infile in "$TESTS_DIR"/softfloat/*.in
|
||||||
|
do
|
||||||
|
runtest $infile "--arch 5 --novfp"
|
||||||
|
done
|
||||||
|
|
||||||
|
# Run reduced random tests for these targets. (The default ARMv7 target
|
||||||
|
# still runs the long tests.)
|
||||||
|
runtest "--random 10000 --arch 6"
|
||||||
|
runtest "--random 10000 --arch 5 --novfp"
|
||||||
|
runtest "--random 10000 --optimize --arch 6"
|
||||||
|
runtest "--random 10000 --optimize --arch 5 --novfp"
|
||||||
|
fi
|
||||||
|
|
||||||
rm testoutput.txt
|
rm testoutput.txt
|
||||||
|
|
||||||
|
@ -1 +0,0 @@
|
|||||||
# dummy file, contents aren't used
|
|
@ -1 +0,0 @@
|
|||||||
# dummy file, contents aren't used
|
|
4
js/src/lirasm/tests/softfloat/dhi2i.in
Normal file
4
js/src/lirasm/tests/softfloat/dhi2i.in
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
; IEEE-754 encodes -0.0 as 0x80000000,00000000
|
||||||
|
d = immd -0.0
|
||||||
|
hi = dhi2i d
|
||||||
|
reti hi
|
1
js/src/lirasm/tests/softfloat/dhi2i.out
Normal file
1
js/src/lirasm/tests/softfloat/dhi2i.out
Normal file
@ -0,0 +1 @@
|
|||||||
|
Output is: -2147483648
|
4
js/src/lirasm/tests/softfloat/dlo2i.in
Normal file
4
js/src/lirasm/tests/softfloat/dlo2i.in
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
; IEEE-754 encodes the following constant as 0x3ff00000,ffffffff
|
||||||
|
d = immd 1.0000009536743162
|
||||||
|
lo = dlo2i d
|
||||||
|
reti lo
|
1
js/src/lirasm/tests/softfloat/dlo2i.out
Normal file
1
js/src/lirasm/tests/softfloat/dlo2i.out
Normal file
@ -0,0 +1 @@
|
|||||||
|
Output is: -1
|
20
js/src/lirasm/tests/softfloat/ii2d.in
Normal file
20
js/src/lirasm/tests/softfloat/ii2d.in
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
; It's very difficult to test that the 'lo' part is actually doing anything
|
||||||
|
; because it tends to get lost when lirasm dumps the result to the console.
|
||||||
|
; By far the easiest way to check this is to use dlo2i and dhi2i to see if we
|
||||||
|
; get what we started with (assuming that those instructions work).
|
||||||
|
|
||||||
|
hi = immi 1127219201 ; 0x43300001 (positive, exponent of +52 ...
|
||||||
|
lo = immi -1 ; 0xffffffff (... mantissa of 0x100001ffffffff)
|
||||||
|
d = ii2d lo hi
|
||||||
|
hi2 = dhi2i d
|
||||||
|
lo2 = dlo2i d
|
||||||
|
|
||||||
|
; XOR to check for differences, then OR the two results. 0 indicates success,
|
||||||
|
; but anything else indicates some kind of loss of data.
|
||||||
|
rhi = xori hi hi2
|
||||||
|
rlo = xori lo lo2
|
||||||
|
|
||||||
|
res = ori rhi rlo
|
||||||
|
|
||||||
|
reti res
|
||||||
|
|
Loading…
Reference in New Issue
Block a user