Search
lxdream.org :: lxdream/test/sh4/tas.s :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename test/sh4/tas.s
changeset 399:23e51a2b4f99
author nkeynes
date Thu Sep 20 08:34:23 2007 +0000 (13 years ago)
permissions -rw-r--r--
last change Add tests for TAS.B
file annotate diff log raw
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/test/sh4/tas.s Thu Sep 20 08:34:23 2007 +0000
1.3 @@ -0,0 +1,107 @@
1.4 +.section .text
1.5 +.include "sh4/inc.s"
1.6 +
1.7 +.global _test_tas
1.8 +_test_tas:
1.9 + start_test
1.10 +
1.11 +test_tas_1:
1.12 + add #1, r12
1.13 +
1.14 + mova test_tas_1_data, r0 ! test with byte == 0
1.15 + mov r0, r4
1.16 + mov r4, r5
1.17 + tas.b @r4
1.18 + bf test_tas_1_fail
1.19 + cmp/eq r4, r5
1.20 + bf test_tas_1_fail
1.21 + mov #0x40, r1
1.22 + shll r1
1.23 + mov.l test_tas_1_data, r3
1.24 + cmp/eq r1, r3
1.25 + bt test_tas_2
1.26 +
1.27 +test_tas_1_fail:
1.28 + fail test_tas_str_k
1.29 + bra test_tas_2
1.30 + nop
1.31 +test_tas_1_data:
1.32 + .long 0x00000000
1.33 +
1.34 +test_tas_2:
1.35 + add #1, r12
1.36 +
1.37 + mova test_tas_2_data, r0 ! test with byte == 0x80
1.38 + mov r0, r4
1.39 + mov r4, r5
1.40 + tas.b @r4 ! follow up test with byte == 0x00000080
1.41 + bt test_tas_2_fail
1.42 + cmp/eq r4, r5
1.43 + bf test_tas_2_fail
1.44 + mov.l @r4, r3
1.45 + mov #0x40, r1
1.46 + shll r1
1.47 + cmp/eq r1, r3
1.48 + bt test_tas_3
1.49 +test_tas_2_fail:
1.50 + fail test_tas_str_k
1.51 + bra test_tas_3
1.52 + nop
1.53 +test_tas_2_data:
1.54 + .long 0x00000080
1.55 +
1.56 +test_tas_3: ! Test with byte = 0x45 (ensure existing bits aren't changed)
1.57 + add #1, r12
1.58 + mova test_tas_3_data, r0
1.59 + mov r0, r4
1.60 + mov.l test_tas_3_result, r1
1.61 + mov r4, r5
1.62 + tas.b @r4
1.63 + bt test_tas_3_fail
1.64 + cmp/eq r4,r5
1.65 + bf test_tas_3_fail
1.66 + mov.l test_tas_3_data, r3
1.67 + cmp/eq r1, r3
1.68 + bt test_tas_4
1.69 +
1.70 +test_tas_3_fail:
1.71 + fail test_tas_str_k
1.72 + bra test_tas_4
1.73 + nop
1.74 +test_tas_3_data:
1.75 + .long 0x00000045
1.76 +test_tas_3_result:
1.77 + .long 0x000000C5
1.78 +
1.79 +test_tas_4: ! Test that it's really a byte op
1.80 + add #1, r12
1.81 + mova test_tas_4_data, r0
1.82 + mov r0, r4
1.83 + mov.l test_tas_4_result, r1
1.84 + add #1, r4
1.85 + mov r4, r5
1.86 + tas.b @r4
1.87 + bf test_tas_4_fail
1.88 + cmp/eq r4, r5
1.89 + mov.l test_tas_4_data, r3
1.90 + cmp/eq r1, r3
1.91 + bt test_tas_end
1.92 +test_tas_4_fail:
1.93 + fail test_tas_str_k
1.94 + bra test_tas_end
1.95 + nop
1.96 +test_tas_4_data:
1.97 + .long 0xAB9C00ED
1.98 +test_tas_4_result:
1.99 + .long 0xAB9C80ED
1.100 +
1.101 +test_tas_end:
1.102 + end_test test_tas_str_k
1.103 +
1.104 +test_tas_str:
1.105 + .string "TAS"
1.106 +
1.107 +.align 4
1.108 +test_tas_str_k:
1.109 + .long test_tas_str
1.110 +
1.111 \ No newline at end of file
.