Search
lxdream.org :: lxdream :: r822:6e0536758465
lxdream 0.9.1
released Jun 29
Download Now
changeset822:6e0536758465
parent821:4398dafeb77d
child823:8a592668322f
authornkeynes
dateSat Aug 23 12:08:01 2008 +0000 (12 years ago)
Mask off SR correctly when writing to it - this turns out to be important
in some cases
src/sh4/sh4.c
test/Makefile.in
test/sh4/ldcsr.s
test/sh4/testsh4.c
1.1 --- a/src/sh4/sh4.c Wed Aug 20 11:25:46 2008 +0000
1.2 +++ b/src/sh4/sh4.c Sat Aug 23 12:08:01 2008 +0000
1.3 @@ -326,7 +326,7 @@
1.4 int newbank = (newval&SR_MDRB) == SR_MDRB;
1.5 if( oldbank != newbank )
1.6 sh4_switch_banks();
1.7 - sh4r.sr = newval;
1.8 + sh4r.sr = newval & SR_MASK;
1.9 sh4r.t = (newval&SR_T) ? 1 : 0;
1.10 sh4r.s = (newval&SR_S) ? 1 : 0;
1.11 sh4r.m = (newval&SR_M) ? 1 : 0;
2.1 --- a/test/Makefile.in Wed Aug 20 11:25:46 2008 +0000
2.2 +++ b/test/Makefile.in Sat Aug 23 12:08:01 2008 +0000
2.3 @@ -81,7 +81,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/mac.so \
2.8 + sh4/ldcsr.so sh4/mac.so \
2.9 sh4/rot.so sh4/shl.so sh4/shld.so sh4/sub.so sh4/subc.so \
2.10 sh4/trapa.so sh4/tas.so sh4/xtrct.so \
2.11 sh4/excslot.so sh4/undef.so sh4/tlb.so sh4/vmexit.so
2.12 @@ -165,7 +165,7 @@
2.13 lib.c lib.h math.s pvr.c pvr.h rendload.c sh4/add.s sh4/addc.s \
2.14 sh4/addv.s sh4/and.s sh4/andi.s sh4/bf.s sh4/bsr.s sh4/bt.s sh4/cmp.s \
2.15 sh4/cmpstr.s sh4/div0.s sh4/div1.s sh4/excslot.s sh4/float.s sh4/fmov.s \
2.16 - sh4/ftrc.s sh4/inc.s sh4/mac.s sh4/rot.s sh4/shl.s sh4/shld.s sh4/sub.s \
2.17 + sh4/ftrc.s sh4/inc.s sh4/mac.s sh4/ldcsr.s sh4/rot.s sh4/shl.s sh4/shld.s sh4/sub.s \
2.18 sh4/subc.s sh4/tas.s sh4/testsh4.c sh4/tlb.s sh4/vmexit.s sh4/trapa.s sh4/undef.s \
2.19 sh4/xtrct.s testdata.c testdata.h testdisp.c testide.c testmath.c \
2.20 testmmu.c testregs.c testrend.c testspu.c testta.c testyuv.c timer.c timer.h \
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
3.2 +++ b/test/sh4/ldcsr.s Sat Aug 23 12:08:01 2008 +0000
3.3 @@ -0,0 +1,31 @@
3.4 +.section .text
3.5 +.include "sh4/inc.s"
3.6 +
3.7 +.global _test_ldcsr
3.8 +_test_ldcsr:
3.9 + start_test
3.10 +
3.11 +test_ldcsr_1:
3.12 + add #1, r12
3.13 +
3.14 + stc sr, r0
3.15 + mov #-1, r1
3.16 + ldc r1, sr
3.17 + stc sr, r2
3.18 + ldc r0, sr
3.19 + mov.l sr_mask, r3
3.20 + cmp/eq r2, r3
3.21 + bt test_ldcsr_end
3.22 + fail test_ldcsr_str_k
3.23 +
3.24 +test_ldcsr_end:
3.25 + end_test test_ldcsr_str_k
3.26 +
3.27 +test_ldcsr_str:
3.28 + .string "LDC Rn, SR"
3.29 +.align 4
3.30 +sr_mask:
3.31 + .long 0x700083F3
3.32 +test_ldcsr_str_k:
3.33 + .long test_ldcsr_str
3.34 +
3.35 \ No newline at end of file
4.1 --- a/test/sh4/testsh4.c Wed Aug 20 11:25:46 2008 +0000
4.2 +++ b/test/sh4/testsh4.c Sat Aug 23 12:08:01 2008 +0000
4.3 @@ -85,6 +85,7 @@
4.4 test_float();
4.5 test_fmov();
4.6 test_ftrc();
4.7 + test_ldcsr();
4.8 test_mac();
4.9 test_rot();
4.10 test_shl();
.