revision 399:23e51a2b4f99
summary |
tree |
shortlog |
changelog |
graph |
changeset |
raw | bz2 | zip | gz changeset | 399:23e51a2b4f99 |
parent | 398:16b0856ea511 |
child | 400:049d72a7a229 |
author | nkeynes |
date | Thu Sep 20 08:34:23 2007 +0000 (16 years ago) |
Add tests for TAS.B
![]() | test/Makefile | view | annotate | diff | log | |
![]() | test/sh4/tas.s | view | annotate | diff | log | |
![]() | test/sh4/testsh4.c | view | annotate | diff | log |
1.1 --- a/test/Makefile Wed Sep 19 12:09:33 2007 +00001.2 +++ b/test/Makefile Thu Sep 20 08:34:23 2007 +00001.3 @@ -76,7 +76,7 @@1.4 sh4/bf.so sh4/bt.so sh4/cmp.so sh4/cmpstr.so sh4/div0.so \1.5 sh4/div1.so sh4/float.so sh4/fmov.so sh4/ftrc.so sh4/mac.s \1.6 sh4/rot.so sh4/shl.so sh4/shld.so sh4/sub.so sh4/subc.so \1.7 - sh4/xtrct.so \1.8 + sh4/tas.so sh4/xtrct.so \1.9 sh4/excslot.so sh4/undef.so1.10 $(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS)1.11 $(SH4OBJCOPY) testsh4 testsh4.bin
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +00002.2 +++ b/test/sh4/tas.s Thu Sep 20 08:34:23 2007 +00002.3 @@ -0,0 +1,107 @@2.4 +.section .text2.5 +.include "sh4/inc.s"2.6 +2.7 +.global _test_tas2.8 +_test_tas:2.9 + start_test2.10 +2.11 +test_tas_1:2.12 + add #1, r122.13 +2.14 + mova test_tas_1_data, r0 ! test with byte == 02.15 + mov r0, r42.16 + mov r4, r52.17 + tas.b @r42.18 + bf test_tas_1_fail2.19 + cmp/eq r4, r52.20 + bf test_tas_1_fail2.21 + mov #0x40, r12.22 + shll r12.23 + mov.l test_tas_1_data, r32.24 + cmp/eq r1, r32.25 + bt test_tas_22.26 +2.27 +test_tas_1_fail:2.28 + fail test_tas_str_k2.29 + bra test_tas_22.30 + nop2.31 +test_tas_1_data:2.32 + .long 0x000000002.33 +2.34 +test_tas_2:2.35 + add #1, r122.36 +2.37 + mova test_tas_2_data, r0 ! test with byte == 0x802.38 + mov r0, r42.39 + mov r4, r52.40 + tas.b @r4 ! follow up test with byte == 0x000000802.41 + bt test_tas_2_fail2.42 + cmp/eq r4, r52.43 + bf test_tas_2_fail2.44 + mov.l @r4, r32.45 + mov #0x40, r12.46 + shll r12.47 + cmp/eq r1, r32.48 + bt test_tas_32.49 +test_tas_2_fail:2.50 + fail test_tas_str_k2.51 + bra test_tas_32.52 + nop2.53 +test_tas_2_data:2.54 + .long 0x000000802.55 +2.56 +test_tas_3: ! Test with byte = 0x45 (ensure existing bits aren't changed)2.57 + add #1, r122.58 + mova test_tas_3_data, r02.59 + mov r0, r42.60 + mov.l test_tas_3_result, r12.61 + mov r4, r52.62 + tas.b @r42.63 + bt test_tas_3_fail2.64 + cmp/eq r4,r52.65 + bf test_tas_3_fail2.66 + mov.l test_tas_3_data, r32.67 + cmp/eq r1, r32.68 + bt test_tas_42.69 +2.70 +test_tas_3_fail:2.71 + fail test_tas_str_k2.72 + bra test_tas_42.73 + nop2.74 +test_tas_3_data:2.75 + .long 0x000000452.76 +test_tas_3_result:2.77 + .long 0x000000C52.78 +2.79 +test_tas_4: ! Test that it's really a byte op2.80 + add #1, r122.81 + mova test_tas_4_data, r02.82 + mov r0, r42.83 + mov.l test_tas_4_result, r12.84 + add #1, r42.85 + mov r4, r52.86 + tas.b @r42.87 + bf test_tas_4_fail2.88 + cmp/eq r4, r52.89 + mov.l test_tas_4_data, r32.90 + cmp/eq r1, r32.91 + bt test_tas_end2.92 +test_tas_4_fail:2.93 + fail test_tas_str_k2.94 + bra test_tas_end2.95 + nop2.96 +test_tas_4_data:2.97 + .long 0xAB9C00ED2.98 +test_tas_4_result:2.99 + .long 0xAB9C80ED2.100 +2.101 +test_tas_end:2.102 + end_test test_tas_str_k2.103 +2.104 +test_tas_str:2.105 + .string "TAS"2.106 +2.107 +.align 42.108 +test_tas_str_k:2.109 + .long test_tas_str2.110 +2.111 \ No newline at end of file
3.1 --- a/test/sh4/testsh4.c Wed Sep 19 12:09:33 2007 +00003.2 +++ b/test/sh4/testsh4.c Thu Sep 20 08:34:23 2007 +00003.3 @@ -66,6 +66,7 @@3.4 test_shld();3.5 test_sub();3.6 test_subc();3.7 + test_tas();3.8 test_xtrct();3.9 fprintf( stdout, "--> %d/%d instruction tests passed (%d%%)\n\n",3.10 total_tests-total_fails, total_tests,
.