Search
lxdream.org :: lxdream/test/sh4/andi.s :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename test/sh4/andi.s
changeset 226:0eeeb25447d3
next228:70adc8ffa8d1
author nkeynes
date Sat Sep 23 10:35:29 2006 +0000 (14 years ago)
permissions -rw-r--r--
last change SH4 tests: Add tests for addc, addv, and
file annotate diff log raw
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/test/sh4/andi.s Sat Sep 23 10:35:29 2006 +0000
1.3 @@ -0,0 +1,85 @@
1.4 +.section .text
1.5 +.include "sh4/inc.s"
1.6 +!
1.7 +! Test AND #imm, R0 operation
1.8 +! Test AND #imm, @(r0,GBR)
1.9 +
1.10 +.global _test_andi
1.11 +_test_andi:
1.12 + start_test
1.13 +
1.14 +test_andi_1: ! test and ff, 0
1.15 + add #1, r12
1.16 + xor r0, r0
1.17 + xor r1, r1
1.18 + and #255, r0
1.19 + cmp/eq r0, r1
1.20 + bt test_andi_2
1.21 + fail test_andi_str_k
1.22 +
1.23 +test_andi_2: ! test 0-extend
1.24 + add #1, r12
1.25 + mov.l test_andi_2_op1, r0
1.26 + and #255, r0
1.27 + mov.l test_andi_2_result, r4
1.28 + cmp/eq r0, r4
1.29 + bt test_andi_3
1.30 + fail test_andi_str_k
1.31 + bra test_andi_3
1.32 + nop
1.33 +
1.34 +test_andi_2_op1:
1.35 + .long 0x98765432
1.36 +test_andi_2_result:
1.37 + .long 0x00000032
1.38 +
1.39 +test_andi_3: ! Test single-bit AND
1.40 + add #1, r12
1.41 + mov.l test_andi_3_op1, r0
1.42 + and #128, r0
1.43 + mov.l test_andi_3_result, r3
1.44 + cmp/eq r0, r3
1.45 + bt test_andi_4
1.46 + fail test_andi_str_k
1.47 + bra test_andi_4
1.48 + nop
1.49 +test_andi_3_op1:
1.50 + .long 0x123456AB
1.51 +test_andi_3_result:
1.52 + .long 0x00000080
1.53 +
1.54 +test_andi_4: ! Test GBR version
1.55 + add #1, r12
1.56 + stc gbr, r4
1.57 + mov.l test_andi_4_gbr, r0
1.58 + ldc r0, gbr
1.59 + mov.l test_andi_4_op1, r0
1.60 + and.b #254, @(r0,gbr)
1.61 + ldc r4, gbr
1.62 + mov.l test_andi_4_output, r1
1.63 + mov.l test_andi_4_result, r2
1.64 + cmp/eq r1, r2
1.65 + bt test_andi_5
1.66 + fail test_andi_str_k
1.67 + bra test_andi_5
1.68 + nop
1.69 +test_andi_4_gbr:
1.70 + .long test_andi_4_gbr
1.71 +test_andi_4_op1:
1.72 + .long 0x00000008
1.73 +test_andi_4_output:
1.74 + .long 0x123456AB
1.75 +test_andi_4_result:
1.76 + .long 0x123456AA
1.77 +
1.78 +test_andi_5:
1.79 +test_andi_end:
1.80 + end_test test_andi_str_k
1.81 +
1.82 +test_andi_str:
1.83 + .string "ANDi"
1.84 +
1.85 +.align 4
1.86 +test_andi_str_k:
1.87 + .long test_andi_str
1.88 +
1.89 \ No newline at end of file
.