1 # RUN: llvm-mc -triple hexagon -filetype=obj -o - %s | llvm-objdump -d - | FileCheck %s 2 # Hexagon Programmer's Reference Manual 11.5 LD 3 4 # CHECK: 02 40 00 00 5 # CHECK-NEXT: 10 c5 c0 49 6 r17:16 = memd(##168) 7 # CHECK: d0 c0 d5 91 8 r17:16 = memd(r21 + #48) 9 # CHECK: b0 e0 d5 99 10 r17:16 = memd(r21 ++ #40:circ(m1)) 11 # CHECK: 10 e2 d5 99 12 r17:16 = memd(r21 ++ I:circ(m1)) 13 # CHECK: 00 40 00 00 14 # CHECK-NEXT: 70 d7 d5 9b 15 r17:16 = memd(r21 = ##31) 16 # CHECK: b0 c0 d5 9b 17 r17:16 = memd(r21++#40) 18 # CHECK: 10 e0 d5 9d 19 r17:16 = memd(r21++m1) 20 # CHECK: 10 e0 d5 9f 21 r17:16 = memd(r21 ++ m1:brev) 22 23 # Load doubleword conditionally 24 # CHECK: f0 ff d5 30 25 if (p3) r17:16 = memd(r21+r31<<#3) 26 # CHECK: f0 ff d5 31 27 if (!p3) r17:16 = memd(r21+r31<<#3) 28 # CHECK: 03 40 45 85 29 # CHECK-NEXT: f0 ff d5 32 30 { p3 = r5 31 if (p3.new) r17:16 = memd(r21+r31<<#3) } 32 # CHECK: 03 40 45 85 33 # CHECK-NEXT: f0 ff d5 33 34 { p3 = r5 35 if (!p3.new) r17:16 = memd(r21+r31<<#3) } 36 # CHECK: 70 d8 d5 41 37 if (p3) r17:16 = memd(r21 + #24) 38 # CHECK: 03 40 45 85 39 # CHECK-NEXT: 70 d8 d5 43 40 { p3 = r5 41 if (p3.new) r17:16 = memd(r21 + #24) } 42 # CHECK: 70 d8 d5 45 43 if (!p3) r17:16 = memd(r21 + #24) 44 # CHECK: 03 40 45 85 45 # CHECK-NEXT: 70 d8 d5 47 46 { p3 = r5 47 if (!p3.new) r17:16 = memd(r21 + #24) } 48 # CHECK: b0 e6 d5 9b 49 if (p3) r17:16 = memd(r21++#40) 50 # CHECK: b0 ee d5 9b 51 if (!p3) r17:16 = memd(r21++#40) 52 # CHECK: 03 40 45 85 53 # CHECK-NEXT: b0 f6 d5 9b 54 { p3 = r5 55 if (p3.new) r17:16 = memd(r21++#40) } 56 # CHECK: 03 40 45 85 57 # CHECK-NEXT: b0 fe d5 9b 58 { p3 = r5 59 if (!p3.new) r17:16 = memd(r21++#40) } 60 61 # Load byte 62 # CHECK: 91 ff 15 3a 63 r17 = memb(r21 + r31<<#3) 64 # CHECK: b1 c2 00 49 65 r17 = memb(#21) 66 # CHECK: 00 40 00 00 67 # CHECK-NEXT: b1 c2 00 49 68 r17 = memb(##21) 69 # CHECK: f1 c3 15 91 70 r17 = memb(r21 + #31) 71 # CHECK: b1 e0 15 99 72 r17 = memb(r21 ++ #5:circ(m1)) 73 # CHECK: 11 e2 15 99 74 r17 = memb(r21 ++ I:circ(m1)) 75 # CHECK: 00 40 00 00 76 # CHECK-NEXT: 71 d7 15 9b 77 r17 = memb(r21 = ##31) 78 # CHECK: b1 c0 15 9b 79 r17 = memb(r21++#5) 80 # CHECK: 11 e0 15 9d 81 r17 = memb(r21++m1) 82 # CHECK: 11 e0 15 9f 83 r17 = memb(r21 ++ m1:brev) 84 85 # Load byte conditionally 86 # CHECK: f1 ff 15 30 87 if (p3) r17 = memb(r21+r31<<#3) 88 # CHECK: f1 ff 15 31 89 if (!p3) r17 = memb(r21+r31<<#3) 90 # CHECK: 03 40 45 85 91 # CHECK-NEXT: f1 ff 15 32 92 { p3 = r5 93 if (p3.new) r17 = memb(r21+r31<<#3) } 94 # CHECK: 03 40 45 85 95 # CHECK-NEXT: f1 ff 15 33 96 { p3 = r5 97 if (!p3.new) r17 = memb(r21+r31<<#3) } 98 # CHECK: 91 dd 15 41 99 if (p3) r17 = memb(r21 + #44) 100 # CHECK: 03 40 45 85 101 # CHECK-NEXT: 91 dd 15 43 102 { p3 = r5 103 if (p3.new) r17 = memb(r21 + #44) } 104 # CHECK: 91 dd 15 45 105 if (!p3) r17 = memb(r21 + #44) 106 # CHECK: 03 40 45 85 107 # CHECK-NEXT: 91 dd 15 47 108 { p3 = r5 109 if (!p3.new) r17 = memb(r21 + #44) } 110 # CHECK: b1 e6 15 9b 111 if (p3) r17 = memb(r21++#5) 112 # CHECK: b1 ee 15 9b 113 if (!p3) r17 = memb(r21++#5) 114 # CHECK: 03 40 45 85 115 # CHECK-NEXT: b1 f6 15 9b 116 { p3 = r5 117 if (p3.new) r17 = memb(r21++#5) } 118 # CHECK: 03 40 45 85 119 # CHECK-NEXT: b1 fe 15 9b 120 { p3 = r5 121 if (!p3.new) r17 = memb(r21++#5) } 122 123 # Load byte into shifted vector 124 # CHECK: f0 c3 95 90 125 r17:16 = memb_fifo(r21 + #31) 126 # CHECK: b0 e0 95 98 127 r17:16 = memb_fifo(r21 ++ #5:circ(m1)) 128 # CHECK: 10 e2 95 98 129 r17:16 = memb_fifo(r21 ++ I:circ(m1)) 130 131 # Load half into shifted vector 132 # CHECK: f0 c3 55 90 133 r17:16 = memh_fifo(r21 + #62) 134 # CHECK: b0 e0 55 98 135 r17:16 = memh_fifo(r21 ++ #10:circ(m1)) 136 # CHECK: 10 e2 55 98 137 r17:16 = memh_fifo(r21 ++ I:circ(m1)) 138 139 # Load halfword 140 # CHECK: 91 ff 55 3a 141 r17 = memh(r21 + r31<<#3) 142 # CHECK: b1 c2 40 49 143 r17 = memh(#42) 144 # CHECK: 00 40 00 00 145 # CHECK-NEXT: 51 c5 40 49 146 r17 = memh(##42) 147 # CHECK: f1 c3 55 91 148 r17 = memh(r21 + #62) 149 # CHECK: b1 e0 55 99 150 r17 = memh(r21 ++ #10:circ(m1)) 151 # CHECK: 11 e2 55 99 152 r17 = memh(r21 ++ I:circ(m1)) 153 # CHECK: 00 40 00 00 154 # CHECK-NEXT: 71 d7 55 9b 155 r17 = memh(r21 = ##31) 156 # CHECK: b1 c0 55 9b 157 r17 = memh(r21++#10) 158 # CHECK: 11 e0 55 9d 159 r17 = memh(r21++m1) 160 # CHECK: 11 e0 55 9f 161 r17 = memh(r21 ++ m1:brev) 162 163 # Load halfword conditionally 164 # CHECK: f1 ff 55 30 165 if (p3) r17 = memh(r21+r31<<#3) 166 # CHECK: f1 ff 55 31 167 if (!p3) r17 = memh(r21+r31<<#3) 168 # CHECK: 03 40 45 85 169 # CHECK-NEXT: f1 ff 55 32 170 { p3 = r5 171 if (p3.new) r17 = memh(r21+r31<<#3) } 172 # CHECK: 03 40 45 85 173 # CHECK-NEXT: f1 ff 55 33 174 { p3 = r5 175 if (!p3.new) r17 = memh(r21+r31<<#3) } 176 # CHECK: b1 e6 55 9b 177 if (p3) r17 = memh(r21++#10) 178 # CHECK: b1 ee 55 9b 179 if (!p3) r17 = memh(r21++#10) 180 # CHECK: 03 40 45 85 181 # CHECK-NEXT: b1 f6 55 9b 182 { p3 = r5 183 if (p3.new) r17 = memh(r21++#10) } 184 # CHECK: 03 40 45 85 185 # CHECK-NEXT: b1 fe 55 9b 186 { p3 = r5 187 if (!p3.new) r17 = memh(r21++#10) } 188 # CHECK: f1 db 55 41 189 if (p3) r17 = memh(r21 + #62) 190 # CHECK: f1 db 55 45 191 if (!p3) r17 = memh(r21 + #62) 192 # CHECK: 03 40 45 85 193 # CHECK-NEXT: f1 db 55 43 194 { p3 = r5 195 if (p3.new) r17 = memh(r21 + #62) } 196 # CHECK: 03 40 45 85 197 # CHECK-NEXT: f1 db 55 47 198 { p3 = r5 199 if (!p3.new) r17 = memh(r21 + #62) } 200 201 # Load unsigned byte 202 # CHECK: 91 ff 35 3a 203 r17 = memub(r21 + r31<<#3) 204 # CHECK: b1 c2 20 49 205 r17 = memub(#21) 206 # CHECK: 00 40 00 00 207 # CHECK-NEXT: b1 c2 20 49 208 r17 = memub(##21) 209 # CHECK: f1 c3 35 91 210 r17 = memub(r21 + #31) 211 # CHECK: b1 e0 35 99 212 r17 = memub(r21 ++ #5:circ(m1)) 213 # CHECK: 11 e2 35 99 214 r17 = memub(r21 ++ I:circ(m1)) 215 # CHECK: 00 40 00 00 216 # CHECK-NEXT: 71 d7 35 9b 217 r17 = memub(r21 = ##31) 218 # CHECK: b1 c0 35 9b 219 r17 = memub(r21++#5) 220 # CHECK: 11 e0 35 9d 221 r17 = memub(r21++m1) 222 # CHECK: 11 e0 35 9f 223 r17 = memub(r21 ++ m1:brev) 224 225 # Load unsigned byte conditionally 226 # CHECK: f1 ff 35 30 227 if (p3) r17 = memub(r21+r31<<#3) 228 # CHECK: f1 ff 35 31 229 if (!p3) r17 = memub(r21+r31<<#3) 230 # CHECK: 03 40 45 85 231 # CHECK-NEXT: f1 ff 35 32 232 { p3 = r5 233 if (p3.new) r17 = memub(r21+r31<<#3) } 234 # CHECK: 03 40 45 85 235 # CHECK-NEXT: f1 ff 35 33 236 { p3 = r5 237 if (!p3.new) r17 = memub(r21+r31<<#3) } 238 # CHECK: f1 db 35 41 239 if (p3) r17 = memub(r21 + #31) 240 # CHECK: 03 40 45 85 241 # CHECK-NEXT: f1 db 35 43 242 { p3 = r5 243 if (p3.new) r17 = memub(r21 + #31) } 244 # CHECK: f1 db 35 45 245 if (!p3) r17 = memub(r21 + #31) 246 # CHECK: 03 40 45 85 247 # CHECK-NEXT: f1 db 35 47 248 { p3 = r5 249 if (!p3.new) r17 = memub(r21 + #31) } 250 # CHECK: b1 e6 35 9b 251 if (p3) r17 = memub(r21++#5) 252 # CHECK: b1 ee 35 9b 253 if (!p3) r17 = memub(r21++#5) 254 # CHECK: 03 40 45 85 255 # CHECK-NEXT: b1 f6 35 9b 256 { p3 = r5 257 if (p3.new) r17 = memub(r21++#5) } 258 # CHECK: 03 40 45 85 259 # CHECK-NEXT: b1 fe 35 9b 260 { p3 = r5 261 if (!p3.new) r17 = memub(r21++#5) } 262 263 # Load unsigned halfword 264 # CHECK: 91 ff 75 3a 265 r17 = memuh(r21 + r31<<#3) 266 # CHECK: b1 c2 60 49 267 r17 = memuh(#42) 268 # CHECK: 00 40 00 00 269 # CHECK-NEXT: 51 c5 60 49 270 r17 = memuh(##42) 271 # CHECK: b1 c2 75 91 272 r17 = memuh(r21 + #42) 273 # CHECK: b1 e0 75 99 274 r17 = memuh(r21 ++ #10:circ(m1)) 275 # CHECK: 11 e2 75 99 276 r17 = memuh(r21 ++ I:circ(m1)) 277 # CHECK: 00 40 00 00 278 # CHECK-NEXT: 71 d7 75 9b 279 r17 = memuh(r21 = ##31) 280 # CHECK: b1 c0 75 9b 281 r17 = memuh(r21++#10) 282 # CHECK: 11 e0 75 9d 283 r17 = memuh(r21++m1) 284 # CHECK: 11 e0 75 9f 285 r17 = memuh(r21 ++ m1:brev) 286 287 # Load unsigned halfword conditionally 288 # CHECK: f1 ff 75 30 289 if (p3) r17 = memuh(r21+r31<<#3) 290 # CHECK: f1 ff 75 31 291 if (!p3) r17 = memuh(r21+r31<<#3) 292 # CHECK: 03 40 45 85 293 # CHECK-NEXT: f1 ff 75 32 294 { p3 = r5 295 if (p3.new) r17 = memuh(r21+r31<<#3) } 296 # CHECK: 03 40 45 85 297 # CHECK-NEXT: f1 ff 75 33 298 { p3 = r5 299 if (!p3.new) r17 = memuh(r21+r31<<#3) } 300 # CHECK: b1 da 75 41 301 if (p3) r17 = memuh(r21 + #42) 302 # CHECK: b1 da 75 45 303 if (!p3) r17 = memuh(r21 + #42) 304 # CHECK: 03 40 45 85 305 # CHECK-NEXT: b1 da 75 43 306 { p3 = r5 307 if (p3.new) r17 = memuh(r21 + #42) } 308 # CHECK: 03 40 45 85 309 # CHECK-NEXT: b1 da 75 47 310 { p3 = r5 311 if (!p3.new) r17 = memuh(r21 + #42) } 312 # CHECK: b1 e6 75 9b 313 if (p3) r17 = memuh(r21++#10) 314 # CHECK: b1 ee 75 9b 315 if (!p3) r17 = memuh(r21++#10) 316 # CHECK: 03 40 45 85 317 # CHECK-NEXT: b1 f6 75 9b 318 { p3 = r5 319 if (p3.new) r17 = memuh(r21++#10) } 320 # CHECK: 03 40 45 85 321 # CHECK-NEXT: b1 fe 75 9b 322 { p3 = r5 323 if (!p3.new) r17 = memuh(r21++#10) } 324 325 # Load word 326 # CHECK: 91 ff 95 3a 327 r17 = memw(r21 + r31<<#3) 328 # CHECK: b1 c2 80 49 329 r17 = memw(#84) 330 # CHECK: 01 40 00 00 331 # CHECK-NEXT: 91 c2 80 49 332 r17 = memw(##84) 333 # CHECK: b1 c2 95 91 334 r17 = memw(r21 + #84) 335 # CHECK: b1 e0 95 99 336 r17 = memw(r21 ++ #20:circ(m1)) 337 # CHECK: 11 e2 95 99 338 r17 = memw(r21 ++ I:circ(m1)) 339 # CHECK: 00 40 00 00 340 # CHECK-NEXT: 71 d7 95 9b 341 r17 = memw(r21 = ##31) 342 # CHECK: b1 c0 95 9b 343 r17 = memw(r21++#20) 344 # CHECK: 11 e0 95 9d 345 r17 = memw(r21++m1) 346 # CHECK: 11 e0 95 9f 347 r17 = memw(r21 ++ m1:brev) 348 349 # Load word conditionally 350 # CHECK: f1 ff 95 30 351 if (p3) r17 = memw(r21+r31<<#3) 352 # CHECK: f1 ff 95 31 353 if (!p3) r17 = memw(r21+r31<<#3) 354 # CHECK: 03 40 45 85 355 # CHECK-NEXT: f1 ff 95 32 356 { p3 = r5 357 if (p3.new) r17 = memw(r21+r31<<#3) } 358 # CHECK: 03 40 45 85 359 # CHECK-NEXT: f1 ff 95 33 360 { p3 = r5 361 if (!p3.new) r17 = memw(r21+r31<<#3) } 362 # CHECK: b1 da 95 41 363 if (p3) r17 = memw(r21 + #84) 364 # CHECK: b1 da 95 45 365 if (!p3) r17 = memw(r21 + #84) 366 # CHECK: 03 40 45 85 367 # CHECK-NEXT: b1 da 95 43 368 { p3 = r5 369 if (p3.new) r17 = memw(r21 + #84) } 370 # CHECK: 03 40 45 85 371 # CHECK-NEXT: b1 da 95 47 372 { p3 = r5 373 if (!p3.new) r17 = memw(r21 + #84) } 374 # CHECK: b1 e6 95 9b 375 if (p3) r17 = memw(r21++#20) 376 # CHECK: b1 ee 95 9b 377 if (!p3) r17 = memw(r21++#20) 378 # CHECK: 03 40 45 85 379 # CHECK-NEXT: b1 f6 95 9b 380 { p3 = r5 381 if (p3.new) r17 = memw(r21++#20) } 382 # CHECK: 03 40 45 85 383 # CHECK-NEXT: b1 fe 95 9b 384 { p3 = r5 385 if (!p3.new) r17 = memw(r21++#20) } 386 387 # Deallocate stack frame 388 # CHECK: 1e c0 1e 90 389 deallocframe 390 391 # Deallocate stack frame and return 392 # CHECK: 1e c0 1e 96 393 dealloc_return 394 # CHECK: 03 40 45 85 395 # CHECK-NEXT: 1e cb 1e 96 396 { p3 = r5 397 if (p3.new) dealloc_return:nt } 398 # CHECK: 1e d3 1e 96 399 if (p3) dealloc_return 400 # CHECK: 03 40 45 85 401 # CHECK-NEXT: 1e db 1e 96 402 { p3 = r5 403 if (p3.new) dealloc_return:t } 404 # CHECK: 03 40 45 85 405 # CHECK-NEXT: 1e eb 1e 96 406 { p3 = r5 407 if (!p3.new) dealloc_return:nt } 408 # CHECK: 1e f3 1e 96 409 if (!p3) dealloc_return 410 # CHECK: 03 40 45 85 411 # CHECK-NEXT: 1e fb 1e 96 412 { p3 = r5 413 if (!p3.new) dealloc_return:t } 414 415 # Load and unpack bytes to halfwords 416 # CHECK: f1 c3 35 90 417 r17 = membh(r21 + #62) 418 # CHECK: f1 c3 75 90 419 r17 = memubh(r21 + #62) 420 # CHECK: f0 c3 b5 90 421 r17:16 = memubh(r21 + #124) 422 # CHECK: f0 c3 f5 90 423 r17:16 = membh(r21 + #124) 424 # CHECK: b1 e0 35 98 425 r17 = membh(r21 ++ #10:circ(m1)) 426 # CHECK: 11 e2 35 98 427 r17 = membh(r21 ++ I:circ(m1)) 428 # CHECK: b1 e0 75 98 429 r17 = memubh(r21 ++ #10:circ(m1)) 430 # CHECK: 11 e2 75 98 431 r17 = memubh(r21 ++ I:circ(m1)) 432 # CHECK: b0 e0 f5 98 433 r17:16 = membh(r21 ++ #20:circ(m1)) 434 # CHECK: 10 e2 f5 98 435 r17:16 = membh(r21 ++ I:circ(m1)) 436 # CHECK: b0 e0 b5 98 437 r17:16 = memubh(r21 ++ #20:circ(m1)) 438 # CHECK: 10 e2 b5 98 439 r17:16 = memubh(r21 ++ I:circ(m1)) 440 # CHECK: 00 40 00 00 441 # CHECK-NEXT: 71 d7 35 9a 442 r17 = membh(r21 = ##31) 443 # CHECK: b1 c0 35 9a 444 r17 = membh(r21++#10) 445 # CHECK: 00 40 00 00 446 # CHECK-NEXT: 71 d7 75 9a 447 r17 = memubh(r21 = ##31) 448 # CHECK: b1 c0 75 9a 449 r17 = memubh(r21++#10) 450 # CHECK: 00 40 00 00 451 # CHECK-NEXT: 70 d7 b5 9a 452 r17:16 = memubh(r21 = ##31) 453 # CHECK: b0 c0 b5 9a 454 r17:16 = memubh(r21++#20) 455 # CHECK: 00 40 00 00 456 # CHECK-NEXT: 70 d7 f5 9a 457 r17:16 = membh(r21 = ##31) 458 # CHECK: b0 c0 f5 9a 459 r17:16 = membh(r21++#20) 460 # CHECK: 00 40 00 00 461 # CHECK-NEXT: f1 f7 35 9c 462 r17 = membh(r21<<#3 + ##31) 463 # CHECK: 11 e0 35 9c 464 r17 = membh(r21++m1) 465 # CHECK: 00 40 00 00 466 # CHECK-NEXT: f1 f7 75 9c 467 r17 = memubh(r21<<#3 + ##31) 468 # CHECK: 11 e0 75 9c 469 r17 = memubh(r21++m1) 470 # CHECK: 00 40 00 00 471 # CHECK-NEXT: f0 f7 f5 9c 472 r17:16 = membh(r21<<#3 + ##31) 473 # CHECK: 10 e0 f5 9c 474 r17:16 = membh(r21++m1) 475 # CHECK: 00 40 00 00 476 # CHECK-NEXT: f0 f7 b5 9c 477 r17:16 = memubh(r21<<#3 + ##31) 478 # CHECK: 11 e0 35 9c 479 r17 = membh(r21++m1) 480 # CHECK: 11 e0 75 9c 481 r17 = memubh(r21++m1) 482 # CHECK: 10 e0 f5 9c 483 r17:16 = membh(r21++m1) 484 # CHECK: 10 e0 b5 9c 485 r17:16 = memubh(r21++m1) 486 # CHECK: 11 e0 35 9e 487 r17 = membh(r21 ++ m1:brev) 488 # CHECK: 11 e0 75 9e 489 r17 = memubh(r21 ++ m1:brev) 490 # CHECK: 10 e0 b5 9e 491 r17:16 = memubh(r21 ++ m1:brev) 492 # CHECK: 10 e0 f5 9e 493 r17:16 = membh(r21 ++ m1:brev) 494