revision 533:9764673fd4a5
summary |
tree |
shortlog |
changelog |
graph |
changeset |
raw | bz2 | zip | gz changeset | 533:9764673fd4a5 |
parent | 532:43653e748030 |
child | 534:b936e530fabb |
author | nkeynes |
date | Tue Nov 20 08:31:34 2007 +0000 (15 years ago) |
Fix TRAPA (translator) and add test case
![]() | src/sh4/sh4x86.c | view | annotate | diff | log | |
![]() | src/sh4/sh4x86.in | view | annotate | diff | log | |
![]() | test/Makefile.in | view | annotate | diff | log | |
![]() | test/sh4/testsh4.c | view | annotate | diff | log | |
![]() | test/sh4/trapa.s | view | annotate | diff | log |
1.1 --- a/src/sh4/sh4x86.c Mon Nov 19 08:51:03 2007 +00001.2 +++ b/src/sh4/sh4x86.c Tue Nov 20 08:31:34 2007 +00001.3 @@ -2832,9 +2832,10 @@1.4 if( sh4_x86.in_delay_slot ) {1.5 SLOTILLEGAL();1.6 } else {1.7 + load_imm32( R_ECX, pc+2 );1.8 + store_spreg( R_ECX, REG_OFFSET(pc) );1.9 load_imm32( R_EAX, imm );1.10 call_func1( sh4_raise_trap, R_EAX );1.11 - ADD_imm8s_r32( 4, R_ESP );1.12 sh4_x86.tstate = TSTATE_NONE;1.13 exit_block_pcset(pc);1.14 sh4_x86.branch_taken = TRUE;
2.1 --- a/src/sh4/sh4x86.in Mon Nov 19 08:51:03 2007 +00002.2 +++ b/src/sh4/sh4x86.in Tue Nov 20 08:31:34 2007 +00002.3 @@ -1795,9 +1795,10 @@2.4 if( sh4_x86.in_delay_slot ) {2.5 SLOTILLEGAL();2.6 } else {2.7 + load_imm32( R_ECX, pc+2 );2.8 + store_spreg( R_ECX, REG_OFFSET(pc) );2.9 load_imm32( R_EAX, imm );2.10 call_func1( sh4_raise_trap, R_EAX );2.11 - ADD_imm8s_r32( 4, R_ESP );2.12 sh4_x86.tstate = TSTATE_NONE;2.13 exit_block_pcset(pc);2.14 sh4_x86.branch_taken = TRUE;
3.1 --- a/test/Makefile.in Mon Nov 19 08:51:03 2007 +00003.2 +++ b/test/Makefile.in Tue Nov 20 08:31:34 2007 +00003.3 @@ -77,7 +77,7 @@3.4 sh4/div0.so sh4/div1.so sh4/float.so sh4/fmov.so sh4/ftrc.so \3.5 sh4/mac.s \3.6 sh4/rot.so sh4/shl.so sh4/shld.so sh4/sub.so sh4/subc.so \3.7 - sh4/tas.so sh4/xtrct.so \3.8 + sh4/trapa.so sh4/tas.so sh4/xtrct.so \3.9 sh4/excslot.so sh4/undef.so3.10 $(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS)3.11 $(SH4OBJCOPY) testsh4 testsh4.bin
4.1 --- a/test/sh4/testsh4.c Mon Nov 19 08:51:03 2007 +00004.2 +++ b/test/sh4/testsh4.c Tue Nov 20 08:31:34 2007 +00004.3 @@ -67,6 +67,7 @@4.4 test_shld();4.5 test_sub();4.6 test_subc();4.7 + test_trapa();4.8 test_tas();4.9 test_xtrct();4.10 fprintf( stdout, "--> %d/%d instruction tests passed (%d%%)\n\n",
5.1 --- /dev/null Thu Jan 01 00:00:00 1970 +00005.2 +++ b/test/sh4/trapa.s Tue Nov 20 08:31:34 2007 +00005.3 @@ -0,0 +1,36 @@5.4 +.section .text5.5 +.include "sh4/inc.s"5.6 +5.7 +.global _test_trapa5.8 +_test_trapa:5.9 + start_test5.10 +5.11 +test_trapa_1:5.12 + add #1, r125.13 + expect_exc 0x000001605.14 + trapa #425.15 +5.16 +test_trapa_1_pc:5.17 + assert_exc_caught test_trapa_str_k test_trapa_1_pc5.18 +5.19 + mov.l test_trapa_tra, r15.20 + mov.l @r1, r25.21 + mov #42, r05.22 + shll r05.23 + shll r05.24 + cmp/eq r0, r25.25 + bt test_trapa_end5.26 + fail test_trapa_str_k5.27 + bra test_trapa_end5.28 + nop5.29 +5.30 +test_trapa_tra:5.31 + .long 0xFF0000205.32 +5.33 +test_trapa_end:5.34 + end_test test_trapa_str_k5.35 +5.36 +test_trapa_str_k:5.37 + .long test_trapa_str5.38 +test_trapa_str:5.39 + .string "TRAPA"
.