revision 1083:34895c8bab20
summary |
tree |
shortlog |
changelog |
graph |
changeset |
raw | bz2 | zip | gz changeset | 1083:34895c8bab20 |
parent | 1082:852fc1db460a |
child | 1084:852412cf56e0 |
author | nkeynes |
date | Wed Dec 02 10:36:49 2009 +1000 (13 years ago) |
Add missing SUBV instruction to the emulation core (translation core is ok),
along with test cases. Thanks to D. Jeff Dionne for pointing this out.
along with test cases. Thanks to D. Jeff Dionne for pointing this out.
![]() | src/sh4/sh4core.in | view | annotate | diff | log | |
![]() | test/Makefile.in | view | annotate | diff | log | |
![]() | test/sh4/subv.s | view | annotate | diff | log | |
![]() | test/sh4/testsh4.c | view | annotate | diff | log |
1.1 --- a/src/sh4/sh4core.in Wed Dec 02 10:03:40 2009 +10001.2 +++ b/src/sh4/sh4core.in Wed Dec 02 10:36:49 2009 +10001.3 @@ -747,7 +747,11 @@1.4 sh4r.r[Rn] = sh4r.r[Rn] - sh4r.r[Rm] - sh4r.t;1.5 sh4r.t = (sh4r.r[Rn] > tmp || (sh4r.r[Rn] == tmp && sh4r.t == 1));1.6 :}1.7 -1.8 +SUBV Rm, Rn {:1.9 + tmp = sh4r.r[Rn] - sh4r.r[Rm];1.10 + sh4r.t = ( (sh4r.r[Rn]>>31) != (sh4r.r[Rm]>>31) && ((sh4r.r[Rn]>>31) != (tmp>>31)) );1.11 + sh4r.r[Rn] = tmp;1.12 +:}1.13 BRAF Rn {:1.14 CHECKSLOTILLEGAL();1.15 CHECKDEST( pc + 4 + sh4r.r[Rn] );
2.1 --- a/test/Makefile.in Wed Dec 02 10:03:40 2009 +10002.2 +++ b/test/Makefile.in Wed Dec 02 10:36:49 2009 +10002.3 @@ -96,7 +96,7 @@2.4 sh4/bf.so sh4/bsr.so sh4/bt.so sh4/cmp.so sh4/cmpstr.so \2.5 sh4/div0.so sh4/div1.so sh4/float.so sh4/fmov.so sh4/ftrc.so \2.6 sh4/ldc.so sh4/mac.so \2.7 - sh4/rot.so sh4/shl.so sh4/shld.so sh4/sub.so sh4/subc.so \2.8 + sh4/rot.so sh4/shl.so sh4/shld.so sh4/sub.so sh4/subc.so sh4/subv.so \2.9 sh4/trapa.so sh4/tas.so sh4/xtrct.so \2.10 sh4/excslot.so sh4/undef.so sh4/tlb.so sh4/vmexit.so2.11 $(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS)
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +00003.2 +++ b/test/sh4/subv.s Wed Dec 02 10:36:49 2009 +10003.3 @@ -0,0 +1,106 @@3.4 +.section .text3.5 +.include "sh4/inc.s"3.6 +3.7 +.global _test_subv3.8 +_test_subv:3.9 + start_test3.10 + mov.l r11, @-r153.11 + mov.l test_subv_data_k, r113.12 +3.13 +test_subv_loop:3.14 + mov.l test_subv_data_end_k, r43.15 + cmp/eq r11, r43.16 + bt test_subv_end3.17 + add #1, r123.18 +3.19 + clc3.20 + mov.l @r11+, r03.21 + mov.l @r11+, r13.22 + subv r0, r13.23 + stc sr, r43.24 + mov.l @r11+, r23.25 + mov.l @r11+, r33.26 + cmp/eq r1, r23.27 + bt test_subv_b3.28 + fail test_subv_str_k3.29 + bra test_subv_loop3.30 + nop3.31 +test_subv_b:3.32 + ldc r4, sr3.33 + xor r0, r03.34 + add #1, r03.35 + and r0, r43.36 + cmp/eq r3, r43.37 + bt test_subv_loop3.38 + fail test_subv_str_k3.39 + bra test_subv_loop3.40 + nop3.41 +3.42 +test_subv_end:3.43 + mov.l @r15+, r113.44 + end_test test_subv_str_k3.45 +3.46 + .align 43.47 +test_subv_data_k:3.48 + .long test_subv_data3.49 +test_subv_data:3.50 +test_subv_data_1:3.51 + .long 0x000000003.52 + .long 0x000000003.53 + .long 0x000000003.54 + .long 0x000000003.55 +3.56 + .long 0x0000000F3.57 + .long 0x7FFFFFFF3.58 + .long 0x7FFFFFF03.59 + .long 0x000000003.60 +3.61 + .long 0x0000000F3.62 + .long 0xFFFFFFFF3.63 + .long 0xFFFFFFF03.64 + .long 0x000000003.65 +3.66 + .long 0xFFFFFFF03.67 + .long 0xFFFFFFE03.68 + .long 0xFFFFFFF03.69 + .long 0x000000003.70 +3.71 + .long 0x000000403.72 + .long 0x000000203.73 + .long 0xFFFFFFE03.74 + .long 0x000000003.75 +3.76 + .long 0xFFFFFF803.77 + .long 0xFFFFFFB23.78 + .long 0x000000323.79 + .long 0x000000003.80 +3.81 + .long 0x000000013.82 + .long 0x800000003.83 + .long 0x7FFFFFFF3.84 + .long 0x000000013.85 +3.86 + .long 0xFFFFFFFF3.87 + .long 0x7FFFFFFF3.88 + .long 0x800000003.89 + .long 0x000000013.90 +3.91 + .long 0x987654323.92 + .long 0x30ECA8643.93 + .long 0x987654323.94 + .long 0x000000013.95 +3.96 + .long 0x432143213.97 + .long 0x864286423.98 + .long 0x432143213.99 + .long 0x000000013.100 +3.101 +test_subv_data_end:3.102 + .align 43.103 +test_subv_data_end_k:3.104 + .long test_subv_data_end3.105 +test_subv_str_k:3.106 + .long test_subv_str3.107 +test_subv_str:3.108 + .string "SUBV"3.109 +3.110 \ No newline at end of file
4.1 --- a/test/sh4/testsh4.c Wed Dec 02 10:03:40 2009 +10004.2 +++ b/test/sh4/testsh4.c Wed Dec 02 10:36:49 2009 +10004.3 @@ -14,9 +14,6 @@4.5 void test_print_failure( char *testname, int number, char *message )4.6 {4.7 - fprintf( stderr, "Fail" );4.8 - fprintf( stderr, testname );4.9 -4.10 if( message == NULL ) {4.11 fprintf( stderr, "%s: Test %d failed!\n", testname, number );4.12 } else {4.13 @@ -95,6 +92,7 @@4.14 test_shld();4.15 test_sub();4.16 test_subc();4.17 + test_subv();4.18 test_trapa();4.19 test_tas();4.20 test_xtrct();
.