filename | test/sh4/andi.s |
changeset | 228:70adc8ffa8d1 |
prev | 226:0eeeb25447d3 |
author | nkeynes |
date | Wed Oct 31 09:05:44 2007 +0000 (16 years ago) |
permissions | -rw-r--r-- |
last change | Add convenience MMIO_ADDR macro |
view | annotate | diff | log | raw |
1 .section .text
2 .include "sh4/inc.s"
3 !
4 ! Test AND #imm, R0 operation
5 ! Test AND #imm, @(r0,GBR)
7 .global _test_andi
8 _test_andi:
9 start_test
11 test_andi_1: ! test and ff, 0
12 add #1, r12
13 xor r0, r0
14 xor r1, r1
15 and #255, r0
16 cmp/eq r0, r1
17 bt test_andi_2
18 fail test_andi_str_k
20 test_andi_2: ! test 0-extend
21 add #1, r12
22 mov.l test_andi_2_op1, r0
23 and #255, r0
24 mov.l test_andi_2_result, r4
25 cmp/eq r0, r4
26 bt test_andi_3
27 fail test_andi_str_k
28 bra test_andi_3
29 nop
31 test_andi_2_op1:
32 .long 0x98765432
33 test_andi_2_result:
34 .long 0x00000032
36 test_andi_3: ! Test single-bit AND
37 add #1, r12
38 mov.l test_andi_3_op1, r0
39 and #128, r0
40 mov.l test_andi_3_result, r3
41 cmp/eq r0, r3
42 bt test_andi_4
43 fail test_andi_str_k
44 bra test_andi_4
45 nop
46 test_andi_3_op1:
47 .long 0x123456AB
48 test_andi_3_result:
49 .long 0x00000080
51 test_andi_4: ! Test GBR version
52 add #1, r12
53 stc gbr, r4
54 mov.l test_andi_4_gbr, r0
55 ldc r0, gbr
56 mov.l test_andi_4_op1, r0
57 and.b #254, @(r0,gbr)
58 add #1, r0
59 and.b #67, @(r0,gbr)
60 add #2, r0
61 and.b #227, @(r0,gbr)
62 ldc r4, gbr
63 mov.l test_andi_4_output, r1
64 mov.l test_andi_4_result, r2
65 cmp/eq r1, r2
66 bt test_andi_5
67 fail test_andi_str_k
68 bra test_andi_5
69 nop
70 test_andi_4_gbr:
71 .long test_andi_4_gbr
72 test_andi_4_op1:
73 .long 0x00000008
74 test_andi_4_output:
75 .long 0x123456AB
76 test_andi_4_result:
77 .long 0x023442AA
79 test_andi_5:
80 test_andi_end:
81 end_test test_andi_str_k
83 test_andi_str:
84 .string "ANDi"
86 .align 4
87 test_andi_str_k:
88 .long test_andi_str
.