blob: 5444f82dd63c20b219f19a480b9bbd8c88643706 [file] [log] [blame]
Wesley Pecka70f28c2010-02-23 19:15:24 +00001; Ensure that the FSL instrinsic instruction generate single FSL instructions
2; at the machine level. Additionally, ensure that dynamic values use the
3; dynamic version of the instructions and that constant values use the
4; constant version of the instructions.
5;
Wesley Peck3d820ba2011-04-11 22:31:52 +00006; RUN: llc -O3 < %s -march=mblaze | FileCheck %s
Wesley Pecka70f28c2010-02-23 19:15:24 +00007
8declare i32 @llvm.mblaze.fsl.get(i32 %port)
9declare i32 @llvm.mblaze.fsl.aget(i32 %port)
10declare i32 @llvm.mblaze.fsl.cget(i32 %port)
11declare i32 @llvm.mblaze.fsl.caget(i32 %port)
12declare i32 @llvm.mblaze.fsl.eget(i32 %port)
13declare i32 @llvm.mblaze.fsl.eaget(i32 %port)
14declare i32 @llvm.mblaze.fsl.ecget(i32 %port)
15declare i32 @llvm.mblaze.fsl.ecaget(i32 %port)
16declare i32 @llvm.mblaze.fsl.nget(i32 %port)
17declare i32 @llvm.mblaze.fsl.naget(i32 %port)
18declare i32 @llvm.mblaze.fsl.ncget(i32 %port)
19declare i32 @llvm.mblaze.fsl.ncaget(i32 %port)
20declare i32 @llvm.mblaze.fsl.neget(i32 %port)
21declare i32 @llvm.mblaze.fsl.neaget(i32 %port)
22declare i32 @llvm.mblaze.fsl.necget(i32 %port)
23declare i32 @llvm.mblaze.fsl.necaget(i32 %port)
24declare i32 @llvm.mblaze.fsl.tget(i32 %port)
25declare i32 @llvm.mblaze.fsl.taget(i32 %port)
26declare i32 @llvm.mblaze.fsl.tcget(i32 %port)
27declare i32 @llvm.mblaze.fsl.tcaget(i32 %port)
28declare i32 @llvm.mblaze.fsl.teget(i32 %port)
29declare i32 @llvm.mblaze.fsl.teaget(i32 %port)
30declare i32 @llvm.mblaze.fsl.tecget(i32 %port)
31declare i32 @llvm.mblaze.fsl.tecaget(i32 %port)
32declare i32 @llvm.mblaze.fsl.tnget(i32 %port)
33declare i32 @llvm.mblaze.fsl.tnaget(i32 %port)
34declare i32 @llvm.mblaze.fsl.tncget(i32 %port)
35declare i32 @llvm.mblaze.fsl.tncaget(i32 %port)
36declare i32 @llvm.mblaze.fsl.tneget(i32 %port)
37declare i32 @llvm.mblaze.fsl.tneaget(i32 %port)
38declare i32 @llvm.mblaze.fsl.tnecget(i32 %port)
39declare i32 @llvm.mblaze.fsl.tnecaget(i32 %port)
40
41declare void @llvm.mblaze.fsl.put(i32 %value, i32 %port)
42declare void @llvm.mblaze.fsl.aput(i32 %value, i32 %port)
43declare void @llvm.mblaze.fsl.cput(i32 %value, i32 %port)
44declare void @llvm.mblaze.fsl.caput(i32 %value, i32 %port)
45declare void @llvm.mblaze.fsl.nput(i32 %value, i32 %port)
46declare void @llvm.mblaze.fsl.naput(i32 %value, i32 %port)
47declare void @llvm.mblaze.fsl.ncput(i32 %value, i32 %port)
48declare void @llvm.mblaze.fsl.ncaput(i32 %value, i32 %port)
49declare void @llvm.mblaze.fsl.tput(i32 %port)
50declare void @llvm.mblaze.fsl.taput(i32 %port)
51declare void @llvm.mblaze.fsl.tcput(i32 %port)
52declare void @llvm.mblaze.fsl.tcaput(i32 %port)
53declare void @llvm.mblaze.fsl.tnput(i32 %port)
54declare void @llvm.mblaze.fsl.tnaput(i32 %port)
55declare void @llvm.mblaze.fsl.tncput(i32 %port)
56declare void @llvm.mblaze.fsl.tncaput(i32 %port)
57
Wesley Peck3d820ba2011-04-11 22:31:52 +000058define void @fsl_get(i32 %port) {
Wesley Pecka70f28c2010-02-23 19:15:24 +000059 ; CHECK: fsl_get:
60 %v0 = call i32 @llvm.mblaze.fsl.get(i32 %port)
61 ; CHECK: getd
62 %v1 = call i32 @llvm.mblaze.fsl.aget(i32 %port)
63 ; CHECK-NEXT: agetd
64 %v2 = call i32 @llvm.mblaze.fsl.cget(i32 %port)
65 ; CHECK-NEXT: cgetd
66 %v3 = call i32 @llvm.mblaze.fsl.caget(i32 %port)
67 ; CHECK-NEXT: cagetd
68 %v4 = call i32 @llvm.mblaze.fsl.eget(i32 %port)
69 ; CHECK-NEXT: egetd
70 %v5 = call i32 @llvm.mblaze.fsl.eaget(i32 %port)
71 ; CHECK-NEXT: eagetd
72 %v6 = call i32 @llvm.mblaze.fsl.ecget(i32 %port)
73 ; CHECK-NEXT: ecgetd
74 %v7 = call i32 @llvm.mblaze.fsl.ecaget(i32 %port)
75 ; CHECK-NEXT: ecagetd
76 %v8 = call i32 @llvm.mblaze.fsl.nget(i32 %port)
77 ; CHECK-NEXT: ngetd
78 %v9 = call i32 @llvm.mblaze.fsl.naget(i32 %port)
79 ; CHECK-NEXT: nagetd
80 %v10 = call i32 @llvm.mblaze.fsl.ncget(i32 %port)
81 ; CHECK-NEXT: ncgetd
82 %v11 = call i32 @llvm.mblaze.fsl.ncaget(i32 %port)
83 ; CHECK-NEXT: ncagetd
84 %v12 = call i32 @llvm.mblaze.fsl.neget(i32 %port)
85 ; CHECK-NEXT: negetd
86 %v13 = call i32 @llvm.mblaze.fsl.neaget(i32 %port)
87 ; CHECK-NEXT: neagetd
88 %v14 = call i32 @llvm.mblaze.fsl.necget(i32 %port)
89 ; CHECK-NEXT: necgetd
90 %v15 = call i32 @llvm.mblaze.fsl.necaget(i32 %port)
91 ; CHECK-NEXT: necagetd
92 %v16 = call i32 @llvm.mblaze.fsl.tget(i32 %port)
93 ; CHECK-NEXT: tgetd
94 %v17 = call i32 @llvm.mblaze.fsl.taget(i32 %port)
95 ; CHECK-NEXT: tagetd
96 %v18 = call i32 @llvm.mblaze.fsl.tcget(i32 %port)
97 ; CHECK-NEXT: tcgetd
98 %v19 = call i32 @llvm.mblaze.fsl.tcaget(i32 %port)
99 ; CHECK-NEXT: tcagetd
100 %v20 = call i32 @llvm.mblaze.fsl.teget(i32 %port)
101 ; CHECK-NEXT: tegetd
102 %v21 = call i32 @llvm.mblaze.fsl.teaget(i32 %port)
103 ; CHECK-NEXT: teagetd
104 %v22 = call i32 @llvm.mblaze.fsl.tecget(i32 %port)
105 ; CHECK-NEXT: tecgetd
106 %v23 = call i32 @llvm.mblaze.fsl.tecaget(i32 %port)
107 ; CHECK-NEXT: tecagetd
108 %v24 = call i32 @llvm.mblaze.fsl.tnget(i32 %port)
109 ; CHECK-NEXT: tngetd
110 %v25 = call i32 @llvm.mblaze.fsl.tnaget(i32 %port)
111 ; CHECK-NEXT: tnagetd
112 %v26 = call i32 @llvm.mblaze.fsl.tncget(i32 %port)
113 ; CHECK-NEXT: tncgetd
114 %v27 = call i32 @llvm.mblaze.fsl.tncaget(i32 %port)
115 ; CHECK-NEXT: tncagetd
116 %v28 = call i32 @llvm.mblaze.fsl.tneget(i32 %port)
117 ; CHECK-NEXT: tnegetd
118 %v29 = call i32 @llvm.mblaze.fsl.tneaget(i32 %port)
119 ; CHECK-NEXT: tneagetd
120 %v30 = call i32 @llvm.mblaze.fsl.tnecget(i32 %port)
121 ; CHECK-NEXT: tnecgetd
122 %v31 = call i32 @llvm.mblaze.fsl.tnecaget(i32 %port)
123 ; CHECK-NEXT: tnecagetd
Wesley Peck3d820ba2011-04-11 22:31:52 +0000124 ret void
Wesley Pecka70f28c2010-02-23 19:15:24 +0000125 ; CHECK: rtsd
126}
127
Wesley Peck3d820ba2011-04-11 22:31:52 +0000128define void @fslc_get() {
Wesley Pecka70f28c2010-02-23 19:15:24 +0000129 ; CHECK: fslc_get:
130 %v0 = call i32 @llvm.mblaze.fsl.get(i32 1)
131 ; CHECK: get
132 %v1 = call i32 @llvm.mblaze.fsl.aget(i32 1)
133 ; CHECK-NOT: agetd
134 ; CHECK: aget
135 %v2 = call i32 @llvm.mblaze.fsl.cget(i32 1)
136 ; CHECK-NOT: cgetd
137 ; CHECK: cget
138 %v3 = call i32 @llvm.mblaze.fsl.caget(i32 1)
139 ; CHECK-NOT: cagetd
140 ; CHECK: caget
141 %v4 = call i32 @llvm.mblaze.fsl.eget(i32 1)
142 ; CHECK-NOT: egetd
143 ; CHECK: eget
144 %v5 = call i32 @llvm.mblaze.fsl.eaget(i32 1)
145 ; CHECK-NOT: eagetd
146 ; CHECK: eaget
147 %v6 = call i32 @llvm.mblaze.fsl.ecget(i32 1)
148 ; CHECK-NOT: ecgetd
149 ; CHECK: ecget
150 %v7 = call i32 @llvm.mblaze.fsl.ecaget(i32 1)
151 ; CHECK-NOT: ecagetd
152 ; CHECK: ecaget
153 %v8 = call i32 @llvm.mblaze.fsl.nget(i32 1)
154 ; CHECK-NOT: ngetd
155 ; CHECK: nget
156 %v9 = call i32 @llvm.mblaze.fsl.naget(i32 1)
157 ; CHECK-NOT: nagetd
158 ; CHECK: naget
159 %v10 = call i32 @llvm.mblaze.fsl.ncget(i32 1)
160 ; CHECK-NOT: ncgetd
161 ; CHECK: ncget
162 %v11 = call i32 @llvm.mblaze.fsl.ncaget(i32 1)
163 ; CHECK-NOT: ncagetd
164 ; CHECK: ncaget
165 %v12 = call i32 @llvm.mblaze.fsl.neget(i32 1)
166 ; CHECK-NOT: negetd
167 ; CHECK: neget
168 %v13 = call i32 @llvm.mblaze.fsl.neaget(i32 1)
169 ; CHECK-NOT: neagetd
170 ; CHECK: neaget
171 %v14 = call i32 @llvm.mblaze.fsl.necget(i32 1)
172 ; CHECK-NOT: necgetd
173 ; CHECK: necget
174 %v15 = call i32 @llvm.mblaze.fsl.necaget(i32 1)
175 ; CHECK-NOT: necagetd
176 ; CHECK: necaget
177 %v16 = call i32 @llvm.mblaze.fsl.tget(i32 1)
178 ; CHECK-NOT: tgetd
179 ; CHECK: tget
180 %v17 = call i32 @llvm.mblaze.fsl.taget(i32 1)
181 ; CHECK-NOT: tagetd
182 ; CHECK: taget
183 %v18 = call i32 @llvm.mblaze.fsl.tcget(i32 1)
184 ; CHECK-NOT: tcgetd
185 ; CHECK: tcget
186 %v19 = call i32 @llvm.mblaze.fsl.tcaget(i32 1)
187 ; CHECK-NOT: tcagetd
188 ; CHECK: tcaget
189 %v20 = call i32 @llvm.mblaze.fsl.teget(i32 1)
190 ; CHECK-NOT: tegetd
191 ; CHECK: teget
192 %v21 = call i32 @llvm.mblaze.fsl.teaget(i32 1)
193 ; CHECK-NOT: teagetd
194 ; CHECK: teaget
195 %v22 = call i32 @llvm.mblaze.fsl.tecget(i32 1)
196 ; CHECK-NOT: tecgetd
197 ; CHECK: tecget
198 %v23 = call i32 @llvm.mblaze.fsl.tecaget(i32 1)
199 ; CHECK-NOT: tecagetd
200 ; CHECK: tecaget
201 %v24 = call i32 @llvm.mblaze.fsl.tnget(i32 1)
202 ; CHECK-NOT: tngetd
203 ; CHECK: tnget
204 %v25 = call i32 @llvm.mblaze.fsl.tnaget(i32 1)
205 ; CHECK-NOT: tnagetd
206 ; CHECK: tnaget
207 %v26 = call i32 @llvm.mblaze.fsl.tncget(i32 1)
208 ; CHECK-NOT: tncgetd
209 ; CHECK: tncget
210 %v27 = call i32 @llvm.mblaze.fsl.tncaget(i32 1)
211 ; CHECK-NOT: tncagetd
212 ; CHECK: tncaget
213 %v28 = call i32 @llvm.mblaze.fsl.tneget(i32 1)
214 ; CHECK-NOT: tnegetd
215 ; CHECK: tneget
216 %v29 = call i32 @llvm.mblaze.fsl.tneaget(i32 1)
217 ; CHECK-NOT: tneagetd
218 ; CHECK: tneaget
219 %v30 = call i32 @llvm.mblaze.fsl.tnecget(i32 1)
220 ; CHECK-NOT: tnecgetd
221 ; CHECK: tnecget
222 %v31 = call i32 @llvm.mblaze.fsl.tnecaget(i32 1)
223 ; CHECK-NOT: tnecagetd
224 ; CHECK: tnecaget
Wesley Peck3d820ba2011-04-11 22:31:52 +0000225 ret void
Wesley Pecka70f28c2010-02-23 19:15:24 +0000226 ; CHECK: rtsd
227}
228
Wesley Peck3d820ba2011-04-11 22:31:52 +0000229define void @putfsl(i32 %value, i32 %port) {
Wesley Pecka70f28c2010-02-23 19:15:24 +0000230 ; CHECK: putfsl:
231 call void @llvm.mblaze.fsl.put(i32 %value, i32 %port)
232 ; CHECK: putd
233 call void @llvm.mblaze.fsl.aput(i32 %value, i32 %port)
234 ; CHECK-NEXT: aputd
235 call void @llvm.mblaze.fsl.cput(i32 %value, i32 %port)
236 ; CHECK-NEXT: cputd
237 call void @llvm.mblaze.fsl.caput(i32 %value, i32 %port)
238 ; CHECK-NEXT: caputd
239 call void @llvm.mblaze.fsl.nput(i32 %value, i32 %port)
240 ; CHECK-NEXT: nputd
241 call void @llvm.mblaze.fsl.naput(i32 %value, i32 %port)
242 ; CHECK-NEXT: naputd
243 call void @llvm.mblaze.fsl.ncput(i32 %value, i32 %port)
244 ; CHECK-NEXT: ncputd
245 call void @llvm.mblaze.fsl.ncaput(i32 %value, i32 %port)
246 ; CHECK-NEXT: ncaputd
247 call void @llvm.mblaze.fsl.tput(i32 %port)
248 ; CHECK-NEXT: tputd
249 call void @llvm.mblaze.fsl.taput(i32 %port)
250 ; CHECK-NEXT: taputd
251 call void @llvm.mblaze.fsl.tcput(i32 %port)
252 ; CHECK-NEXT: tcputd
253 call void @llvm.mblaze.fsl.tcaput(i32 %port)
254 ; CHECK-NEXT: tcaputd
255 call void @llvm.mblaze.fsl.tnput(i32 %port)
256 ; CHECK-NEXT: tnputd
257 call void @llvm.mblaze.fsl.tnaput(i32 %port)
258 ; CHECK-NEXT: tnaputd
259 call void @llvm.mblaze.fsl.tncput(i32 %port)
260 ; CHECK-NEXT: tncputd
261 call void @llvm.mblaze.fsl.tncaput(i32 %port)
262 ; CHECK-NEXT: tncaputd
263 ret void
264 ; CHECK: rtsd
265}
266
Wesley Peck3d820ba2011-04-11 22:31:52 +0000267define void @putfsl_const(i32 %value) {
Wesley Pecka70f28c2010-02-23 19:15:24 +0000268 ; CHECK: putfsl_const:
269 call void @llvm.mblaze.fsl.put(i32 %value, i32 1)
270 ; CHECK-NOT: putd
271 ; CHECK: put
272 call void @llvm.mblaze.fsl.aput(i32 %value, i32 1)
273 ; CHECK-NOT: aputd
274 ; CHECK: aput
275 call void @llvm.mblaze.fsl.cput(i32 %value, i32 1)
276 ; CHECK-NOT: cputd
277 ; CHECK: cput
278 call void @llvm.mblaze.fsl.caput(i32 %value, i32 1)
279 ; CHECK-NOT: caputd
280 ; CHECK: caput
281 call void @llvm.mblaze.fsl.nput(i32 %value, i32 1)
282 ; CHECK-NOT: nputd
283 ; CHECK: nput
284 call void @llvm.mblaze.fsl.naput(i32 %value, i32 1)
285 ; CHECK-NOT: naputd
286 ; CHECK: naput
287 call void @llvm.mblaze.fsl.ncput(i32 %value, i32 1)
288 ; CHECK-NOT: ncputd
289 ; CHECK: ncput
290 call void @llvm.mblaze.fsl.ncaput(i32 %value, i32 1)
291 ; CHECK-NOT: ncaputd
292 ; CHECK: ncaput
293 call void @llvm.mblaze.fsl.tput(i32 1)
294 ; CHECK-NOT: tputd
295 ; CHECK: tput
296 call void @llvm.mblaze.fsl.taput(i32 1)
297 ; CHECK-NOT: taputd
298 ; CHECK: taput
299 call void @llvm.mblaze.fsl.tcput(i32 1)
300 ; CHECK-NOT: tcputd
301 ; CHECK: tcput
302 call void @llvm.mblaze.fsl.tcaput(i32 1)
303 ; CHECK-NOT: tcaputd
304 ; CHECK: tcaput
305 call void @llvm.mblaze.fsl.tnput(i32 1)
306 ; CHECK-NOT: tnputd
307 ; CHECK: tnput
308 call void @llvm.mblaze.fsl.tnaput(i32 1)
309 ; CHECK-NOT: tnaputd
310 ; CHECK: tnaput
311 call void @llvm.mblaze.fsl.tncput(i32 1)
312 ; CHECK-NOT: tncputd
313 ; CHECK: tncput
314 call void @llvm.mblaze.fsl.tncaput(i32 1)
315 ; CHECK-NOT: tncaputd
316 ; CHECK: tncaput
317 ret void
318 ; CHECK: rtsd
319}