revision 364:d738f6883d4a
summary |
tree |
shortlog |
changelog |
graph |
changeset |
raw | bz2 | zip | gz changeset | 364:d738f6883d4a |
parent | 363:7d0bab24016c |
child | 365:94cab5ad0ed8 |
author | nkeynes |
date | Tue Sep 04 08:30:22 2007 +0000 (16 years ago) |
Add tests for CMPSTR, DIV0U, DIV0S, SHLD, and SHAD
test/Makefile | view | annotate | diff | log | ||
test/sh4/cmpstr.s | view | annotate | diff | log | ||
test/sh4/div0.s | view | annotate | diff | log | ||
test/sh4/shld.s | view | annotate | diff | log | ||
test/sh4/testsh4.c | view | annotate | diff | log |
1.1 --- a/test/Makefile Tue Aug 28 08:47:35 2007 +00001.2 +++ b/test/Makefile Tue Sep 04 08:30:22 2007 +00001.3 @@ -73,8 +73,9 @@1.5 testsh4: crt0.so sh4/testsh4.so timer.so interrupt.so \1.6 sh4/add.so sh4/addc.so sh4/addv.so sh4/and.so sh4/andi.so \1.7 - sh4/bf.so sh4/bt.so sh4/cmp.so \1.8 + sh4/bf.so sh4/bt.so sh4/cmp.so sh4/cmpstr.so sh4/div0.so \1.9 sh4/float.so sh4/fmov.so sh4/ftrc.so sh4/mac.s \1.10 + sh4/shld.so \1.11 sh4/excslot.so sh4/undef.so1.12 $(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS)1.13 $(SH4OBJCOPY) testsh4 testsh4.bin
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +00002.2 +++ b/test/sh4/cmpstr.s Tue Sep 04 08:30:22 2007 +00002.3 @@ -0,0 +1,72 @@2.4 +.section .text2.5 +.include "sh4/inc.s"2.6 +!2.7 +! Test cmp/xx2.8 +2.9 +.global _test_cmpstr2.10 +_test_cmpstr:2.11 + start_test2.12 + mov.l r11, @-r152.13 + mov.l r10, @-r152.14 +2.15 +test_cmpstr_1: ! CMP/STR r2,r22.16 + add #1, r122.17 + mova test_cmpstr_str, r02.18 + cmp/str r0, r02.19 + bt test_cmpstr_22.20 + fail test_cmpstr_str_k2.21 +2.22 +test_cmpstr_2:2.23 + mova test_cmpstr_data, r02.24 + mov r0, r112.25 + mov #6, r102.26 +2.27 +test_cmpstr_2_loop:2.28 + add #1, r122.29 + mov.l @r11+, r22.30 + mov.l @r11+, r32.31 + mov.l @r11+, r42.32 + cmp/str r2, r32.33 + movt r02.34 + cmp/eq r0, r42.35 + bt test_cmpstr_2_ok2.36 + fail test_cmpstr_str_k2.37 +test_cmpstr_2_ok:2.38 + dt r102.39 + bf test_cmpstr_2_loop2.40 +2.41 +test_cmpstr_end:2.42 + mov.l @r15+, r102.43 + mov.l @r15+, r112.44 + end_test test_cmpstr_str_k2.45 +2.46 +test_cmpstr_data:2.47 + .long 0x818283842.48 + .long 0x828384852.49 + .long 0x000000002.50 +2.51 + .long 0x010403022.52 + .long 0x020103042.53 + .long 0x000000012.54 +2.55 + .long 0xAA55AA552.56 + .long 0x55AA55AA2.57 + .long 0x000000002.58 +2.59 + .long 0x123456782.60 + .long 0x123456782.61 + .long 0x000000012.62 +2.63 + .long 0xABCD01DC2.64 + .long 0xABCD01DD2.65 + .long 0x000000012.66 +2.67 + .long 0x120034232.68 + .long 0x123423002.69 + .long 0x000000012.70 +2.71 +test_cmpstr_str_k:2.72 + .long test_cmpstr_str2.73 +test_cmpstr_str:2.74 + .string "CMP/STR"2.75 +2.76 \ No newline at end of file
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +00003.2 +++ b/test/sh4/div0.s Tue Sep 04 08:30:22 2007 +00003.3 @@ -0,0 +1,80 @@3.4 +.section .text3.5 +.include "sh4/inc.s"3.6 +!3.7 +! Test DIV0 operation3.8 +!3.9 +.global _test_div03.10 +_test_div0:3.11 + start_test3.12 + mov.l r11, @-r153.13 + mov.l r10, @-r153.14 +3.15 +test_div0u:3.16 + add #1, r123.17 + stc sr, r23.18 + mov.l test_div0_sr_mask, r03.19 + or r0, r23.20 + ldc r2, sr3.21 +3.22 + div0u3.23 + stc sr, r33.24 + mov r3, r43.25 + and r0, r43.26 + tst r4, r43.27 + bf test_div0u_fail3.28 + not r0, r03.29 + and r0, r33.30 + and r0, r23.31 + cmp/eq r2, r33.32 + bt test_div0s3.33 +test_div0u_fail:3.34 + fail test_div0_str_k3.35 +3.36 +test_div0s:3.37 + mova test_div0s_data, r03.38 + mov r0, r113.39 + mov #4, r103.40 +3.41 +test_div0s_loop:3.42 + add #1, r123.43 + mov.l @r11+, r13.44 + mov.l @r11+, r23.45 + mov.l @r11+, r33.46 + div0s r1,r23.47 + stc sr, r43.48 + mov.l test_div0_sr_mask, r03.49 + and r0,r43.50 + cmp/eq r3,r43.51 + bt test_div0s_ok3.52 + fail test_div0_str_k3.53 +test_div0s_ok:3.54 + dt r103.55 + bf test_div0s_loop3.56 +3.57 +test_div0_end:3.58 + mov.l @r15+, r103.59 + mov.l @r15+, r113.60 + end_test test_div0_str_k3.61 +3.62 +test_div0s_data:3.63 + .long 0x012345673.64 + .long 0x123456783.65 + .long 0x000000003.66 + .long 0xFFFF89123.67 + .long 0x7ABC15263.68 + .long 0x000002013.69 + .long 0x554433223.70 + .long 0x800002343.71 + .long 0x000001013.72 + .long 0xFFFFFFFF3.73 + .long 0x9CD394953.74 + .long 0x000003003.75 +3.76 +test_div0_sr_mask:3.77 + .long 0x000003013.78 +3.79 +test_div0_str_k:3.80 + .long test_div0_str3.81 +test_div0_str:3.82 + .string "DIV0"3.83 +3.84 \ No newline at end of file
4.1 --- /dev/null Thu Jan 01 00:00:00 1970 +00004.2 +++ b/test/sh4/shld.s Tue Sep 04 08:30:22 2007 +00004.3 @@ -0,0 +1,127 @@4.4 +.section .text4.5 +.include "sh4/inc.s"4.6 +!4.7 +! Test SHAD/SHLD operation4.8 +!4.9 +.global _test_shld4.10 +_test_shld:4.11 + start_test4.12 + mov.l r11, @-r154.13 + mov.l r10, @-r154.14 +4.15 +test_shld_1:4.16 + mov #8, r114.17 + mova test_shld_data, r04.18 + mov r0, r104.19 +4.20 +test_shld_1_loop1:4.21 + add #1, r124.22 + mov.l @r10+, r24.23 + mov.l @r10+, r34.24 + mov.l @r10+, r44.25 + shld r3, r24.26 + cmp/eq r2, r44.27 + bt test_shld_1_ok4.28 + fail test_shld_str_k4.29 +test_shld_1_ok:4.30 + dt r114.31 + bf test_shld_1_loop14.32 +4.33 +test_shad_1: ! Same again, but using shad4.34 + mov #8, r114.35 + mova test_shad_data, r04.36 + mov r0, r104.37 +4.38 +test_shad_1_loop1:4.39 + add #1, r124.40 + mov.l @r10+, r24.41 + mov.l @r10+, r34.42 + mov.l @r10+, r44.43 + shad r3, r24.44 + cmp/eq r2, r44.45 + bt test_shad_1_ok4.46 + fail test_shld_str_k4.47 +test_shad_1_ok:4.48 + dt r114.49 + bf test_shad_1_loop14.50 +4.51 +test_shld_end:4.52 + mov.l @r15+, r104.53 + mov.l @r15+, r114.54 + end_test test_shld_str_k4.55 +4.56 +test_shld_data:4.57 + .long 0x123456784.58 + .long 04.59 + .long 0x123456784.60 +4.61 + .long 0xA8B9CADB4.62 + .long 0x000000104.63 + .long 0xCADB00004.64 +4.65 + .long 0x8A9BACBD4.66 + .long 0xFFFFFFF04.67 + .long 0x00008A9B4.68 +4.69 + .long 0x7A9BACBD4.70 + .long 0xFFFFFFF04.71 + .long 0x00007A9B4.72 +4.73 + .long 0x7891ACDC4.74 + .long 0x800000004.75 + .long 0x000000004.76 +4.77 + .long 0x8719C0104.78 + .long 0x800000004.79 + .long 0x000000004.80 +4.81 + .long 0x7891ACDF4.82 + .long 0x7FFFFFFF4.83 + .long 0x800000004.84 +4.85 + .long 0x8719C01E4.86 + .long 0x000000FF4.87 + .long 0x000000004.88 +4.89 +test_shad_data:4.90 + .long 0x123456784.91 + .long 04.92 + .long 0x123456784.93 +4.94 + .long 0xA8B9CADB4.95 + .long 0x000000104.96 + .long 0xCADB00004.97 +4.98 + .long 0x8A9BACBD4.99 + .long 0xFFFFFFF04.100 + .long 0xFFFF8A9B4.101 +4.102 + .long 0x7A9BACBD4.103 + .long 0xFFFFFFF04.104 + .long 0x00007A9B4.105 +4.106 + .long 0x7891ACDC4.107 + .long 0x800000004.108 + .long 0x000000004.109 +4.110 + .long 0x8719C0104.111 + .long 0x800000004.112 + .long 0xFFFFFFFF4.113 +4.114 + .long 0x7891ACDF4.115 + .long 0x7FFFFFFF4.116 + .long 0x800000004.117 +4.118 + .long 0x8719C01E4.119 + .long 0x000000FF4.120 + .long 0x000000004.121 +4.122 +test_shld_data_end:4.123 + .align 44.124 +test_shld_data_end_k:4.125 + .long test_shld_data_end4.126 +test_shld_str_k:4.127 + .long test_shld_str4.128 +test_shld_str:4.129 + .string "SHLD"4.130 +4.131 \ No newline at end of file
5.1 --- a/test/sh4/testsh4.c Tue Aug 28 08:47:35 2007 +00005.2 +++ b/test/sh4/testsh4.c Tue Sep 04 08:30:22 2007 +00005.3 @@ -54,10 +54,13 @@5.4 test_bf();5.5 test_bt();5.6 test_cmp();5.7 + test_cmpstr();5.8 + test_div0();5.9 test_float();5.10 test_fmov();5.11 test_ftrc();5.12 test_mac();5.13 + test_shld();5.14 fprintf( stdout, "--> %d/%d instruction tests passed (%d%%)\n\n",5.15 total_tests-total_fails, total_tests,5.16 ((total_tests-total_fails)*100)/total_tests );
.