revision 823:8a592668322f
summary |
tree |
shortlog |
changelog |
graph |
changeset |
raw | bz2 | zip | gz changeset | 823:8a592668322f |
parent | 822:6e0536758465 |
child | 824:016cda9d0518 |
author | nkeynes |
date | Sun Aug 24 01:40:58 2008 +0000 (15 years ago) |
Mask fpscr correctly as well while we're in there
src/sh4/sh4.c | view | annotate | diff | log | ||
src/sh4/sh4core.h | view | annotate | diff | log | ||
test/Makefile.in | view | annotate | diff | log | ||
test/sh4/ldc.s | view | annotate | diff | log | ||
test/sh4/ldcsr.s | view | annotate | diff | log | ||
test/sh4/testsh4.c | view | annotate | diff | log |
1.1 --- a/src/sh4/sh4.c Sat Aug 23 12:08:01 2008 +00001.2 +++ b/src/sh4/sh4.c Sun Aug 24 01:40:58 2008 +00001.3 @@ -339,7 +339,7 @@1.4 if( (sh4r.fpscr ^ newval) & FPSCR_FR ) {1.5 sh4_switch_fr_banks();1.6 }1.7 - sh4r.fpscr = newval;1.8 + sh4r.fpscr = newval & FPSCR_MASK;1.9 }1.11 uint32_t sh4_read_sr( void )
2.1 --- a/src/sh4/sh4core.h Sat Aug 23 12:08:01 2008 +00002.2 +++ b/src/sh4/sh4core.h Sun Aug 24 01:40:58 2008 +00002.3 @@ -271,6 +271,7 @@2.4 #define FPSCR_ENABLE 0x00000F802.5 #define FPSCR_FLAG 0x0000007C2.6 #define FPSCR_RM 0x00000003 /* Rounding mode (0=nearest, 1=to zero) */2.7 +#define FPSCR_MASK 0x003FFFFF2.9 #define IS_FPU_DOUBLEPREC() (sh4r.fpscr&FPSCR_PR)2.10 #define IS_FPU_DOUBLESIZE() (sh4r.fpscr&FPSCR_SZ)
3.1 --- a/test/Makefile.in Sat Aug 23 12:08:01 2008 +00003.2 +++ b/test/Makefile.in Sun Aug 24 01:40:58 2008 +00003.3 @@ -81,7 +81,7 @@3.4 sh4/add.so sh4/addc.so sh4/addv.so sh4/and.so sh4/andi.so \3.5 sh4/bf.so sh4/bsr.so sh4/bt.so sh4/cmp.so sh4/cmpstr.so \3.6 sh4/div0.so sh4/div1.so sh4/float.so sh4/fmov.so sh4/ftrc.so \3.7 - sh4/ldcsr.so sh4/mac.so \3.8 + sh4/ldc.so sh4/mac.so \3.9 sh4/rot.so sh4/shl.so sh4/shld.so sh4/sub.so sh4/subc.so \3.10 sh4/trapa.so sh4/tas.so sh4/xtrct.so \3.11 sh4/excslot.so sh4/undef.so sh4/tlb.so sh4/vmexit.so3.12 @@ -165,7 +165,7 @@3.13 lib.c lib.h math.s pvr.c pvr.h rendload.c sh4/add.s sh4/addc.s \3.14 sh4/addv.s sh4/and.s sh4/andi.s sh4/bf.s sh4/bsr.s sh4/bt.s sh4/cmp.s \3.15 sh4/cmpstr.s sh4/div0.s sh4/div1.s sh4/excslot.s sh4/float.s sh4/fmov.s \3.16 - sh4/ftrc.s sh4/inc.s sh4/mac.s sh4/ldcsr.s sh4/rot.s sh4/shl.s sh4/shld.s sh4/sub.s \3.17 + sh4/ftrc.s sh4/inc.s sh4/mac.s sh4/ldc.s sh4/rot.s sh4/shl.s sh4/shld.s sh4/sub.s \3.18 sh4/subc.s sh4/tas.s sh4/testsh4.c sh4/tlb.s sh4/vmexit.s sh4/trapa.s sh4/undef.s \3.19 sh4/xtrct.s testdata.c testdata.h testdisp.c testide.c testmath.c \3.20 testmmu.c testregs.c testrend.c testspu.c testta.c testyuv.c timer.c timer.h \
4.1 --- /dev/null Thu Jan 01 00:00:00 1970 +00004.2 +++ b/test/sh4/ldc.s Sun Aug 24 01:40:58 2008 +00004.3 @@ -0,0 +1,44 @@4.4 +.section .text4.5 +.include "sh4/inc.s"4.6 +4.7 +.global _test_ldc4.8 +_test_ldc:4.9 + start_test4.10 +4.11 +test_ldcsr_1:4.12 + add #1, r124.13 +4.14 + stc sr, r04.15 + mov #-1, r14.16 + ldc r1, sr4.17 + stc sr, r24.18 + ldc r0, sr4.19 + mov.l sr_mask, r34.20 + cmp/eq r2, r34.21 + bt test_ldsfpscr_14.22 + fail test_ldc_str_k4.23 +4.24 +test_ldsfpscr_1:4.25 + add #1,r124.26 + sts fpscr, r04.27 + mov #-1, r14.28 + lds r1, fpscr4.29 + sts fpscr, r24.30 + lds r0, fpscr4.31 + mov.l fpscr_mask, r34.32 + cmp/eq r2, r34.33 + bt test_ldc_end4.34 + fail test_ldc_str_k4.35 +4.36 +test_ldc_end:4.37 + end_test test_ldc_str_k4.38 +4.39 +test_ldc_str:4.40 + .string "LDC/S"4.41 +.align 44.42 +sr_mask:4.43 + .long 0x700083F34.44 +fpscr_mask:4.45 + .long 0x003FFFFF4.46 +test_ldc_str_k:4.47 + .long test_ldc_str
5.1 --- a/test/sh4/ldcsr.s Sat Aug 23 12:08:01 2008 +00005.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +00005.3 @@ -1,31 +0,0 @@5.4 -.section .text5.5 -.include "sh4/inc.s"5.6 -5.7 -.global _test_ldcsr5.8 -_test_ldcsr:5.9 - start_test5.10 -5.11 -test_ldcsr_1:5.12 - add #1, r125.13 -5.14 - stc sr, r05.15 - mov #-1, r15.16 - ldc r1, sr5.17 - stc sr, r25.18 - ldc r0, sr5.19 - mov.l sr_mask, r35.20 - cmp/eq r2, r35.21 - bt test_ldcsr_end5.22 - fail test_ldcsr_str_k5.23 -5.24 -test_ldcsr_end:5.25 - end_test test_ldcsr_str_k5.26 -5.27 -test_ldcsr_str:5.28 - .string "LDC Rn, SR"5.29 -.align 45.30 -sr_mask:5.31 - .long 0x700083F35.32 -test_ldcsr_str_k:5.33 - .long test_ldcsr_str5.34 -5.35 \ No newline at end of file
.