revision 1192:ba3df0bf2c23
summary |
tree |
shortlog |
changelog |
graph |
changeset |
raw | bz2 | zip | gz changeset | 1192:ba3df0bf2c23 |
parent | 1191:12fdf3aafcd4 |
child | 1193:dff55bdc4f46 |
author | nkeynes |
date | Mon Dec 12 09:54:27 2011 +1000 (12 years ago) |
FSRRA uses higher precision for intermediate results - change sqrtf to sqrt.
src/sh4/sh4core.in | view | annotate | diff | log | ||
test/Makefile.in | view | annotate | diff | log | ||
test/sh4/fsrra.s | view | annotate | diff | log | ||
test/sh4/testsh4.c | view | annotate | diff | log |
1.1 --- a/src/sh4/sh4core.in Fri Dec 02 18:18:04 2011 +10001.2 +++ b/src/sh4/sh4core.in Mon Dec 12 09:54:27 2011 +10001.3 @@ -1273,7 +1273,7 @@1.4 FSRRA FRn {:1.5 CHECKFPUEN();1.6 if( !IS_FPU_DOUBLEPREC() ) {1.7 - FR(FRn) = 1.0/sqrtf(FR(FRn));1.8 + FR(FRn) = 1.0/sqrt(FR(FRn));1.9 }1.10 :}1.11 FIPR FVm, FVn {:
2.1 --- a/test/Makefile.in Fri Dec 02 18:18:04 2011 +10002.2 +++ b/test/Makefile.in Mon Dec 12 09:54:27 2011 +10002.3 @@ -96,6 +96,7 @@2.4 sh4/add.so sh4/addc.so sh4/addv.so sh4/and.so sh4/andi.so \2.5 sh4/bf.so sh4/bsr.so sh4/bt.so sh4/cmp.so sh4/cmpstr.so \2.6 sh4/div0.so sh4/div1.so sh4/float.so sh4/fmov.so sh4/ftrc.so \2.7 + sh4/fsrra.so \2.8 sh4/ldc.so sh4/mac.so \2.9 sh4/rot.so sh4/shl.so sh4/shld.so sh4/sub.so sh4/subc.so sh4/subv.so \2.10 sh4/trapa.so sh4/tas.so sh4/xtrct.so \2.11 @@ -190,6 +191,7 @@2.12 lib.c lib.h math.s pvr.c pvr.h rendload.c sh4/add.s sh4/addc.s \2.13 sh4/addv.s sh4/and.s sh4/andi.s sh4/bf.s sh4/bsr.s sh4/bt.s sh4/cmp.s \2.14 sh4/cmpstr.s sh4/div0.s sh4/div1.s sh4/excslot.s sh4/float.s sh4/fmov.s sh4/ftrc.s \2.15 + sh4/fsrra.s \2.16 sh4/inc.s sh4/mac.s sh4/ldc.s sh4/rot.s sh4/shl.s sh4/shld.s sh4/sub.s sh4/subc.s \2.17 sh4/subv.s sh4/tas.s sh4/testsh4.c sh4/tlb.s sh4/vmexit.s sh4/trapa.s sh4/undef.s \2.18 sh4/xtrct.s sh4/utlb.c sh4/utlb.h sh4/testutlb.s testdata.c testdata.h testdisp.c \
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +00003.2 +++ b/test/sh4/fsrra.s Mon Dec 12 09:54:27 2011 +10003.3 @@ -0,0 +1,85 @@3.4 +.section .text3.5 +.include "sh4/inc.s"3.6 +3.7 +.global _test_fsrra3.8 +_test_fsrra:3.9 + start_test3.10 + mov.l r11, @-r153.11 + mov.l test_fsrra_data_k, r113.12 +3.13 +test_fsrra_loop:3.14 + mov.l test_fsrra_data_end_k, r43.15 + cmp/eq r11, r43.16 + bt test_fsrra_end3.17 + add #1, r123.18 +3.19 + fmov @r11+, fr53.20 + fsrra fr53.21 + flds fr5, fpul3.22 + sts fpul, r53.23 + mov.l @r11+, r43.24 + cmp/eq r4, r53.25 + bt test_fsrra_loop3.26 +3.27 + mov.l test_fsrra_error_k, r33.28 + jsr @r33.29 + fail test_fsrra_str_k3.30 + bra test_fsrra_loop3.31 + nop3.32 +3.33 +test_fsrra_end:3.34 + mov.l @r15+, r113.35 + end_test test_fsrra_str_k3.36 +3.37 + .align 43.38 +test_fsrra_data_k:3.39 + .long test_fsrra_data3.40 +test_fsrra_data:3.41 +test_fsrra_data_1:3.42 + .long 0x3F8000003.43 + .long 0x3F8000003.44 +3.45 + .long 0x432143213.46 + .long 0x3da146133.47 +3.48 + .long 0x3B0D693E3.49 + .long 0x41ac38ca3.50 +3.51 + .long 0x3B5D87B73.52 + .long 0x418999343.53 +3.54 + .long 0x418999343.55 + .long 0x3e76e8e33.56 +3.57 +# .long 0xFFFFFFF03.58 +# .long 0x7fbfffff3.59 +3.60 + .long 0x000000403.61 + .long 0x633504f33.62 +3.63 + .long 0xFFFFFF803.64 + .long 0xffffff803.65 +3.66 + .long 0x000000013.67 + .long 0x64b504f33.68 +3.69 + .long 0x987654323.70 + .long 0xffc000003.71 +3.72 + .long 0x64b504f33.73 + .long 0x2cd744fd3.74 +3.75 + .long 0x2cd744fd3.76 + .long 0x48c5672a3.77 +3.78 +test_fsrra_data_end:3.79 + .align 43.80 +test_fsrra_data_end_k:3.81 + .long test_fsrra_data_end3.82 +test_fsrra_str_k:3.83 + .long test_fsrra_str3.84 +test_fsrra_error_k:3.85 + .long _test_print_float_error3.86 +test_fsrra_str:3.87 + .string "FSRRA"3.88 +3.89 \ No newline at end of file
4.1 --- a/test/sh4/testsh4.c Fri Dec 02 18:18:04 2011 +10004.2 +++ b/test/sh4/testsh4.c Mon Dec 12 09:54:27 2011 +10004.3 @@ -4,6 +4,11 @@4.4 int total_tests = 0;4.5 int total_fails = 0;4.7 +void test_print_float_error( int expect, int actual )4.8 +{4.9 + fprintf( stderr, "Error: expected 0x%08x but was 0x%08x\n", expect, actual );4.10 +}4.11 +4.12 int test_print_result( char *testname, int failed, int total )4.13 {4.14 fprintf( stdout, "%s: %d/%d tests passed\n", testname, total-failed, total );4.15 @@ -83,6 +88,7 @@4.16 test_div0();4.17 test_div1();4.18 test_float();4.19 + test_fsrra();4.20 test_fmov();4.21 test_ftrc();4.22 test_ldc();
.