Search
lxdream.org :: lxdream/test/sh4/fmov.s :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename test/sh4/fmov.s
changeset 358:65043a8f5785
next732:f05753bbe723
author nkeynes
date Thu Aug 23 12:31:31 2007 +0000 (13 years ago)
permissions -rw-r--r--
last change Add tests for mac.l and mac.w
Start test cases for fmov
Update exception tests
file annotate diff log raw
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/test/sh4/fmov.s Thu Aug 23 12:31:31 2007 +0000
1.3 @@ -0,0 +1,320 @@
1.4 +.section .text
1.5 +.include "sh4/inc.s"
1.6 +!
1.7 +! Test fmov (all variants)
1.8 +! (not arithmetic)
1.9 +
1.10 +.global _test_fmov
1.11 +_test_fmov:
1.12 + start_test
1.13 +
1.14 + xor r0,r0
1.15 + lds r0, fpscr
1.16 +
1.17 +test_fmov_1: ! single precision reg-to-reg
1.18 + add #1, r12
1.19 +
1.20 + fldi0 fr0
1.21 + fldi1 fr1
1.22 + flds fr0, fpul
1.23 + sts fpul, r0
1.24 + tst r0, r0
1.25 + bf test_fmov_1_fail
1.26 + fmov fr1, fr0
1.27 + flds fr0, fpul
1.28 + sts fpul, r0
1.29 + mov.l test_fmov_1_result, r1
1.30 + cmp/eq r0, r1
1.31 + bt test_fmov_2
1.32 +test_fmov_1_fail:
1.33 + fail test_fmov_str_k
1.34 + bra test_fmov_2
1.35 + nop
1.36 +
1.37 +test_fmov_1_result:
1.38 + .long 0x3F800000
1.39 +
1.40 +test_fmov_2: ! reg-to-reg double prec
1.41 + add #1, r12
1.42 + mov.l test_fmov_2_input_a, r1
1.43 + lds r1, fpul
1.44 + fsts fpul, fr4
1.45 + mov.l test_fmov_2_input_b, r3
1.46 + lds r3, fpul
1.47 + fsts fpul, fr5
1.48 + fldi0 fr8
1.49 + fldi0 fr9
1.50 + fschg
1.51 + flds fr8, fpul
1.52 + sts fpul, r0
1.53 + tst r0, r0
1.54 + bf test_fmov_2_fail
1.55 + flds fr9, fpul
1.56 + sts fpul, r0
1.57 + tst r0, r0
1.58 + bf test_fmov_2_fail
1.59 + fmov fr4, fr8
1.60 + flds fr8, fpul
1.61 + sts fpul, r0
1.62 + flds fr9, fpul
1.63 + sts fpul, r2
1.64 + cmp/eq r0, r1
1.65 + bf test_fmov_2_fail
1.66 + cmp/eq r2, r3
1.67 + bt test_fmov_3
1.68 +test_fmov_2_fail:
1.69 + fail test_fmov_str_k
1.70 + bra test_fmov_3
1.71 + nop
1.72 +test_fmov_2_input_a:
1.73 + .long 0x12345678
1.74 +test_fmov_2_input_b:
1.75 + .long 0x9ABCDEF0
1.76 +
1.77 +test_fmov_3: ! double size DRm to XDn
1.78 + add #1, r12
1.79 + frchg
1.80 + fldi0 fr8
1.81 + fldi0 fr9
1.82 + frchg
1.83 + fldi0 fr8
1.84 + fldi0 fr9
1.85 + mov.l test_fmov_3_input_a, r2
1.86 + lds r2, fpul
1.87 + fsts fpul, fr2
1.88 + mov.l test_fmov_3_input_b, r3
1.89 + lds r3, fpul
1.90 + fsts fpul, fr3
1.91 +
1.92 + fmov fr2, fr9
1.93 + flds fr8, fpul
1.94 + sts fpul, r0
1.95 + flds fr9, fpul
1.96 + sts fpul, r1
1.97 + tst r0, r0
1.98 + bf test_fmov_3_fail
1.99 + tst r1, r1
1.100 + bf test_fmov_3_fail
1.101 + frchg
1.102 + flds fr8, fpul
1.103 + sts fpul, r0
1.104 + flds fr9, fpul
1.105 + sts fpul, r1
1.106 + cmp/eq r0, r2
1.107 + bf test_fmov_3_fail
1.108 + cmp/eq r1, r3
1.109 + bt test_fmov_4
1.110 +
1.111 +test_fmov_3_fail:
1.112 + fail test_fmov_str_k
1.113 + bra test_fmov_4
1.114 + nop
1.115 +
1.116 +test_fmov_3_input_a:
1.117 + .long 0x86421357
1.118 +test_fmov_3_input_b:
1.119 + .long 0x97532468
1.120 +
1.121 +test_fmov_4: ! double size XDm to DRn
1.122 + add #1, r12
1.123 + mov.l test_fmov_4_input_a, r2
1.124 + lds r2, fpul
1.125 + fsts fpul, fr6
1.126 + mov.l test_fmov_4_input_b, r3
1.127 + lds r3, fpul
1.128 + fsts fpul, fr7
1.129 + fldi0 fr0
1.130 + fldi0 fr1
1.131 + frchg
1.132 + fldi0 fr6
1.133 + fldi0 fr7
1.134 +
1.135 + fmov fr7, fr0
1.136 + flds fr0, fpul
1.137 + sts fpul, r0
1.138 + flds fr1, fpul
1.139 + sts fpul, r1
1.140 + cmp/eq r0, r2
1.141 + bf test_fmov_4_fail
1.142 + cmp/eq r1, r3
1.143 + bf test_fmov_4_fail
1.144 + frchg
1.145 + flds fr0, fpul
1.146 + sts fpul, r0
1.147 + flds fr1, fpul
1.148 + sts fpul, r1
1.149 + tst r0, r0
1.150 + bf test_fmov_4_fail
1.151 + tst r1, r1
1.152 + bt test_fmov_5
1.153 +
1.154 +test_fmov_4_fail:
1.155 + fail test_fmov_str_k
1.156 + bra test_fmov_5
1.157 + nop
1.158 +
1.159 +test_fmov_4_input_a:
1.160 + .long 0xACADACA0
1.161 +test_fmov_4_input_b:
1.162 + .long 0x12233445
1.163 +
1.164 +
1.165 +test_fmov_5: ! double size @Rm to DRn, DRm to @Rn
1.166 + add #1, r12
1.167 + mova test_fmov_5_data_a, r0
1.168 + mov r0, r4
1.169 + xor r1, r1
1.170 + mov.l r1, @r0
1.171 + add #4, r0
1.172 + mov.l r1, @r0
1.173 + mova test_fmov_5_input_a, r0
1.174 + fmov @r0, fr8
1.175 + mov.l test_fmov_5_input_a, r0
1.176 + mov.l test_fmov_5_input_b, r1
1.177 + flds fr8, fpul
1.178 + sts fpul, r5
1.179 + flds fr9, fpul
1.180 + sts fpul, r6
1.181 + cmp/eq r0, r5
1.182 + bf test_fmov_5_fail
1.183 + cmp/eq r1, r6
1.184 + bf test_fmov_5_fail
1.185 + fmov fr8, @r4
1.186 + mov.l test_fmov_5_data_a, r2
1.187 + mov.l test_fmov_5_data_b, r3
1.188 + cmp/eq r0, r2
1.189 + bf test_fmov_5_fail
1.190 + cmp/eq r1, r3
1.191 + bt test_fmov_6
1.192 +test_fmov_5_fail:
1.193 + fail test_fmov_str_k
1.194 + bra test_fmov_6
1.195 + nop
1.196 +
1.197 +test_fmov_5_input_a:
1.198 + .long 0xFEEDBEEF
1.199 +test_fmov_5_input_b:
1.200 + .long 0xDEAD1234
1.201 +test_fmov_5_data_a:
1.202 + .long 0
1.203 +test_fmov_5_data_b:
1.204 + .long 0
1.205 +
1.206 +test_fmov_6: ! double size @Rm+ to DRn, DRm to @-Rn
1.207 + add #1, r12
1.208 + mova test_fmov_6_data_a, r0
1.209 + mov r0, r4
1.210 + xor r1, r1
1.211 + mov.l r1, @r4
1.212 + add #4, r4
1.213 + mov.l r1, @r4
1.214 + add #4, r4
1.215 + mova test_fmov_6_input_a, r0
1.216 + mov r0, r7
1.217 + fmov @r7+, fr10
1.218 + mov.l test_fmov_6_input_a, r0
1.219 + mov.l test_fmov_6_input_b, r1
1.220 + flds fr10, fpul
1.221 + sts fpul, r5
1.222 + flds fr11, fpul
1.223 + sts fpul, r6
1.224 + cmp/eq r0, r5
1.225 + bf test_fmov_6_fail
1.226 + cmp/eq r1, r6
1.227 + bf test_fmov_6_fail
1.228 + fmov fr10, @-r4
1.229 + mov.l test_fmov_6_data_a, r2
1.230 + mov.l test_fmov_6_data_b, r3
1.231 + cmp/eq r0, r2
1.232 + bf test_fmov_6_fail
1.233 + cmp/eq r1, r3
1.234 + bf test_fmov_6_fail
1.235 + mova test_fmov_6_data_a, r0
1.236 + cmp/eq r0, r4
1.237 + bf test_fmov_6_fail
1.238 + cmp/eq r0, r7
1.239 + bt test_fmov_7
1.240 +test_fmov_6_fail:
1.241 + fail test_fmov_str_k
1.242 + bra test_fmov_7
1.243 + nop
1.244 +
1.245 +test_fmov_6_input_a:
1.246 + .long 0x42318576
1.247 +test_fmov_6_input_b:
1.248 + .long 0xF0AFD34F
1.249 +test_fmov_6_data_a:
1.250 + .long 0
1.251 +test_fmov_6_data_b:
1.252 + .long 0
1.253 +
1.254 +test_fmov_7: ! double size @Rm,@R0 to DRn, DRm to @Rn,@R0
1.255 + add #1, r12
1.256 + mova test_fmov_7_data_a, r0
1.257 + mov r0, r4
1.258 + xor r1, r1
1.259 + mov.l r1, @r4
1.260 + add #4, r4
1.261 + mov.l r1, @r4
1.262 + add #48, r4
1.263 + mova test_fmov_7_input_a, r0
1.264 + mov r0, r7
1.265 + xor r0, r0
1.266 + add #-31, r7
1.267 + add #31, r0
1.268 + fmov @(r0,r7), fr10
1.269 + mov.l test_fmov_7_input_a, r0
1.270 + mov.l test_fmov_7_input_b, r1
1.271 + flds fr10, fpul
1.272 + sts fpul, r5
1.273 + flds fr11, fpul
1.274 + sts fpul, r6
1.275 + cmp/eq r0, r5
1.276 + bf test_fmov_7_fail
1.277 + cmp/eq r1, r6
1.278 + bf test_fmov_7_fail
1.279 + xor r0, r0
1.280 + add #-52, r0
1.281 + fmov fr10, @(r0,r4)
1.282 + mov.l test_fmov_7_input_a, r0
1.283 + mov.l test_fmov_7_data_a, r2
1.284 + mov.l test_fmov_7_data_b, r3
1.285 + cmp/eq r0, r2
1.286 + bf test_fmov_7_fail
1.287 + cmp/eq r1, r3
1.288 + bf test_fmov_7_fail
1.289 + mova test_fmov_7_data_a, r0
1.290 + add #52, r0
1.291 + cmp/eq r0, r4
1.292 + bf test_fmov_7_fail
1.293 + mova test_fmov_7_input_a, r0
1.294 + add #-31, r0
1.295 + cmp/eq r0, r7
1.296 + bt test_fmov_8
1.297 +test_fmov_7_fail:
1.298 + fail test_fmov_str_k
1.299 + bra test_fmov_8
1.300 + nop
1.301 +
1.302 +test_fmov_7_input_a:
1.303 + .long 0xABBACADA
1.304 +test_fmov_7_input_b:
1.305 + .long 0x43546576
1.306 +test_fmov_7_data_a:
1.307 + .long 0
1.308 +test_fmov_7_data_b:
1.309 + .long 0
1.310 +
1.311 +test_fmov_8:
1.312 +
1.313 +test_fmov_end:
1.314 + xor r0, r0
1.315 + lds r0, fpscr
1.316 + end_test test_fmov_str_k
1.317 +
1.318 +test_fmov_str:
1.319 + .string "FMOV"
1.320 +
1.321 +.align 4
1.322 +test_fmov_str_k:
1.323 + .long test_fmov_str
.