Search
lxdream.org :: lxdream :: r823:8a592668322f
lxdream 0.9.1
released Jun 29
Download Now
changeset823:8a592668322f
parent822:6e0536758465
child824:016cda9d0518
authornkeynes
dateSun Aug 24 01:40:58 2008 +0000 (12 years ago)
Mask fpscr correctly as well while we're in there
src/sh4/sh4.c
src/sh4/sh4core.h
test/Makefile.in
test/sh4/ldc.s
test/sh4/ldcsr.s
test/sh4/testsh4.c
1.1 --- a/src/sh4/sh4.c Sat Aug 23 12:08:01 2008 +0000
1.2 +++ b/src/sh4/sh4.c Sun Aug 24 01:40:58 2008 +0000
1.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.10
1.11 uint32_t sh4_read_sr( void )
2.1 --- a/src/sh4/sh4core.h Sat Aug 23 12:08:01 2008 +0000
2.2 +++ b/src/sh4/sh4core.h Sun Aug 24 01:40:58 2008 +0000
2.3 @@ -271,6 +271,7 @@
2.4 #define FPSCR_ENABLE 0x00000F80
2.5 #define FPSCR_FLAG 0x0000007C
2.6 #define FPSCR_RM 0x00000003 /* Rounding mode (0=nearest, 1=to zero) */
2.7 +#define FPSCR_MASK 0x003FFFFF
2.8
2.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 +0000
3.2 +++ b/test/Makefile.in Sun Aug 24 01:40:58 2008 +0000
3.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.so
3.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 +0000
4.2 +++ b/test/sh4/ldc.s Sun Aug 24 01:40:58 2008 +0000
4.3 @@ -0,0 +1,44 @@
4.4 +.section .text
4.5 +.include "sh4/inc.s"
4.6 +
4.7 +.global _test_ldc
4.8 +_test_ldc:
4.9 + start_test
4.10 +
4.11 +test_ldcsr_1:
4.12 + add #1, r12
4.13 +
4.14 + stc sr, r0
4.15 + mov #-1, r1
4.16 + ldc r1, sr
4.17 + stc sr, r2
4.18 + ldc r0, sr
4.19 + mov.l sr_mask, r3
4.20 + cmp/eq r2, r3
4.21 + bt test_ldsfpscr_1
4.22 + fail test_ldc_str_k
4.23 +
4.24 +test_ldsfpscr_1:
4.25 + add #1,r12
4.26 + sts fpscr, r0
4.27 + mov #-1, r1
4.28 + lds r1, fpscr
4.29 + sts fpscr, r2
4.30 + lds r0, fpscr
4.31 + mov.l fpscr_mask, r3
4.32 + cmp/eq r2, r3
4.33 + bt test_ldc_end
4.34 + fail test_ldc_str_k
4.35 +
4.36 +test_ldc_end:
4.37 + end_test test_ldc_str_k
4.38 +
4.39 +test_ldc_str:
4.40 + .string "LDC/S"
4.41 +.align 4
4.42 +sr_mask:
4.43 + .long 0x700083F3
4.44 +fpscr_mask:
4.45 + .long 0x003FFFFF
4.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 +0000
5.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
5.3 @@ -1,31 +0,0 @@
5.4 -.section .text
5.5 -.include "sh4/inc.s"
5.6 -
5.7 -.global _test_ldcsr
5.8 -_test_ldcsr:
5.9 - start_test
5.10 -
5.11 -test_ldcsr_1:
5.12 - add #1, r12
5.13 -
5.14 - stc sr, r0
5.15 - mov #-1, r1
5.16 - ldc r1, sr
5.17 - stc sr, r2
5.18 - ldc r0, sr
5.19 - mov.l sr_mask, r3
5.20 - cmp/eq r2, r3
5.21 - bt test_ldcsr_end
5.22 - fail test_ldcsr_str_k
5.23 -
5.24 -test_ldcsr_end:
5.25 - end_test test_ldcsr_str_k
5.26 -
5.27 -test_ldcsr_str:
5.28 - .string "LDC Rn, SR"
5.29 -.align 4
5.30 -sr_mask:
5.31 - .long 0x700083F3
5.32 -test_ldcsr_str_k:
5.33 - .long test_ldcsr_str
5.34 -
5.35 \ No newline at end of file
6.1 --- a/test/sh4/testsh4.c Sat Aug 23 12:08:01 2008 +0000
6.2 +++ b/test/sh4/testsh4.c Sun Aug 24 01:40:58 2008 +0000
6.3 @@ -85,7 +85,7 @@
6.4 test_float();
6.5 test_fmov();
6.6 test_ftrc();
6.7 - test_ldcsr();
6.8 + test_ldc();
6.9 test_mac();
6.10 test_rot();
6.11 test_shl();
.