revision 822:6e0536758465
summary |
tree |
shortlog |
changelog |
graph |
changeset |
raw | bz2 | zip | gz changeset | 822:6e0536758465 |
parent | 821:4398dafeb77d |
child | 823:8a592668322f |
author | nkeynes |
date | Sat Aug 23 12:08:01 2008 +0000 (14 years ago) |
Mask off SR correctly when writing to it - this turns out to be important
in some cases
in some cases
![]() | src/sh4/sh4.c | view | annotate | diff | log | |
![]() | test/Makefile.in | 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 Wed Aug 20 11:25:46 2008 +00001.2 +++ b/src/sh4/sh4.c Sat Aug 23 12:08:01 2008 +00001.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 +00002.2 +++ b/test/Makefile.in Sat Aug 23 12:08:01 2008 +00002.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.so2.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 +00003.2 +++ b/test/sh4/ldcsr.s Sat Aug 23 12:08:01 2008 +00003.3 @@ -0,0 +1,31 @@3.4 +.section .text3.5 +.include "sh4/inc.s"3.6 +3.7 +.global _test_ldcsr3.8 +_test_ldcsr:3.9 + start_test3.10 +3.11 +test_ldcsr_1:3.12 + add #1, r123.13 +3.14 + stc sr, r03.15 + mov #-1, r13.16 + ldc r1, sr3.17 + stc sr, r23.18 + ldc r0, sr3.19 + mov.l sr_mask, r33.20 + cmp/eq r2, r33.21 + bt test_ldcsr_end3.22 + fail test_ldcsr_str_k3.23 +3.24 +test_ldcsr_end:3.25 + end_test test_ldcsr_str_k3.26 +3.27 +test_ldcsr_str:3.28 + .string "LDC Rn, SR"3.29 +.align 43.30 +sr_mask:3.31 + .long 0x700083F33.32 +test_ldcsr_str_k:3.33 + .long test_ldcsr_str3.34 +3.35 \ No newline at end of file
.