Search
lxdream.org :: lxdream/test/sh4/sub.s :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename test/sh4/sub.s
changeset 393:5e5335b61373
author nkeynes
date Wed Sep 19 09:13:08 2007 +0000 (13 years ago)
permissions -rw-r--r--
last change Add tests for SUB, SUBC and XTRCT
Add rounding tests for FTRC
file annotate diff log raw
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/test/sh4/sub.s Wed Sep 19 09:13:08 2007 +0000
1.3 @@ -0,0 +1,119 @@
1.4 +.section .text
1.5 +.include "sh4/inc.s"
1.6 +
1.7 +.global _test_sub
1.8 +_test_sub:
1.9 + start_test
1.10 +
1.11 +test_sub_1: ! test subing 0+0 = 0
1.12 + add #1, r12
1.13 + xor r0,r0
1.14 + xor r1,r1
1.15 + xor r2,r2
1.16 + sett
1.17 + sub r0,r1
1.18 + bf test_sub_1_fail
1.19 + cmp/eq r1, r2
1.20 + bt test_sub_2
1.21 +test_sub_1_fail:
1.22 + fail test_sub_str_k
1.23 +
1.24 +test_sub_2: ! test 0+ constant 1 = 1
1.25 + add #1, r12
1.26 + xor r0, r0
1.27 + xor r1, r1
1.28 + mov.l test_sub_2_input, r0
1.29 + mov.l test_sub_2_result, r2
1.30 + clrt
1.31 + sub r0, r1
1.32 + bt test_sub_2_fail
1.33 + cmp/eq r1, r2
1.34 + bt test_sub_3
1.35 +test_sub_2_fail:
1.36 + fail test_sub_str_k
1.37 + bra test_sub_3
1.38 + nop
1.39 +
1.40 + .align 4
1.41 +test_sub_2_input:
1.42 + .long 0x00000001
1.43 +test_sub_2_result:
1.44 + .long 0xFFFFFFFF
1.45 +
1.46 +test_sub_3: ! test 0 + constant -1 = -1
1.47 + add #1, r12
1.48 + mov.l test_sub_3_input_1, r0
1.49 + mov r0, r1
1.50 + mov.l test_sub_3_input_2, r1
1.51 + sett
1.52 + sub r0, r1
1.53 + bf test_sub_3_fail
1.54 + mov.l test_sub_3_result, r2
1.55 + cmp/eq r1, r2
1.56 + bt test_sub_4
1.57 +test_sub_3_fail:
1.58 + fail test_sub_str_k
1.59 + bra test_sub_4
1.60 + nop
1.61 +
1.62 + .align 4
1.63 +test_sub_3_input_1:
1.64 + .long 0xFFFFFF84
1.65 +test_sub_3_input_2:
1.66 + .long 0x43217000
1.67 +test_sub_3_result:
1.68 + .long 0x4321707C
1.69 +
1.70 +test_sub_4: ! Test 0 result
1.71 + add #1, r12
1.72 + mov.l test_sub_4_op1, r2
1.73 + mov.l test_sub_4_op2, r1
1.74 + mov r2, r3
1.75 + sub r1, r3
1.76 + mov.l test_sub_4_result_1, r0
1.77 + cmp/eq r0, r3
1.78 + bf test_sub_4_fail
1.79 + mov r2, r3
1.80 + sub r3, r1
1.81 + mov.l test_sub_4_result_2, r2
1.82 + cmp/eq r1, r2
1.83 + bt test_sub_5
1.84 +test_sub_4_fail:
1.85 + fail test_sub_str_k
1.86 + bra test_sub_5
1.87 + nop
1.88 +test_sub_4_op1:
1.89 + .long 0x00000001
1.90 +test_sub_4_op2:
1.91 + .long 0xFFFFFFFF
1.92 +test_sub_4_result_1:
1.93 + .long 0x00000002
1.94 +test_sub_4_result_2:
1.95 + .long 0xFFFFFFFE
1.96 +
1.97 +test_sub_5:
1.98 + add #1, r12
1.99 + mov.l test_sub_5_op, r2
1.100 + sett
1.101 + sub r2, r2
1.102 + bf test_sub_5_fail
1.103 + tst r2, r2
1.104 + bt test_sub_end
1.105 +test_sub_5_fail:
1.106 + fail test_sub_str_k
1.107 + bra test_sub_end
1.108 + nop
1.109 +
1.110 +test_sub_5_op:
1.111 + .long 0xABCD1234
1.112 +
1.113 +test_sub_end:
1.114 + end_test test_sub_str_k
1.115 +
1.116 +test_sub_str:
1.117 + .string "SUB"
1.118 +
1.119 +.align 4
1.120 +test_sub_str_k:
1.121 + .long test_sub_str
1.122 +
1.123 \ No newline at end of file
.