Search
lxdream.org :: lxdream :: r399:23e51a2b4f99
lxdream 0.9.1
released Jun 29
Download Now
changeset399:23e51a2b4f99
parent398:16b0856ea511
child400:049d72a7a229
authornkeynes
dateThu Sep 20 08:34:23 2007 +0000 (16 years ago)
Add tests for TAS.B
test/Makefile
test/sh4/tas.s
test/sh4/testsh4.c
1.1 --- a/test/Makefile Wed Sep 19 12:09:33 2007 +0000
1.2 +++ b/test/Makefile Thu Sep 20 08:34:23 2007 +0000
1.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.so
1.10 $(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS)
1.11 $(SH4OBJCOPY) testsh4 testsh4.bin
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2.2 +++ b/test/sh4/tas.s Thu Sep 20 08:34:23 2007 +0000
2.3 @@ -0,0 +1,107 @@
2.4 +.section .text
2.5 +.include "sh4/inc.s"
2.6 +
2.7 +.global _test_tas
2.8 +_test_tas:
2.9 + start_test
2.10 +
2.11 +test_tas_1:
2.12 + add #1, r12
2.13 +
2.14 + mova test_tas_1_data, r0 ! test with byte == 0
2.15 + mov r0, r4
2.16 + mov r4, r5
2.17 + tas.b @r4
2.18 + bf test_tas_1_fail
2.19 + cmp/eq r4, r5
2.20 + bf test_tas_1_fail
2.21 + mov #0x40, r1
2.22 + shll r1
2.23 + mov.l test_tas_1_data, r3
2.24 + cmp/eq r1, r3
2.25 + bt test_tas_2
2.26 +
2.27 +test_tas_1_fail:
2.28 + fail test_tas_str_k
2.29 + bra test_tas_2
2.30 + nop
2.31 +test_tas_1_data:
2.32 + .long 0x00000000
2.33 +
2.34 +test_tas_2:
2.35 + add #1, r12
2.36 +
2.37 + mova test_tas_2_data, r0 ! test with byte == 0x80
2.38 + mov r0, r4
2.39 + mov r4, r5
2.40 + tas.b @r4 ! follow up test with byte == 0x00000080
2.41 + bt test_tas_2_fail
2.42 + cmp/eq r4, r5
2.43 + bf test_tas_2_fail
2.44 + mov.l @r4, r3
2.45 + mov #0x40, r1
2.46 + shll r1
2.47 + cmp/eq r1, r3
2.48 + bt test_tas_3
2.49 +test_tas_2_fail:
2.50 + fail test_tas_str_k
2.51 + bra test_tas_3
2.52 + nop
2.53 +test_tas_2_data:
2.54 + .long 0x00000080
2.55 +
2.56 +test_tas_3: ! Test with byte = 0x45 (ensure existing bits aren't changed)
2.57 + add #1, r12
2.58 + mova test_tas_3_data, r0
2.59 + mov r0, r4
2.60 + mov.l test_tas_3_result, r1
2.61 + mov r4, r5
2.62 + tas.b @r4
2.63 + bt test_tas_3_fail
2.64 + cmp/eq r4,r5
2.65 + bf test_tas_3_fail
2.66 + mov.l test_tas_3_data, r3
2.67 + cmp/eq r1, r3
2.68 + bt test_tas_4
2.69 +
2.70 +test_tas_3_fail:
2.71 + fail test_tas_str_k
2.72 + bra test_tas_4
2.73 + nop
2.74 +test_tas_3_data:
2.75 + .long 0x00000045
2.76 +test_tas_3_result:
2.77 + .long 0x000000C5
2.78 +
2.79 +test_tas_4: ! Test that it's really a byte op
2.80 + add #1, r12
2.81 + mova test_tas_4_data, r0
2.82 + mov r0, r4
2.83 + mov.l test_tas_4_result, r1
2.84 + add #1, r4
2.85 + mov r4, r5
2.86 + tas.b @r4
2.87 + bf test_tas_4_fail
2.88 + cmp/eq r4, r5
2.89 + mov.l test_tas_4_data, r3
2.90 + cmp/eq r1, r3
2.91 + bt test_tas_end
2.92 +test_tas_4_fail:
2.93 + fail test_tas_str_k
2.94 + bra test_tas_end
2.95 + nop
2.96 +test_tas_4_data:
2.97 + .long 0xAB9C00ED
2.98 +test_tas_4_result:
2.99 + .long 0xAB9C80ED
2.100 +
2.101 +test_tas_end:
2.102 + end_test test_tas_str_k
2.103 +
2.104 +test_tas_str:
2.105 + .string "TAS"
2.106 +
2.107 +.align 4
2.108 +test_tas_str_k:
2.109 + .long test_tas_str
2.110 +
2.111 \ No newline at end of file
3.1 --- a/test/sh4/testsh4.c Wed Sep 19 12:09:33 2007 +0000
3.2 +++ b/test/sh4/testsh4.c Thu Sep 20 08:34:23 2007 +0000
3.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,
.