2 ;; test all addressing modes and register constraints
3 ;; (types/classes is read from include/opcodes/tic4x.h)
9 ;; Type B - infix condition branch
11 Type_BI:bu Type_BI ; Unconditional branch (00000)
12 bc Type_BI ; Carry branch (00001)
13 blo Type_BI ; Lower than branch (00001)
14 bls Type_BI ; Lower than or same branch (00010)
15 bhi Type_BI ; Higher than branch (00011)
16 bhs Type_BI ; Higher than or same branch (00100)
17 bnc Type_BI ; No carry branch (00100)
18 beq Type_BI ; Equal to branch (00101)
19 bz Type_BI ; Zero branch (00101)
20 bne Type_BI ; Not equal to branch (00110)
21 bnz Type_BI ; Not zero branch (00110)
22 blt Type_BI ; Less than branch (00111)
23 bn Type_BI ; Negative branch (00111)
24 ble Type_BI ; Less than or equal to branch (01000)
25 bgt Type_BI ; Greater than branch (01001)
26 bp Type_BI ; Positive branch (01001)
27 bge Type_BI ; Greater than or equal branch (01010)
28 bnn Type_BI ; Nonnegative branch (01010)
29 bnv Type_BI ; No overflow branch (01000)
30 bv Type_BI ; Overflow branch (01101)
31 bnuf Type_BI ; No underflow branch (01110)
32 buf Type_BI ; Underflow branch (01111)
33 bnlv Type_BI ; No latched overflow branch (10000)
34 blv Type_BI ; Latched overflow branch (10001)
35 bnluf Type_BI ; No latched FP underflow branch (10010)
36 bluf Type_BI ; Latched FP underflow branch (10011)
37 bzuf Type_BI ; Zero or FP underflow branch (10100)
38 b Type_BI ; Unconditional branch (00000)
41 ;; Type C - infix condition load
43 Type_CI:ldiu R0,R0 ; Unconditional load (00000)
44 ldic R0,R0 ; Carry load (00001)
45 ldilo R0,R0 ; Lower than load (00001)
46 ldils R0,R0 ; Lower than or same load (00010)
47 ldihi R0,R0 ; Higher than load (00011)
48 ldihs R0,R0 ; Higher than or same load (00100)
49 ldinc R0,R0 ; No carry load (00100)
50 ldieq R0,R0 ; Equal to load (00101)
51 ldiz R0,R0 ; Zero load (00101)
52 ldine R0,R0 ; Not equal to load (00110)
53 ldinz R0,R0 ; Not zero load (00110)
54 ldil R0,R0 ; Less than load (00111)
55 ldin R0,R0 ; Negative load (00111)
56 ldile R0,R0 ; Less than or equal to load (01000)
57 ldigt R0,R0 ; Greater than load (01001)
58 ldip R0,R0 ; Positive load (01001)
59 ldige R0,R0 ; Greater than or equal load (01010)
60 ldinn R0,R0 ; Nonnegative load (01010)
61 ldinv R0,R0 ; No overflow load (01000)
62 ldiv R0,R0 ; Overflow load (01101)
63 ldinuf R0,R0 ; No underflow load (01110)
64 ldiuf R0,R0 ; Underflow load (01111)
65 ldinlv R0,R0 ; No latched overflow load (10000)
66 ldilv R0,R0 ; Latched overflow load (10001)
67 ldinluf R0,R0 ; No latched FP underflow load (10010)
68 ldiluf R0,R0 ; Latched FP underflow load (10011)
69 ldizuf R0,R0 ; Zero or FP underflow load (10100)
72 ;; Type * - Indirect (full)
75 ldi *AR0,R0 ; Indirect addressing (G=10)
76 ldi *+AR0(5),R0 ; with predisplacement add
77 ldi *-AR0(5),R0 ; with predisplacement subtract
78 ldi *++AR0(5),R0 ; with predisplacement add and modify
79 ldi *--AR0(5),R0 ; with predisplacement subtract and modify
80 ldi *AR0++(5),R0 ; with postdisplacement add and modify
81 ldi *AR0--(5),R0 ; with postdisplacement subtract and modify
82 ldi *AR0++(5)%,R0 ; with postdisplacement add and circular modify
83 ldi *AR0--(5)%,R0 ; with postdisplacement subtract and circular modify
84 ldi *+AR0(IR0),R0 ; with predisplacement add
85 ldi *-AR0(IR0),R0 ; with predisplacement subtract
86 ldi *++AR0(IR0),R0 ; with predisplacement add and modify
87 ldi *--AR0(IR0),R0 ; with predisplacement subtract and modify
88 ldi *AR0++(IR0),R0 ; with postdisplacement add and modify
89 ldi *AR0--(IR0),R0 ; with postdisplacement subtract and modify
90 ldi *AR0++(IR0)%,R0 ; with postdisplacement add and circular modify
91 ldi *AR0--(IR0)%,R0 ; with postdisplacement subtract and circular modify
92 ldi *AR0++(IR0)B,R0 ; with postincrement add and bit-reversed modify
93 ldi *AR0++,R0 ; Same as *AR0++(1)
96 ;; Type # - Direct for ldp
113 ;; Type A - Address register
120 ;; Type B - Unsigned integer (PC)
129 Type_C: addc3 *+AR0(5),R0,R0
133 ;; Type E - Register (all)
135 Type_E: andn3 R0,R0,R0
141 ;; Type e - Register (0-11)
143 Type_ee:subf3 R7,R0,R0
152 ;; Type F - Short float immediate
160 ;; Type G - Register (all)
162 Type_G: andn3 R0,AR0,R0
168 ;; Type g - Register (0-11)
170 Type_gg:subf3 R0,R7,R0
179 ;; Type H - Register (0-7)
181 Type_H: stf R0,*AR0 &|| stf R0,*AR0
182 stf R0,*AR0 &|| stf R2,*AR0
183 stf R0,*AR0 &|| stf R7,*AR0
188 Type_I: addf3 *AR0,R0,R0 ; Indirect addressing (G=10)
189 addf3 *+AR0(1),R0,R0 ; with predisplacement add
190 addf3 *-AR0(1),R0,R0 ; with predisplacement subtract
191 addf3 *++AR0(1),R0,R0 ; with predisplacement add and modify
192 addf3 *--AR0(1),R0,R0 ; with predisplacement subtract and modify
193 addf3 *AR0++(1),R0,R0 ; with postdisplacement add and modify
194 addf3 *AR0--(1),R0,R0 ; with postdisplacement subtract and modify
195 addf3 *AR0++(1)%,R0,R0; with postdisplacement add and circular modify
196 addf3 *AR0--(1)%,R0,R0; with postdisplacement subtract and circular modify
197 addf3 *+AR0(IR0),R0,R0; with predisplacement add
198 addf3 *-AR0(IR0),R0,R0; with predisplacement subtract
199 addf3 *++AR0(IR0),R0,R0; with predisplacement add and modify
200 addf3 *--AR0(IR0),R0,R0; with predisplacement subtract and modify
201 addf3 *AR0++(IR0),R0,R0; with postdisplacement add and modify
202 addf3 *AR0--(IR0),R0,R0; with postdisplacement subtract and modify
203 addf3 *AR0++(IR0)%,R0,R0; with postdisplacement add and circular modify
204 addf3 *AR0--(IR0)%,R0,R0; with postdisplacement subtract and circular modify
205 addf3 *AR0++(IR0)B,R0,R0; with postincrement add and bit-reversed modify
206 addf3 *AR0++,R0,R0 ; Same as *AR0++(1)
211 Type_J: addf3 R0,*AR0,R0 ; Indirect addressing (G=10)
212 addf3 R0,*+AR0(1),R0 ; with predisplacement add
213 addf3 R0,*-AR0(1),R0 ; with predisplacement subtract
214 addf3 R0,*++AR0(1),R0 ; with predisplacement add and modify
215 addf3 R0,*--AR0(1),R0 ; with predisplacement subtract and modify
216 addf3 R0,*AR0++(1),R0 ; with postdisplacement add and modify
217 addf3 R0,*AR0--(1),R0 ; with postdisplacement subtract and modify
218 addf3 R0,*AR0++(1)%,R0; with postdisplacement add and circular modify
219 addf3 R0,*AR0--(1)%,R0; with postdisplacement subtract and circular modify
220 addf3 R0,*+AR0(IR0),R0; with predisplacement add
221 addf3 R0,*-AR0(IR0),R0; with predisplacement subtract
222 addf3 R0,*++AR0(IR0),R0; with predisplacement add and modify
223 addf3 R0,*--AR0(IR0),R0; with predisplacement subtract and modify
224 addf3 R0,*AR0++(IR0),R0; with postdisplacement add and modify
225 addf3 R0,*AR0--(IR0),R0; with postdisplacement subtract and modify
226 addf3 R0,*AR0++(IR0)%,R0; with postdisplacement add and circular modify
227 addf3 R0,*AR0--(IR0)%,R0; with postdisplacement subtract and circular modify
228 addf3 R0,*AR0++(IR0)B,R0; with postincrement add and bit-reversed modify
229 addf3 R0,*AR0++,R0 ; Same as *AR0++(1)
232 ;; Type K - Register (0-7)
234 Type_K: ldf *AR0,R0 &|| ldf *AR0,R1
235 ldf *AR0,R0 &|| ldf *AR0,R2
236 ldf *AR0,R0 &|| ldf *AR0,R7
239 ;; Type L - Register (0-7)
241 Type_L: stf R0,*AR0 &|| stf R0,*AR0
242 stf R2,*AR0 &|| stf R0,*AR0
243 stf R7,*AR0 &|| stf R0,*AR0
246 ;; Type M - Register (2-3)
248 Type_M: mpyf3 *AR0,*AR0,R0 &|| addf3 R0,R0,R2
249 mpyf3 *AR0,*AR0,R0 &|| addf3 R0,R0,R3
252 ;; Type N - Register (0-1)
254 Type_N: mpyf3 *AR0,*AR0,R0 &|| addf3 R0,R0,R2
255 mpyf3 *AR0,*AR0,R1 &|| addf3 R0,R0,R2
261 Type_O: addc3 *+AR0(5),*+AR0(5),R0
265 ;; Type P - Displacement (PC rel)
271 ;; Type Q - Register (all)
279 ;; Type q - Register (0-11)
289 ;; Type R - Register (all)
297 ;; Type r - Register (0-11)
306 ;; Type S - Signed immediate
323 ;; Type U - Unsigned integer
340 ;; Type W - Short int
343 Type_W: addc3 -3,R0,R0
348 ;; Type X - Expansion register
356 ;; Type Y - Address register
366 ;; Type Z - Expansion register