Wesley Peck | a70f28c | 2010-02-23 19:15:24 +0000 | [diff] [blame] | 1 | ; 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 Peck | 3d820ba | 2011-04-11 22:31:52 +0000 | [diff] [blame] | 6 | ; RUN: llc -O3 < %s -march=mblaze | FileCheck %s |
Wesley Peck | a70f28c | 2010-02-23 19:15:24 +0000 | [diff] [blame] | 7 | |
| 8 | declare i32 @llvm.mblaze.fsl.get(i32 %port) |
| 9 | declare i32 @llvm.mblaze.fsl.aget(i32 %port) |
| 10 | declare i32 @llvm.mblaze.fsl.cget(i32 %port) |
| 11 | declare i32 @llvm.mblaze.fsl.caget(i32 %port) |
| 12 | declare i32 @llvm.mblaze.fsl.eget(i32 %port) |
| 13 | declare i32 @llvm.mblaze.fsl.eaget(i32 %port) |
| 14 | declare i32 @llvm.mblaze.fsl.ecget(i32 %port) |
| 15 | declare i32 @llvm.mblaze.fsl.ecaget(i32 %port) |
| 16 | declare i32 @llvm.mblaze.fsl.nget(i32 %port) |
| 17 | declare i32 @llvm.mblaze.fsl.naget(i32 %port) |
| 18 | declare i32 @llvm.mblaze.fsl.ncget(i32 %port) |
| 19 | declare i32 @llvm.mblaze.fsl.ncaget(i32 %port) |
| 20 | declare i32 @llvm.mblaze.fsl.neget(i32 %port) |
| 21 | declare i32 @llvm.mblaze.fsl.neaget(i32 %port) |
| 22 | declare i32 @llvm.mblaze.fsl.necget(i32 %port) |
| 23 | declare i32 @llvm.mblaze.fsl.necaget(i32 %port) |
| 24 | declare i32 @llvm.mblaze.fsl.tget(i32 %port) |
| 25 | declare i32 @llvm.mblaze.fsl.taget(i32 %port) |
| 26 | declare i32 @llvm.mblaze.fsl.tcget(i32 %port) |
| 27 | declare i32 @llvm.mblaze.fsl.tcaget(i32 %port) |
| 28 | declare i32 @llvm.mblaze.fsl.teget(i32 %port) |
| 29 | declare i32 @llvm.mblaze.fsl.teaget(i32 %port) |
| 30 | declare i32 @llvm.mblaze.fsl.tecget(i32 %port) |
| 31 | declare i32 @llvm.mblaze.fsl.tecaget(i32 %port) |
| 32 | declare i32 @llvm.mblaze.fsl.tnget(i32 %port) |
| 33 | declare i32 @llvm.mblaze.fsl.tnaget(i32 %port) |
| 34 | declare i32 @llvm.mblaze.fsl.tncget(i32 %port) |
| 35 | declare i32 @llvm.mblaze.fsl.tncaget(i32 %port) |
| 36 | declare i32 @llvm.mblaze.fsl.tneget(i32 %port) |
| 37 | declare i32 @llvm.mblaze.fsl.tneaget(i32 %port) |
| 38 | declare i32 @llvm.mblaze.fsl.tnecget(i32 %port) |
| 39 | declare i32 @llvm.mblaze.fsl.tnecaget(i32 %port) |
| 40 | |
| 41 | declare void @llvm.mblaze.fsl.put(i32 %value, i32 %port) |
| 42 | declare void @llvm.mblaze.fsl.aput(i32 %value, i32 %port) |
| 43 | declare void @llvm.mblaze.fsl.cput(i32 %value, i32 %port) |
| 44 | declare void @llvm.mblaze.fsl.caput(i32 %value, i32 %port) |
| 45 | declare void @llvm.mblaze.fsl.nput(i32 %value, i32 %port) |
| 46 | declare void @llvm.mblaze.fsl.naput(i32 %value, i32 %port) |
| 47 | declare void @llvm.mblaze.fsl.ncput(i32 %value, i32 %port) |
| 48 | declare void @llvm.mblaze.fsl.ncaput(i32 %value, i32 %port) |
| 49 | declare void @llvm.mblaze.fsl.tput(i32 %port) |
| 50 | declare void @llvm.mblaze.fsl.taput(i32 %port) |
| 51 | declare void @llvm.mblaze.fsl.tcput(i32 %port) |
| 52 | declare void @llvm.mblaze.fsl.tcaput(i32 %port) |
| 53 | declare void @llvm.mblaze.fsl.tnput(i32 %port) |
| 54 | declare void @llvm.mblaze.fsl.tnaput(i32 %port) |
| 55 | declare void @llvm.mblaze.fsl.tncput(i32 %port) |
| 56 | declare void @llvm.mblaze.fsl.tncaput(i32 %port) |
| 57 | |
Wesley Peck | 3d820ba | 2011-04-11 22:31:52 +0000 | [diff] [blame] | 58 | define void @fsl_get(i32 %port) { |
Wesley Peck | a70f28c | 2010-02-23 19:15:24 +0000 | [diff] [blame] | 59 | ; 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 Peck | 3d820ba | 2011-04-11 22:31:52 +0000 | [diff] [blame] | 124 | ret void |
Wesley Peck | a70f28c | 2010-02-23 19:15:24 +0000 | [diff] [blame] | 125 | ; CHECK: rtsd |
| 126 | } |
| 127 | |
Wesley Peck | 3d820ba | 2011-04-11 22:31:52 +0000 | [diff] [blame] | 128 | define void @fslc_get() { |
Wesley Peck | a70f28c | 2010-02-23 19:15:24 +0000 | [diff] [blame] | 129 | ; 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 Peck | 3d820ba | 2011-04-11 22:31:52 +0000 | [diff] [blame] | 225 | ret void |
Wesley Peck | a70f28c | 2010-02-23 19:15:24 +0000 | [diff] [blame] | 226 | ; CHECK: rtsd |
| 227 | } |
| 228 | |
Wesley Peck | 3d820ba | 2011-04-11 22:31:52 +0000 | [diff] [blame] | 229 | define void @putfsl(i32 %value, i32 %port) { |
Wesley Peck | a70f28c | 2010-02-23 19:15:24 +0000 | [diff] [blame] | 230 | ; 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 Peck | 3d820ba | 2011-04-11 22:31:52 +0000 | [diff] [blame] | 267 | define void @putfsl_const(i32 %value) { |
Wesley Peck | a70f28c | 2010-02-23 19:15:24 +0000 | [diff] [blame] | 268 | ; 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 | } |