Search
lxdream.org :: lxdream :: r396:0738dbc01d95
lxdream 0.9.1
released Jun 29
Download Now
changeset396:0738dbc01d95
parent395:c473acbde186
child397:640324505325
authornkeynes
dateWed Sep 19 11:22:43 2007 +0000 (16 years ago)
Add tests for SHLL, SHLR, SHAL, SHAR, ROTL, ROTR, ROTCL and ROTCR
test/Makefile
test/sh4/rot.s
test/sh4/shl.s
test/sh4/testsh4.c
1.1 --- a/test/Makefile Wed Sep 19 10:04:16 2007 +0000
1.2 +++ b/test/Makefile Wed Sep 19 11:22:43 2007 +0000
1.3 @@ -75,7 +75,8 @@
1.4 sh4/add.so sh4/addc.so sh4/addv.so sh4/and.so sh4/andi.so \
1.5 sh4/bf.so sh4/bt.so sh4/cmp.so sh4/cmpstr.so sh4/div0.so \
1.6 sh4/div1.so sh4/float.so sh4/fmov.so sh4/ftrc.so sh4/mac.s \
1.7 - sh4/shld.so sh4/sub.so sh4/subc.so sh4/xtrct.so \
1.8 + sh4/rot.so sh4/shl.so sh4/shld.so sh4/sub.so sh4/subc.so \
1.9 + sh4/xtrct.so \
1.10 sh4/excslot.so sh4/undef.so
1.11 $(SH4CC) $(SH4LDFLAGS) $^ -o $@ $(SH4LIBS)
1.12 $(SH4OBJCOPY) testsh4 testsh4.bin
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2.2 +++ b/test/sh4/rot.s Wed Sep 19 11:22:43 2007 +0000
2.3 @@ -0,0 +1,171 @@
2.4 +.section .text
2.5 +.include "sh4/inc.s"
2.6 +
2.7 +.global _test_rot
2.8 +_test_rot:
2.9 + start_test
2.10 +
2.11 +test_rotl_1:
2.12 + add #1, r12
2.13 +
2.14 + mov.l test_rotl_1_input, r3
2.15 + mov.l test_rotl_1_result, r4
2.16 + clrt
2.17 + rotl r3
2.18 + bf test_rotl_1_fail
2.19 + cmp/eq r3, r4
2.20 + bt test_rotl_2
2.21 +test_rotl_1_fail:
2.22 + fail test_rot_str_k
2.23 + bra test_rotl_2
2.24 + nop
2.25 +test_rotl_1_input:
2.26 + .long 0x94E12323
2.27 +test_rotl_1_result:
2.28 + .long 0x29C24647
2.29 +
2.30 +test_rotl_2:
2.31 + add #1, r12
2.32 + mov.l test_rotl_2_input, r3
2.33 + mov.l test_rotl_2_result, r4
2.34 + sett
2.35 + rotl r3
2.36 + bt test_rotl_2_fail
2.37 + cmp/eq r3, r4
2.38 + bt test_rotcl_1
2.39 +test_rotl_2_fail:
2.40 + fail test_rot_str_k
2.41 + bra test_rotcl_1
2.42 + nop
2.43 +test_rotl_2_input:
2.44 + .long 0x29C24646
2.45 +test_rotl_2_result:
2.46 + .long 0x53848C8C
2.47 +
2.48 +
2.49 +test_rotcl_1:
2.50 + add #1, r12
2.51 +
2.52 + mov.l test_rotcl_1_input, r3
2.53 + mov.l test_rotcl_1_result, r4
2.54 + clrt
2.55 + rotcl r3
2.56 + bf test_rotcl_1_fail
2.57 + cmp/eq r3, r4
2.58 + bt test_rotcl_2
2.59 +test_rotcl_1_fail:
2.60 + fail test_rot_str_k
2.61 + bra test_rotcl_2
2.62 + nop
2.63 +test_rotcl_1_input:
2.64 + .long 0x94E12323
2.65 +test_rotcl_1_result:
2.66 + .long 0x29C24646
2.67 +
2.68 +test_rotcl_2:
2.69 + add #1, r12
2.70 + mov.l test_rotcl_2_input, r3
2.71 + mov.l test_rotcl_2_result, r4
2.72 + sett
2.73 + rotcl r3
2.74 + bt test_rotcl_2_fail
2.75 + cmp/eq r3, r4
2.76 + bt test_rotr_1
2.77 +test_rotcl_2_fail:
2.78 + fail test_rot_str_k
2.79 + bra test_rotr_1
2.80 + nop
2.81 +test_rotcl_2_input:
2.82 + .long 0x29C24646
2.83 +test_rotcl_2_result:
2.84 + .long 0x53848C8D
2.85 +
2.86 +test_rotr_1:
2.87 + add #1, r12
2.88 +
2.89 + mov.l test_rotr_1_input, r3
2.90 + mov.l test_rotr_1_result, r4
2.91 + clrt
2.92 + rotr r3
2.93 + bf test_rotr_1_fail
2.94 + cmp/eq r3, r4
2.95 + bt test_rotr_2
2.96 +test_rotr_1_fail:
2.97 + fail test_rot_str_k
2.98 + bra test_rotr_2
2.99 + nop
2.100 +test_rotr_1_input:
2.101 + .long 0x94E12323
2.102 +test_rotr_1_result:
2.103 + .long 0xCA709191
2.104 +
2.105 +test_rotr_2:
2.106 + add #1, r12
2.107 + mov.l test_rotr_2_input, r3
2.108 + mov.l test_rotr_2_result, r4
2.109 + sett
2.110 + rotr r3
2.111 + bt test_rotr_2_fail
2.112 + cmp/eq r3, r4
2.113 + bt test_rotcr_1
2.114 +test_rotr_2_fail:
2.115 + fail test_rot_str_k
2.116 + bra test_rotcr_1
2.117 + nop
2.118 +test_rotr_2_input:
2.119 + .long 0xC2709192
2.120 +test_rotr_2_result:
2.121 + .long 0x613848C9
2.122 +
2.123 +
2.124 +test_rotcr_1:
2.125 + add #1, r12
2.126 +
2.127 + mov.l test_rotcr_1_input, r3
2.128 + mov.l test_rotcr_1_result, r4
2.129 + clrt
2.130 + rotcr r3
2.131 + bf test_rotcr_1_fail
2.132 + cmp/eq r3, r4
2.133 + bt test_rotcr_2
2.134 +test_rotcr_1_fail:
2.135 + fail test_rot_str_k
2.136 + bra test_rotcr_2
2.137 + nop
2.138 +test_rotcr_1_input:
2.139 + .long 0x94E12323
2.140 +test_rotcr_1_result:
2.141 + .long 0x4A709191
2.142 +
2.143 +test_rotcr_2:
2.144 + add #1, r12
2.145 + mov.l test_rotcr_2_input, r3
2.146 + mov.l test_rotcr_2_result, r4
2.147 + sett
2.148 + rotcr r3
2.149 + bt test_rotcr_2_fail
2.150 + cmp/eq r3, r4
2.151 + bt test_rot_end
2.152 +test_rotcr_2_fail:
2.153 + fail test_rot_str_k
2.154 + bra test_rot_end
2.155 + nop
2.156 +test_rotcr_2_input:
2.157 + .long 0xC2709192
2.158 +test_rotcr_2_result:
2.159 + .long 0xE13848C9
2.160 +
2.161 +
2.162 +
2.163 +
2.164 +
2.165 +test_rot_end:
2.166 + end_test test_rot_str_k
2.167 +
2.168 +test_rot_str:
2.169 + .string "ROT"
2.170 +
2.171 +.align 4
2.172 +test_rot_str_k:
2.173 + .long test_rot_str
2.174 +
2.175 \ No newline at end of file
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
3.2 +++ b/test/sh4/shl.s Wed Sep 19 11:22:43 2007 +0000
3.3 @@ -0,0 +1,168 @@
3.4 +.section .text
3.5 +.include "sh4/inc.s"
3.6 +
3.7 +.global _test_shl
3.8 +_test_shl:
3.9 + start_test
3.10 +
3.11 +test_shll_1:
3.12 + add #1, r12
3.13 +
3.14 + mov.l test_shll_1_input, r3
3.15 + mov.l test_shll_1_result, r4
3.16 + clrt
3.17 + shll r3
3.18 + bf test_shll_1_fail
3.19 + cmp/eq r3, r4
3.20 + bt test_shll_2
3.21 +test_shll_1_fail:
3.22 + fail test_shl_str_k
3.23 + bra test_shll_2
3.24 + nop
3.25 +test_shll_1_input:
3.26 + .long 0x94E12323
3.27 +test_shll_1_result:
3.28 + .long 0x29C24646
3.29 +
3.30 +test_shll_2:
3.31 + add #1, r12
3.32 + mov.l test_shll_2_input, r3
3.33 + mov.l test_shll_2_result, r4
3.34 + sett
3.35 + shll r3
3.36 + bt test_shll_2_fail
3.37 + cmp/eq r3, r4
3.38 + bt test_shal_1
3.39 +test_shll_2_fail:
3.40 + fail test_shl_str_k
3.41 + bra test_shal_1
3.42 + nop
3.43 +test_shll_2_input:
3.44 + .long 0x29C24646
3.45 +test_shll_2_result:
3.46 + .long 0x53848C8C
3.47 +
3.48 +test_shal_1:
3.49 + add #1, r12
3.50 +
3.51 + mov.l test_shal_1_input, r3
3.52 + mov.l test_shal_1_result, r4
3.53 + clrt
3.54 + shal r3
3.55 + bf test_shal_1_fail
3.56 + cmp/eq r3, r4
3.57 + bt test_shal_2
3.58 +test_shal_1_fail:
3.59 + fail test_shl_str_k
3.60 + bra test_shal_2
3.61 + nop
3.62 +test_shal_1_input:
3.63 + .long 0x94E12323
3.64 +test_shal_1_result:
3.65 + .long 0x29C24646
3.66 +
3.67 +test_shal_2:
3.68 + add #1, r12
3.69 + mov.l test_shal_2_input, r3
3.70 + mov.l test_shal_2_result, r4
3.71 + sett
3.72 + shal r3
3.73 + bt test_shal_2_fail
3.74 + cmp/eq r3, r4
3.75 + bt test_shlr_1
3.76 +test_shal_2_fail:
3.77 + fail test_shl_str_k
3.78 + bra test_shlr_1
3.79 + nop
3.80 +test_shal_2_input:
3.81 + .long 0x29C24646
3.82 +test_shal_2_result:
3.83 + .long 0x53848C8C
3.84 +
3.85 +test_shlr_1:
3.86 + add #1, r12
3.87 +
3.88 + mov.l test_shlr_1_input, r3
3.89 + mov.l test_shlr_1_result, r4
3.90 + clrt
3.91 + shlr r3
3.92 + bf test_shlr_1_fail
3.93 + cmp/eq r3, r4
3.94 + bt test_shlr_2
3.95 +test_shlr_1_fail:
3.96 + fail test_shl_str_k
3.97 + bra test_shlr_2
3.98 + nop
3.99 +test_shlr_1_input:
3.100 + .long 0x94E12323
3.101 +test_shlr_1_result:
3.102 + .long 0x4A709191
3.103 +
3.104 +test_shlr_2:
3.105 + add #1, r12
3.106 + mov.l test_shlr_2_input, r3
3.107 + mov.l test_shlr_2_result, r4
3.108 + sett
3.109 + shlr r3
3.110 + bt test_shlr_2_fail
3.111 + cmp/eq r3, r4
3.112 + bt test_shar_1
3.113 +test_shlr_2_fail:
3.114 + fail test_shl_str_k
3.115 + bra test_shar_1
3.116 + nop
3.117 +test_shlr_2_input:
3.118 + .long 0x42709192
3.119 +test_shlr_2_result:
3.120 + .long 0x213848C9
3.121 +
3.122 +
3.123 +test_shar_1:
3.124 + add #1, r12
3.125 +
3.126 + mov.l test_shar_1_input, r3
3.127 + mov.l test_shar_1_result, r4
3.128 + clrt
3.129 + shar r3
3.130 + bf test_shar_1_fail
3.131 + cmp/eq r3, r4
3.132 + bt test_shar_2
3.133 +test_shar_1_fail:
3.134 + fail test_shl_str_k
3.135 + bra test_shar_2
3.136 + nop
3.137 +test_shar_1_input:
3.138 + .long 0x94E12323
3.139 +test_shar_1_result:
3.140 + .long 0xCA709191
3.141 +
3.142 +test_shar_2:
3.143 + add #1, r12
3.144 + mov.l test_shar_2_input, r3
3.145 + mov.l test_shar_2_result, r4
3.146 + sett
3.147 + shar r3
3.148 + bt test_shar_2_fail
3.149 + cmp/eq r3, r4
3.150 + bt test_shl_end
3.151 +test_shar_2_fail:
3.152 + fail test_shl_str_k
3.153 + bra test_shl_end
3.154 + nop
3.155 +test_shar_2_input:
3.156 + .long 0x42709192
3.157 +test_shar_2_result:
3.158 + .long 0x213848C9
3.159 +
3.160 +
3.161 +
3.162 +test_shl_end:
3.163 + end_test test_shl_str_k
3.164 +
3.165 +test_shl_str:
3.166 + .string "SHL"
3.167 +
3.168 +.align 4
3.169 +test_shl_str_k:
3.170 + .long test_shl_str
3.171 +
3.172 \ No newline at end of file
4.1 --- a/test/sh4/testsh4.c Wed Sep 19 10:04:16 2007 +0000
4.2 +++ b/test/sh4/testsh4.c Wed Sep 19 11:22:43 2007 +0000
4.3 @@ -61,6 +61,8 @@
4.4 test_fmov();
4.5 test_ftrc();
4.6 test_mac();
4.7 + test_rot();
4.8 + test_shl();
4.9 test_shld();
4.10 test_sub();
4.11 test_subc();
.