filename | test/sh4/bf.s |
changeset | 231:a9e61a96a885 |
prev | 228:70adc8ffa8d1 |
next | 872:a3041742bb7d |
author | nkeynes |
date | Sat Jan 26 03:45:49 2008 +0000 (16 years ago) |
permissions | -rw-r--r-- |
last change | Ignore Numlock, Capslock, etc when checking for grab exit |
view | annotate | diff | log | raw |
1 .section .text
2 .include "sh4/inc.s"
3 !
4 ! Test bf pcrel
5 ! Test bf/s pcrel
7 .global _test_bf
8 _test_bf:
9 start_test
11 test_bf_1: ! Test branch not taken
12 add #1, r12
13 setc
14 bf test_bf_1_b
15 bra test_bf_2
16 nop
17 test_bf_1_b:
18 fail test_bf_str_k
20 test_bf_2: ! Test branch taken
21 add #1, r12
22 clc
23 bf test_bf_3
24 fail test_bf_str_k
26 test_bf_3: ! Test branch taken (backwards)
27 add #1, r12
28 clc
29 bra test_bf_3_b
30 nop
31 fail test_bf_str_k
32 bra test_bf_4
33 test_bf_3_c:
34 nop
35 bra test_bf_4
36 nop
37 fail test_bf_str_k
38 bra test_bf_4
39 test_bf_3_b:
40 nop
41 bf test_bf_3_c
42 fail test_bf_str_k
43 bra test_bf_4
44 nop
46 test_bf_4: ! Test branch not taken w/ delay
47 add #1, r12
48 setc
49 xor r0, r0
50 bf/s test_bf_4_b
51 add #1, r0
52 bra test_bf_4_c
53 nop
54 test_bf_4_b:
55 fail test_bf_str_k
56 bra test_bf_5
57 nop
58 test_bf_4_c:
59 xor r1,r1
60 add #1, r1
61 cmp/eq r0, r1
63 test_bf_5: ! Test branch taken w/ delay
64 add #1, r12
65 clc
66 xor r0,r0
67 bf/s test_bf_5_b
68 add #1, r0
69 fail test_bf_str_k
70 bra test_bf_6
71 test_bf_5_b:
72 xor r1,r1
73 add #1, r1
74 cmp/eq r0,r1
75 bt test_bf_6
76 fail test_bf_str_k
78 test_bf_6: ! Test back-branch taken w/ delay
79 add #1, r12
80 clc
81 xor r0, r0
82 bra test_bf_6_b
83 nop
84 fail test_bf_str_k
85 bra test_bf_7
86 nop
87 add #1, r13
88 test_bf_6_c:
89 mov #1, r1
90 cmp/eq r0, r1
91 bt test_bf_7
92 fail test_bf_str_k
93 bra test_bf_7
94 nop
95 fail test_bf_str_k
96 bra test_bf_7
97 nop
98 add #1, r13
99 test_bf_6_b:
100 nop
101 bf/s test_bf_6_c
102 add #1, r0
103 fail test_bf_str_k
104 bra test_bf_7
105 nop
107 test_bf_7:
108 add #1, r12
109 expect_exc 0x000001A0 ! BF is slot illegal
110 test_bf_7_exc:
111 bra test_bf_7_b
112 bf test_bf_7_b
113 assert_exc_caught test_bf_str_k test_bf_7_exc
114 bra test_bf_8
115 nop
116 test_bf_7_b:
117 test_bf_7_c:
118 fail test_bf_str_k
120 test_bf_8:
121 add #1, r12
122 expect_exc 0x000001A0 ! BF/S is slot illegal
123 test_bf_8_exc:
124 bra test_bf_8_b
125 bf/s test_bf_8_b
126 nop
127 assert_exc_caught test_bf_str_k test_bf_8_exc
128 bra test_bf_end
129 nop
130 test_bf_8_b:
131 test_bf_8_c:
132 fail test_bf_str_k
135 test_bf_end:
136 end_test test_bf_str_k
138 test_bf_str:
139 .string "BF"
141 .align 4
142 test_bf_str_k:
143 .long test_bf_str
.