1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py 2# RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=fiji -run-pass=legalizer -global-isel-abort=0 %s -o - | FileCheck %s 3 4--- 5name: test_extract_s32_s64_offset0 6body: | 7 bb.0: 8 liveins: $vgpr0_vgpr1 9 10 ; CHECK-LABEL: name: test_extract_s32_s64_offset0 11 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1 12 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s32) = G_EXTRACT [[COPY]](s64), 0 13 ; CHECK: $vgpr0 = COPY [[EXTRACT]](s32) 14 %0:_(s64) = COPY $vgpr0_vgpr1 15 %1:_(s32) = G_EXTRACT %0, 0 16 $vgpr0 = COPY %1 17... 18--- 19name: test_extract_s32_s64_offset32 20body: | 21 bb.0: 22 liveins: $vgpr0_vgpr1 23 24 ; CHECK-LABEL: name: test_extract_s32_s64_offset32 25 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1 26 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s32) = G_EXTRACT [[COPY]](s64), 32 27 ; CHECK: $vgpr0 = COPY [[EXTRACT]](s32) 28 %0:_(s64) = COPY $vgpr0_vgpr1 29 %1:_(s32) = G_EXTRACT %0, 32 30 $vgpr0 = COPY %1 31... 32 33--- 34name: test_extract_s8_s15_offset0 35body: | 36 bb.0: 37 liveins: $vgpr0_vgpr1 38 39 ; CHECK-LABEL: name: test_extract_s8_s15_offset0 40 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1 41 ; CHECK: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s64) 42 ; CHECK: $vgpr0 = COPY [[TRUNC]](s32) 43 %0:_(s64) = COPY $vgpr0_vgpr1 44 %1:_(s31) = G_TRUNC %0 45 %2:_(s8) = G_EXTRACT %1, 0 46 %3:_(s32) = G_ANYEXT %2 47 $vgpr0 = COPY %3 48... 49 50--- 51name: test_extract_s16_s31_offset0 52body: | 53 bb.0: 54 liveins: $vgpr0_vgpr1 55 56 ; CHECK-LABEL: name: test_extract_s16_s31_offset0 57 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1 58 ; CHECK: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s64) 59 ; CHECK: $vgpr0 = COPY [[TRUNC]](s32) 60 %0:_(s64) = COPY $vgpr0_vgpr1 61 %1:_(s31) = G_TRUNC %0 62 %2:_(s16) = G_EXTRACT %1, 0 63 %3:_(s32) = G_ANYEXT %2 64 $vgpr0 = COPY %3 65... 66 67--- 68name: test_extract_s32_s48_offset0 69body: | 70 bb.0: 71 liveins: $vgpr0_vgpr1 72 73 ; CHECK-LABEL: name: test_extract_s32_s48_offset0 74 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1 75 ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY [[COPY]](s64) 76 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s32) = G_EXTRACT [[COPY1]](s64), 0 77 ; CHECK: $vgpr0 = COPY [[EXTRACT]](s32) 78 %0:_(s64) = COPY $vgpr0_vgpr1 79 %1:_(s48) = G_TRUNC %0 80 %2:_(s32) = G_EXTRACT %1, 0 81 $vgpr0 = COPY %2 82... 83 84--- 85name: test_extract_s32_s96_offset0 86body: | 87 bb.0: 88 liveins: $vgpr0_vgpr1_vgpr2 89 90 ; CHECK-LABEL: name: test_extract_s32_s96_offset0 91 ; CHECK: [[COPY:%[0-9]+]]:_(s96) = COPY $vgpr0_vgpr1_vgpr2 92 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s32) = G_EXTRACT [[COPY]](s96), 0 93 ; CHECK: $vgpr0 = COPY [[EXTRACT]](s32) 94 %0:_(s96) = COPY $vgpr0_vgpr1_vgpr2 95 %1:_(s32) = G_EXTRACT %0, 0 96 $vgpr0 = COPY %1 97... 98--- 99name: test_extract_s32_s96_offset32 100body: | 101 bb.0: 102 liveins: $vgpr0_vgpr1_vgpr2 103 104 ; CHECK-LABEL: name: test_extract_s32_s96_offset32 105 ; CHECK: [[COPY:%[0-9]+]]:_(s96) = COPY $vgpr0_vgpr1_vgpr2 106 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s32) = G_EXTRACT [[COPY]](s96), 32 107 ; CHECK: $vgpr0 = COPY [[EXTRACT]](s32) 108 %0:_(s96) = COPY $vgpr0_vgpr1_vgpr2 109 %1:_(s32) = G_EXTRACT %0, 32 110 $vgpr0 = COPY %1 111... 112--- 113name: test_extract_s32_s96_offset64 114body: | 115 bb.0: 116 liveins: $vgpr0_vgpr1_vgpr2 117 118 ; CHECK-LABEL: name: test_extract_s32_s96_offset64 119 ; CHECK: [[COPY:%[0-9]+]]:_(s96) = COPY $vgpr0_vgpr1_vgpr2 120 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s32) = G_EXTRACT [[COPY]](s96), 64 121 ; CHECK: $vgpr0 = COPY [[EXTRACT]](s32) 122 %0:_(s96) = COPY $vgpr0_vgpr1_vgpr2 123 %1:_(s32) = G_EXTRACT %0, 64 124 $vgpr0 = COPY %1 125... 126--- 127name: test_extract_s32_s128_offset0 128body: | 129 bb.0: 130 liveins: $vgpr0_vgpr1_vgpr2_vgpr3 131 132 ; CHECK-LABEL: name: test_extract_s32_s128_offset0 133 ; CHECK: [[COPY:%[0-9]+]]:_(s128) = COPY $vgpr0_vgpr1_vgpr2_vgpr3 134 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s32) = G_EXTRACT [[COPY]](s128), 0 135 ; CHECK: $vgpr0 = COPY [[EXTRACT]](s32) 136 %0:_(s128) = COPY $vgpr0_vgpr1_vgpr2_vgpr3 137 %1:_(s32) = G_EXTRACT %0, 0 138 $vgpr0 = COPY %1 139... 140--- 141name: test_extract_s32_s128_offset32 142body: | 143 bb.0: 144 liveins: $vgpr0_vgpr1_vgpr2_vgpr3 145 146 ; CHECK-LABEL: name: test_extract_s32_s128_offset32 147 ; CHECK: [[COPY:%[0-9]+]]:_(s128) = COPY $vgpr0_vgpr1_vgpr2_vgpr3 148 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s32) = G_EXTRACT [[COPY]](s128), 32 149 ; CHECK: $vgpr0 = COPY [[EXTRACT]](s32) 150 %0:_(s128) = COPY $vgpr0_vgpr1_vgpr2_vgpr3 151 %1:_(s32) = G_EXTRACT %0, 32 152 $vgpr0 = COPY %1 153... 154--- 155name: test_extract_s32_s128_offset64 156body: | 157 bb.0: 158 liveins: $vgpr0_vgpr1_vgpr2_vgpr3 159 160 ; CHECK-LABEL: name: test_extract_s32_s128_offset64 161 ; CHECK: [[COPY:%[0-9]+]]:_(s128) = COPY $vgpr0_vgpr1_vgpr2_vgpr3 162 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s32) = G_EXTRACT [[COPY]](s128), 64 163 ; CHECK: $vgpr0 = COPY [[EXTRACT]](s32) 164 %0:_(s128) = COPY $vgpr0_vgpr1_vgpr2_vgpr3 165 %1:_(s32) = G_EXTRACT %0, 64 166 $vgpr0 = COPY %1 167... 168--- 169name: test_extract_s32_s128_offset96 170body: | 171 bb.0: 172 liveins: $vgpr0_vgpr1_vgpr2_vgpr3 173 174 ; CHECK-LABEL: name: test_extract_s32_s128_offset96 175 ; CHECK: [[COPY:%[0-9]+]]:_(s128) = COPY $vgpr0_vgpr1_vgpr2_vgpr3 176 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s32) = G_EXTRACT [[COPY]](s128), 96 177 ; CHECK: $vgpr0 = COPY [[EXTRACT]](s32) 178 %0:_(s128) = COPY $vgpr0_vgpr1_vgpr2_vgpr3 179 %1:_(s32) = G_EXTRACT %0, 96 180 $vgpr0 = COPY %1 181... 182 183--- 184name: test_extract_s32_v2s32_offset0 185body: | 186 bb.0: 187 liveins: $vgpr0_vgpr1 188 189 ; CHECK-LABEL: name: test_extract_s32_v2s32_offset0 190 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1 191 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s32) = G_EXTRACT [[COPY]](<2 x s32>), 0 192 ; CHECK: $vgpr0 = COPY [[EXTRACT]](s32) 193 %0:_(<2 x s32>) = COPY $vgpr0_vgpr1 194 %1:_(s32) = G_EXTRACT %0, 0 195 $vgpr0 = COPY %1 196... 197--- 198name: test_extract_s32_v2s32_offset32 199body: | 200 bb.0: 201 liveins: $vgpr0_vgpr1 202 203 ; CHECK-LABEL: name: test_extract_s32_v2s32_offset32 204 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1 205 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s32) = G_EXTRACT [[COPY]](<2 x s32>), 32 206 ; CHECK: $vgpr0 = COPY [[EXTRACT]](s32) 207 %0:_(<2 x s32>) = COPY $vgpr0_vgpr1 208 %1:_(s32) = G_EXTRACT %0, 32 209 $vgpr0 = COPY %1 210... 211--- 212name: test_extract_s32_v3s32_offset0 213body: | 214 bb.0: 215 liveins: $vgpr0_vgpr1_vgpr2 216 217 ; CHECK-LABEL: name: test_extract_s32_v3s32_offset0 218 ; CHECK: [[COPY:%[0-9]+]]:_(<3 x s32>) = COPY $vgpr0_vgpr1_vgpr2 219 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s32) = G_EXTRACT [[COPY]](<3 x s32>), 0 220 ; CHECK: $vgpr0 = COPY [[EXTRACT]](s32) 221 %0:_(<3 x s32>) = COPY $vgpr0_vgpr1_vgpr2 222 %1:_(s32) = G_EXTRACT %0, 0 223 $vgpr0 = COPY %1 224... 225--- 226name: test_extract_s32_v3s32_offset32 227body: | 228 bb.0: 229 liveins: $vgpr0_vgpr1_vgpr2 230 231 ; CHECK-LABEL: name: test_extract_s32_v3s32_offset32 232 ; CHECK: [[COPY:%[0-9]+]]:_(<3 x s32>) = COPY $vgpr0_vgpr1_vgpr2 233 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s32) = G_EXTRACT [[COPY]](<3 x s32>), 32 234 ; CHECK: $vgpr0 = COPY [[EXTRACT]](s32) 235 %0:_(<3 x s32>) = COPY $vgpr0_vgpr1_vgpr2 236 %1:_(s32) = G_EXTRACT %0, 32 237 $vgpr0 = COPY %1 238... 239--- 240name: test_extract_s32_v3s32_offset64 241body: | 242 bb.0: 243 liveins: $vgpr0_vgpr1_vgpr2 244 245 ; CHECK-LABEL: name: test_extract_s32_v3s32_offset64 246 ; CHECK: [[COPY:%[0-9]+]]:_(<3 x s32>) = COPY $vgpr0_vgpr1_vgpr2 247 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s32) = G_EXTRACT [[COPY]](<3 x s32>), 64 248 ; CHECK: $vgpr0 = COPY [[EXTRACT]](s32) 249 %0:_(<3 x s32>) = COPY $vgpr0_vgpr1_vgpr2 250 %1:_(s32) = G_EXTRACT %0, 64 251 $vgpr0 = COPY %1 252... 253--- 254name: test_extract_s32_v4s32_offset0 255body: | 256 bb.0: 257 liveins: $vgpr0_vgpr1_vgpr2_vgpr3 258 259 ; CHECK-LABEL: name: test_extract_s32_v4s32_offset0 260 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3 261 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s32) = G_EXTRACT [[COPY]](<4 x s32>), 0 262 ; CHECK: $vgpr0 = COPY [[EXTRACT]](s32) 263 %0:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3 264 %1:_(s32) = G_EXTRACT %0, 0 265 $vgpr0 = COPY %1 266... 267--- 268name: test_extract_s32_v4s32_offset32 269body: | 270 bb.0: 271 liveins: $vgpr0_vgpr1_vgpr2_vgpr3 272 273 ; CHECK-LABEL: name: test_extract_s32_v4s32_offset32 274 ; CHECK: [[COPY:%[0-9]+]]:_(s128) = COPY $vgpr0_vgpr1_vgpr2_vgpr3 275 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s32) = G_EXTRACT [[COPY]](s128), 32 276 ; CHECK: $vgpr0 = COPY [[EXTRACT]](s32) 277 %0:_(s128) = COPY $vgpr0_vgpr1_vgpr2_vgpr3 278 %1:_(s32) = G_EXTRACT %0, 32 279 $vgpr0 = COPY %1 280... 281--- 282name: test_extract_s32_v4s32_offset64 283body: | 284 bb.0: 285 liveins: $vgpr0_vgpr1_vgpr2_vgpr3 286 287 ; CHECK-LABEL: name: test_extract_s32_v4s32_offset64 288 ; CHECK: [[COPY:%[0-9]+]]:_(s128) = COPY $vgpr0_vgpr1_vgpr2_vgpr3 289 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s32) = G_EXTRACT [[COPY]](s128), 64 290 ; CHECK: $vgpr0 = COPY [[EXTRACT]](s32) 291 %0:_(s128) = COPY $vgpr0_vgpr1_vgpr2_vgpr3 292 %1:_(s32) = G_EXTRACT %0, 64 293 $vgpr0 = COPY %1 294... 295--- 296name: test_extract_s32_v4s32_offset96 297body: | 298 bb.0: 299 liveins: $vgpr0_vgpr1_vgpr2_vgpr3 300 301 ; CHECK-LABEL: name: test_extract_s32_v4s32_offset96 302 ; CHECK: [[COPY:%[0-9]+]]:_(s128) = COPY $vgpr0_vgpr1_vgpr2_vgpr3 303 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s32) = G_EXTRACT [[COPY]](s128), 96 304 ; CHECK: $vgpr0 = COPY [[EXTRACT]](s32) 305 %0:_(s128) = COPY $vgpr0_vgpr1_vgpr2_vgpr3 306 %1:_(s32) = G_EXTRACT %0, 96 307 $vgpr0 = COPY %1 308... 309--- 310name: test_extract_v2s32_v4s32_offset0 311body: | 312 bb.0: 313 liveins: $vgpr0_vgpr1_vgpr2_vgpr3 314 315 ; CHECK-LABEL: name: test_extract_v2s32_v4s32_offset0 316 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3 317 ; CHECK: [[EXTRACT:%[0-9]+]]:_(<2 x s32>) = G_EXTRACT [[COPY]](<4 x s32>), 0 318 ; CHECK: $vgpr0_vgpr1 = COPY [[EXTRACT]](<2 x s32>) 319 %0:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3 320 %1:_(<2 x s32>) = G_EXTRACT %0, 0 321 $vgpr0_vgpr1 = COPY %1 322... 323 324--- 325name: test_extract_v2s32_v4s32_offset32 326body: | 327 bb.0: 328 liveins: $vgpr0_vgpr1_vgpr2_vgpr3 329 330 ; CHECK-LABEL: name: test_extract_v2s32_v4s32_offset32 331 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3 332 ; CHECK: [[EXTRACT:%[0-9]+]]:_(<2 x s32>) = G_EXTRACT [[COPY]](<4 x s32>), 32 333 ; CHECK: $vgpr0_vgpr1 = COPY [[EXTRACT]](<2 x s32>) 334 %0:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3 335 %1:_(<2 x s32>) = G_EXTRACT %0, 32 336 $vgpr0_vgpr1 = COPY %1 337... 338 339--- 340name: test_extract_v2s32_v4s32_offset64 341body: | 342 bb.0: 343 liveins: $vgpr0_vgpr1_vgpr2_vgpr3 344 345 ; CHECK-LABEL: name: test_extract_v2s32_v4s32_offset64 346 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3 347 ; CHECK: [[EXTRACT:%[0-9]+]]:_(<2 x s32>) = G_EXTRACT [[COPY]](<4 x s32>), 64 348 ; CHECK: $vgpr0_vgpr1 = COPY [[EXTRACT]](<2 x s32>) 349 %0:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3 350 %1:_(<2 x s32>) = G_EXTRACT %0, 64 351 $vgpr0_vgpr1 = COPY %1 352... 353--- 354name: test_extract_s64_v4s32_offset0 355body: | 356 bb.0: 357 liveins: $vgpr0_vgpr1_vgpr2_vgpr3 358 359 ; CHECK-LABEL: name: test_extract_s64_v4s32_offset0 360 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3 361 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s64) = G_EXTRACT [[COPY]](<4 x s32>), 0 362 ; CHECK: $vgpr0_vgpr1 = COPY [[EXTRACT]](s64) 363 %0:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3 364 %1:_(s64) = G_EXTRACT %0, 0 365 $vgpr0_vgpr1 = COPY %1 366... 367 368--- 369name: test_extract_s64_v4s32_offset32 370body: | 371 bb.0: 372 liveins: $vgpr0_vgpr1_vgpr2_vgpr3 373 374 ; CHECK-LABEL: name: test_extract_s64_v4s32_offset32 375 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3 376 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s64) = G_EXTRACT [[COPY]](<4 x s32>), 32 377 ; CHECK: $vgpr0_vgpr1 = COPY [[EXTRACT]](s64) 378 %0:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3 379 %1:_(s64) = G_EXTRACT %0, 32 380 $vgpr0_vgpr1 = COPY %1 381... 382 383--- 384name: test_extract_s64_v4s32_offset64 385body: | 386 bb.0: 387 liveins: $vgpr0_vgpr1_vgpr2_vgpr3 388 389 ; CHECK-LABEL: name: test_extract_s64_v4s32_offset64 390 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3 391 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s64) = G_EXTRACT [[COPY]](<4 x s32>), 64 392 ; CHECK: $vgpr0_vgpr1 = COPY [[EXTRACT]](s64) 393 %0:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3 394 %1:_(s64) = G_EXTRACT %0, 64 395 $vgpr0_vgpr1 = COPY %1 396... 397--- 398name: test_extract_p0_v4s32_offset0 399body: | 400 bb.0: 401 liveins: $vgpr0_vgpr1_vgpr2_vgpr3 402 403 ; CHECK-LABEL: name: test_extract_p0_v4s32_offset0 404 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3 405 ; CHECK: [[EXTRACT:%[0-9]+]]:_(p0) = G_EXTRACT [[COPY]](<4 x s32>), 0 406 ; CHECK: $vgpr0_vgpr1 = COPY [[EXTRACT]](p0) 407 %0:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3 408 %1:_(p0) = G_EXTRACT %0, 0 409 $vgpr0_vgpr1 = COPY %1 410... 411 412--- 413name: test_extract_p0_v4s32_offset32 414body: | 415 bb.0: 416 liveins: $vgpr0_vgpr1_vgpr2_vgpr3 417 418 ; CHECK-LABEL: name: test_extract_p0_v4s32_offset32 419 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3 420 ; CHECK: [[EXTRACT:%[0-9]+]]:_(p0) = G_EXTRACT [[COPY]](<4 x s32>), 32 421 ; CHECK: $vgpr0_vgpr1 = COPY [[EXTRACT]](p0) 422 %0:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3 423 %1:_(p0) = G_EXTRACT %0, 32 424 $vgpr0_vgpr1 = COPY %1 425... 426 427--- 428name: test_extract_p0_v4s32_offset64 429body: | 430 bb.0: 431 liveins: $vgpr0_vgpr1_vgpr2_vgpr3 432 433 ; CHECK-LABEL: name: test_extract_p0_v4s32_offset64 434 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3 435 ; CHECK: [[EXTRACT:%[0-9]+]]:_(p0) = G_EXTRACT [[COPY]](<4 x s32>), 64 436 ; CHECK: $vgpr0_vgpr1 = COPY [[EXTRACT]](p0) 437 %0:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3 438 %1:_(p0) = G_EXTRACT %0, 64 439 $vgpr0_vgpr1 = COPY %1 440... 441 442--- 443name: extract_s8_v4s8_offset0 444body: | 445 bb.0: 446 ; CHECK-LABEL: name: extract_s8_v4s8_offset0 447 ; CHECK: [[DEF:%[0-9]+]]:_(<4 x s32>) = G_IMPLICIT_DEF 448 ; CHECK: [[UV:%[0-9]+]]:_(<2 x s32>), [[UV1:%[0-9]+]]:_(<2 x s32>) = G_UNMERGE_VALUES [[DEF]](<4 x s32>) 449 ; CHECK: [[TRUNC:%[0-9]+]]:_(<2 x s16>) = G_TRUNC [[UV]](<2 x s32>) 450 ; CHECK: [[TRUNC1:%[0-9]+]]:_(<2 x s16>) = G_TRUNC [[UV1]](<2 x s32>) 451 ; CHECK: [[CONCAT_VECTORS:%[0-9]+]]:_(<4 x s16>) = G_CONCAT_VECTORS [[TRUNC]](<2 x s16>), [[TRUNC1]](<2 x s16>) 452 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s16) = G_EXTRACT [[CONCAT_VECTORS]](<4 x s16>), 0 453 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[EXTRACT]](s16) 454 ; CHECK: $vgpr0 = COPY [[ANYEXT]](s32) 455 %0:_(<4 x s8>) = G_IMPLICIT_DEF 456 %1:_(s8) = G_EXTRACT %0, 0 457 %2:_(s32) = G_ANYEXT %1 458 $vgpr0 = COPY %2 459... 460 461--- 462name: extract_s8_v4s8_offset8 463body: | 464 bb.0: 465 ; CHECK-LABEL: name: extract_s8_v4s8_offset8 466 ; CHECK: [[DEF:%[0-9]+]]:_(<4 x s32>) = G_IMPLICIT_DEF 467 ; CHECK: [[UV:%[0-9]+]]:_(<2 x s32>), [[UV1:%[0-9]+]]:_(<2 x s32>) = G_UNMERGE_VALUES [[DEF]](<4 x s32>) 468 ; CHECK: [[TRUNC:%[0-9]+]]:_(<2 x s16>) = G_TRUNC [[UV]](<2 x s32>) 469 ; CHECK: [[TRUNC1:%[0-9]+]]:_(<2 x s16>) = G_TRUNC [[UV1]](<2 x s32>) 470 ; CHECK: [[CONCAT_VECTORS:%[0-9]+]]:_(<4 x s16>) = G_CONCAT_VECTORS [[TRUNC]](<2 x s16>), [[TRUNC1]](<2 x s16>) 471 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s16) = G_EXTRACT [[CONCAT_VECTORS]](<4 x s16>), 16 472 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[EXTRACT]](s16) 473 ; CHECK: $vgpr0 = COPY [[ANYEXT]](s32) 474 %0:_(<4 x s8>) = G_IMPLICIT_DEF 475 %1:_(s8) = G_EXTRACT %0, 8 476 %2:_(s32) = G_ANYEXT %1 477 $vgpr0 = COPY %2 478... 479 480--- 481name: extract_s8_v4s8_offset16 482body: | 483 bb.0: 484 ; CHECK-LABEL: name: extract_s8_v4s8_offset16 485 ; CHECK: [[DEF:%[0-9]+]]:_(<4 x s32>) = G_IMPLICIT_DEF 486 ; CHECK: [[UV:%[0-9]+]]:_(<2 x s32>), [[UV1:%[0-9]+]]:_(<2 x s32>) = G_UNMERGE_VALUES [[DEF]](<4 x s32>) 487 ; CHECK: [[TRUNC:%[0-9]+]]:_(<2 x s16>) = G_TRUNC [[UV]](<2 x s32>) 488 ; CHECK: [[TRUNC1:%[0-9]+]]:_(<2 x s16>) = G_TRUNC [[UV1]](<2 x s32>) 489 ; CHECK: [[CONCAT_VECTORS:%[0-9]+]]:_(<4 x s16>) = G_CONCAT_VECTORS [[TRUNC]](<2 x s16>), [[TRUNC1]](<2 x s16>) 490 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s16) = G_EXTRACT [[CONCAT_VECTORS]](<4 x s16>), 32 491 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[EXTRACT]](s16) 492 ; CHECK: $vgpr0 = COPY [[ANYEXT]](s32) 493 %0:_(<4 x s8>) = G_IMPLICIT_DEF 494 %1:_(s8) = G_EXTRACT %0, 16 495 %2:_(s32) = G_ANYEXT %1 496 $vgpr0 = COPY %2 497... 498 499--- 500name: extract_s8_v4s8_offset24 501body: | 502 bb.0: 503 ; CHECK-LABEL: name: extract_s8_v4s8_offset24 504 ; CHECK: [[DEF:%[0-9]+]]:_(<4 x s32>) = G_IMPLICIT_DEF 505 ; CHECK: [[UV:%[0-9]+]]:_(<2 x s32>), [[UV1:%[0-9]+]]:_(<2 x s32>) = G_UNMERGE_VALUES [[DEF]](<4 x s32>) 506 ; CHECK: [[TRUNC:%[0-9]+]]:_(<2 x s16>) = G_TRUNC [[UV]](<2 x s32>) 507 ; CHECK: [[TRUNC1:%[0-9]+]]:_(<2 x s16>) = G_TRUNC [[UV1]](<2 x s32>) 508 ; CHECK: [[CONCAT_VECTORS:%[0-9]+]]:_(<4 x s16>) = G_CONCAT_VECTORS [[TRUNC]](<2 x s16>), [[TRUNC1]](<2 x s16>) 509 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s16) = G_EXTRACT [[CONCAT_VECTORS]](<4 x s16>), 48 510 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[EXTRACT]](s16) 511 ; CHECK: $vgpr0 = COPY [[ANYEXT]](s32) 512 %0:_(<4 x s8>) = G_IMPLICIT_DEF 513 %1:_(s8) = G_EXTRACT %0, 24 514 %2:_(s32) = G_ANYEXT %1 515 $vgpr0 = COPY %2 516... 517 518# FIXME: Leaves behind dead G_TRUNC 519--- 520name: extract_s8_v3s8_offset16 521body: | 522 bb.0: 523 ; CHECK-LABEL: name: extract_s8_v3s8_offset16 524 ; CHECK: [[DEF:%[0-9]+]]:_(<4 x s32>) = G_IMPLICIT_DEF 525 ; CHECK: [[DEF1:%[0-9]+]]:_(<4 x s32>) = G_IMPLICIT_DEF 526 ; CHECK: [[TRUNC:%[0-9]+]]:_(<4 x s8>) = G_TRUNC [[DEF1]](<4 x s32>) 527 ; CHECK: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[DEF]](<4 x s32>) 528 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535 529 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY [[UV]](s32) 530 ; CHECK: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C]] 531 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[UV1]](s32) 532 ; CHECK: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C]] 533 ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 16 534 ; CHECK: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[AND1]], [[C1]](s32) 535 ; CHECK: [[OR:%[0-9]+]]:_(s32) = G_OR [[AND]], [[SHL]] 536 ; CHECK: [[BITCAST:%[0-9]+]]:_(<2 x s16>) = G_BITCAST [[OR]](s32) 537 ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[UV2]](s32) 538 ; CHECK: [[AND2:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C]] 539 ; CHECK: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 0 540 ; CHECK: [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[C2]], [[C1]](s32) 541 ; CHECK: [[OR1:%[0-9]+]]:_(s32) = G_OR [[AND2]], [[SHL1]] 542 ; CHECK: [[BITCAST1:%[0-9]+]]:_(<2 x s16>) = G_BITCAST [[OR1]](s32) 543 ; CHECK: [[DEF2:%[0-9]+]]:_(<2 x s16>) = G_IMPLICIT_DEF 544 ; CHECK: [[CONCAT_VECTORS:%[0-9]+]]:_(<6 x s16>) = G_CONCAT_VECTORS [[BITCAST]](<2 x s16>), [[BITCAST1]](<2 x s16>), [[DEF2]](<2 x s16>) 545 ; CHECK: [[UV4:%[0-9]+]]:_(<3 x s16>), [[UV5:%[0-9]+]]:_(<3 x s16>) = G_UNMERGE_VALUES [[CONCAT_VECTORS]](<6 x s16>) 546 ; CHECK: [[DEF3:%[0-9]+]]:_(<4 x s16>) = G_IMPLICIT_DEF 547 ; CHECK: [[INSERT:%[0-9]+]]:_(<4 x s16>) = G_INSERT [[DEF3]], [[UV4]](<3 x s16>), 0 548 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s16) = G_EXTRACT [[INSERT]](<4 x s16>), 32 549 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[EXTRACT]](s16) 550 ; CHECK: $vgpr0 = COPY [[ANYEXT]](s32) 551 %0:_(<3 x s8>) = G_IMPLICIT_DEF 552 %1:_(s8) = G_EXTRACT %0, 16 553 %2:_(s32) = G_ANYEXT %1 554 $vgpr0 = COPY %2 555... 556 557--- 558name: extract_s8_v5s1_offset4 559body: | 560 bb.0: 561 ; CHECK-LABEL: name: extract_s8_v5s1_offset4 562 ; CHECK: [[DEF:%[0-9]+]]:_(<5 x s32>) = G_IMPLICIT_DEF 563 ; CHECK: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32), [[UV4:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[DEF]](<5 x s32>) 564 ; CHECK: [[DEF1:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF 565 ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[UV]](s32), [[UV1]](s32) 566 ; CHECK: [[BUILD_VECTOR1:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[UV2]](s32), [[UV3]](s32) 567 ; CHECK: [[BUILD_VECTOR2:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[UV4]](s32), [[DEF1]](s32) 568 ; CHECK: [[TRUNC:%[0-9]+]]:_(<2 x s16>) = G_TRUNC [[BUILD_VECTOR]](<2 x s32>) 569 ; CHECK: [[TRUNC1:%[0-9]+]]:_(<2 x s16>) = G_TRUNC [[BUILD_VECTOR1]](<2 x s32>) 570 ; CHECK: [[TRUNC2:%[0-9]+]]:_(<2 x s16>) = G_TRUNC [[BUILD_VECTOR2]](<2 x s32>) 571 ; CHECK: [[DEF2:%[0-9]+]]:_(<2 x s16>) = G_IMPLICIT_DEF 572 ; CHECK: [[CONCAT_VECTORS:%[0-9]+]]:_(<10 x s16>) = G_CONCAT_VECTORS [[TRUNC]](<2 x s16>), [[TRUNC1]](<2 x s16>), [[TRUNC2]](<2 x s16>), [[DEF2]](<2 x s16>), [[DEF2]](<2 x s16>) 573 ; CHECK: [[UV5:%[0-9]+]]:_(<5 x s16>), [[UV6:%[0-9]+]]:_(<5 x s16>) = G_UNMERGE_VALUES [[CONCAT_VECTORS]](<10 x s16>) 574 ; CHECK: [[DEF3:%[0-9]+]]:_(<6 x s16>) = G_IMPLICIT_DEF 575 ; CHECK: [[INSERT:%[0-9]+]]:_(<6 x s16>) = G_INSERT [[DEF3]], [[UV5]](<5 x s16>), 0 576 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s16) = G_EXTRACT [[INSERT]](<6 x s16>), 64 577 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[EXTRACT]](s16) 578 ; CHECK: $vgpr0 = COPY [[ANYEXT]](s32) 579 %0:_(<5 x s1>) = G_IMPLICIT_DEF 580 %1:_(s1) = G_EXTRACT %0, 4 581 %2:_(s32) = G_ANYEXT %1 582 $vgpr0 = COPY %2 583... 584 585--- 586name: extract_v2s16_v4s16_offset32 587body: | 588 bb.0: 589 ; CHECK-LABEL: name: extract_v2s16_v4s16_offset32 590 ; CHECK: [[DEF:%[0-9]+]]:_(<4 x s16>) = G_IMPLICIT_DEF 591 ; CHECK: [[EXTRACT:%[0-9]+]]:_(<2 x s16>) = G_EXTRACT [[DEF]](<4 x s16>), 32 592 ; CHECK: $vgpr0 = COPY [[EXTRACT]](<2 x s16>) 593 %0:_(<4 x s16>) = G_IMPLICIT_DEF 594 %1:_(<2 x s16>) = G_EXTRACT %0, 32 595 $vgpr0 = COPY %1 596... 597 598--- 599name: extract_v2s16_v6s16_offset32 600body: | 601 bb.0: 602 ; CHECK-LABEL: name: extract_v2s16_v6s16_offset32 603 ; CHECK: [[DEF:%[0-9]+]]:_(<6 x s16>) = G_IMPLICIT_DEF 604 ; CHECK: [[EXTRACT:%[0-9]+]]:_(<2 x s16>) = G_EXTRACT [[DEF]](<6 x s16>), 32 605 ; CHECK: $vgpr0 = COPY [[EXTRACT]](<2 x s16>) 606 %0:_(<6 x s16>) = G_IMPLICIT_DEF 607 %1:_(<2 x s16>) = G_EXTRACT %0, 32 608 $vgpr0 = COPY %1 609... 610 611--- 612name: test_extract_s8_s16_offset0 613body: | 614 bb.0: 615 liveins: $vgpr0 616 ; CHECK-LABEL: name: test_extract_s8_s16_offset0 617 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0 618 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[COPY]](s32) 619 ; CHECK: $vgpr0 = COPY [[COPY1]](s32) 620 %0:_(s32) = COPY $vgpr0 621 %1:_(s16) = G_TRUNC %0 622 %2:_(s8) = G_EXTRACT %1, 0 623 %3:_(s32) = G_ANYEXT %2 624 $vgpr0 = COPY %3 625... 626 627--- 628name: test_extract_s8_s16_offset1 629body: | 630 bb.0: 631 liveins: $vgpr0 632 ; CHECK-LABEL: name: test_extract_s8_s16_offset1 633 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0 634 ; CHECK: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32) 635 ; CHECK: [[C:%[0-9]+]]:_(s16) = G_CONSTANT i16 1 636 ; CHECK: [[LSHR:%[0-9]+]]:_(s16) = G_LSHR [[TRUNC]], [[C]](s16) 637 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[LSHR]](s16) 638 ; CHECK: $vgpr0 = COPY [[ANYEXT]](s32) 639 %0:_(s32) = COPY $vgpr0 640 %1:_(s16) = G_TRUNC %0 641 %2:_(s8) = G_EXTRACT %1, 1 642 %3:_(s32) = G_ANYEXT %2 643 $vgpr0 = COPY %3 644... 645 646--- 647name: test_extract_s8_s16_offset8 648body: | 649 bb.0: 650 liveins: $vgpr0 651 ; CHECK-LABEL: name: test_extract_s8_s16_offset8 652 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0 653 ; CHECK: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32) 654 ; CHECK: [[C:%[0-9]+]]:_(s16) = G_CONSTANT i16 8 655 ; CHECK: [[LSHR:%[0-9]+]]:_(s16) = G_LSHR [[TRUNC]], [[C]](s16) 656 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[LSHR]](s16) 657 ; CHECK: $vgpr0 = COPY [[ANYEXT]](s32) 658 %0:_(s32) = COPY $vgpr0 659 %1:_(s16) = G_TRUNC %0 660 %2:_(s8) = G_EXTRACT %1, 8 661 %3:_(s32) = G_ANYEXT %2 662 $vgpr0 = COPY %3 663... 664 665--- 666name: test_extract_s8_s32_offset0 667body: | 668 bb.0: 669 liveins: $vgpr0 670 ; CHECK-LABEL: name: test_extract_s8_s32_offset0 671 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0 672 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[COPY]](s32) 673 ; CHECK: $vgpr0 = COPY [[COPY1]](s32) 674 %0:_(s32) = COPY $vgpr0 675 %1:_(s8) = G_EXTRACT %0, 0 676 %2:_(s32) = G_ANYEXT %1 677 $vgpr0 = COPY %2 678... 679 680--- 681name: test_extract_s8_s32_offset1 682body: | 683 bb.0: 684 liveins: $vgpr0 685 ; CHECK-LABEL: name: test_extract_s8_s32_offset1 686 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0 687 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1 688 ; CHECK: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C]](s32) 689 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32) 690 ; CHECK: $vgpr0 = COPY [[COPY1]](s32) 691 %0:_(s32) = COPY $vgpr0 692 %1:_(s8) = G_EXTRACT %0, 1 693 %2:_(s32) = G_ANYEXT %1 694 $vgpr0 = COPY %2 695... 696 697--- 698name: test_extract_s8_s32_offset8 699body: | 700 bb.0: 701 liveins: $vgpr0 702 ; CHECK-LABEL: name: test_extract_s8_s32_offset8 703 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0 704 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 8 705 ; CHECK: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C]](s32) 706 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32) 707 ; CHECK: $vgpr0 = COPY [[COPY1]](s32) 708 %0:_(s32) = COPY $vgpr0 709 %1:_(s8) = G_EXTRACT %0, 8 710 %2:_(s32) = G_ANYEXT %1 711 $vgpr0 = COPY %2 712... 713 714--- 715name: test_extract_s8_s32_offset16 716body: | 717 bb.0: 718 liveins: $vgpr0 719 ; CHECK-LABEL: name: test_extract_s8_s32_offset16 720 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0 721 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16 722 ; CHECK: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C]](s32) 723 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32) 724 ; CHECK: $vgpr0 = COPY [[COPY1]](s32) 725 %0:_(s32) = COPY $vgpr0 726 %1:_(s8) = G_EXTRACT %0, 16 727 %2:_(s32) = G_ANYEXT %1 728 $vgpr0 = COPY %2 729... 730 731--- 732name: test_extract_s8_s32_offset24 733body: | 734 bb.0: 735 liveins: $vgpr0 736 ; CHECK-LABEL: name: test_extract_s8_s32_offset24 737 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0 738 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16 739 ; CHECK: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C]](s32) 740 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32) 741 ; CHECK: $vgpr0 = COPY [[COPY1]](s32) 742 %0:_(s32) = COPY $vgpr0 743 %1:_(s8) = G_EXTRACT %0, 16 744 %2:_(s32) = G_ANYEXT %1 745 $vgpr0 = COPY %2 746... 747 748--- 749name: test_extract_s8_p3_offset0 750body: | 751 bb.0: 752 liveins: $vgpr0 753 ; CHECK-LABEL: name: test_extract_s8_p3_offset0 754 ; CHECK: [[COPY:%[0-9]+]]:_(p3) = COPY $vgpr0 755 ; CHECK: [[PTRTOINT:%[0-9]+]]:_(s32) = G_PTRTOINT [[COPY]](p3) 756 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[PTRTOINT]](s32) 757 ; CHECK: $vgpr0 = COPY [[COPY1]](s32) 758 %0:_(p3) = COPY $vgpr0 759 %1:_(s8) = G_EXTRACT %0, 0 760 %2:_(s32) = G_ANYEXT %1 761 $vgpr0 = COPY %2 762... 763 764--- 765name: test_extract_s8_p3_offset8 766body: | 767 bb.0: 768 liveins: $vgpr0 769 ; CHECK-LABEL: name: test_extract_s8_p3_offset8 770 ; CHECK: [[COPY:%[0-9]+]]:_(p3) = COPY $vgpr0 771 ; CHECK: [[PTRTOINT:%[0-9]+]]:_(s32) = G_PTRTOINT [[COPY]](p3) 772 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 8 773 ; CHECK: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[PTRTOINT]], [[C]](s32) 774 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32) 775 ; CHECK: $vgpr0 = COPY [[COPY1]](s32) 776 %0:_(p3) = COPY $vgpr0 777 %1:_(s8) = G_EXTRACT %0, 8 778 %2:_(s32) = G_ANYEXT %1 779 $vgpr0 = COPY %2 780... 781 782--- 783name: test_extract_s1_s8_offset0 784body: | 785 bb.0: 786 liveins: $vgpr0 787 ; CHECK-LABEL: name: test_extract_s1_s8_offset0 788 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0 789 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[COPY]](s32) 790 ; CHECK: $vgpr0 = COPY [[COPY1]](s32) 791 %0:_(s32) = COPY $vgpr0 792 %1:_(s8) = G_TRUNC %0 793 %2:_(s1) = G_EXTRACT %1, 0 794 %3:_(s32) = G_ANYEXT %2 795 $vgpr0 = COPY %3 796... 797 798--- 799name: test_extract_s1_s8_offset2 800body: | 801 bb.0: 802 liveins: $vgpr0 803 ; CHECK-LABEL: name: test_extract_s1_s8_offset2 804 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0 805 ; CHECK: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32) 806 ; CHECK: [[C:%[0-9]+]]:_(s16) = G_CONSTANT i16 2 807 ; CHECK: [[LSHR:%[0-9]+]]:_(s16) = G_LSHR [[TRUNC]], [[C]](s16) 808 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[LSHR]](s16) 809 ; CHECK: $vgpr0 = COPY [[ANYEXT]](s32) 810 %0:_(s32) = COPY $vgpr0 811 %1:_(s8) = G_TRUNC %0 812 %2:_(s1) = G_EXTRACT %1, 2 813 %3:_(s32) = G_ANYEXT %2 814 $vgpr0 = COPY %3 815... 816 817--- 818name: test_extract_s8_s64_offset2 819body: | 820 bb.0: 821 liveins: $vgpr0_vgpr1 822 ; CHECK-LABEL: name: test_extract_s8_s64_offset2 823 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1 824 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 2 825 ; CHECK: [[LSHR:%[0-9]+]]:_(s64) = G_LSHR [[COPY]], [[C]](s32) 826 ; CHECK: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[LSHR]](s64) 827 ; CHECK: $vgpr0 = COPY [[TRUNC]](s32) 828 %0:_(s64) = COPY $vgpr0_vgpr1 829 %1:_(s8) = G_EXTRACT %0, 2 830 %2:_(s32) = G_ANYEXT %1 831 $vgpr0 = COPY %2 832... 833 834--- 835name: extract_s16_v3s16_offset0 836body: | 837 bb.0: 838 839 ; CHECK-LABEL: name: extract_s16_v3s16_offset0 840 ; CHECK: [[DEF:%[0-9]+]]:_(<4 x s16>) = G_IMPLICIT_DEF 841 ; CHECK: [[DEF1:%[0-9]+]]:_(<4 x s16>) = G_IMPLICIT_DEF 842 ; CHECK: [[CONCAT_VECTORS:%[0-9]+]]:_(<12 x s16>) = G_CONCAT_VECTORS [[DEF]](<4 x s16>), [[DEF1]](<4 x s16>), [[DEF1]](<4 x s16>) 843 ; CHECK: [[UV:%[0-9]+]]:_(<3 x s16>), [[UV1:%[0-9]+]]:_(<3 x s16>), [[UV2:%[0-9]+]]:_(<3 x s16>), [[UV3:%[0-9]+]]:_(<3 x s16>) = G_UNMERGE_VALUES [[CONCAT_VECTORS]](<12 x s16>) 844 ; CHECK: [[INSERT:%[0-9]+]]:_(<4 x s16>) = G_INSERT [[DEF1]], [[UV]](<3 x s16>), 0 845 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s16) = G_EXTRACT [[INSERT]](<4 x s16>), 0 846 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[EXTRACT]](s16) 847 ; CHECK: $vgpr0 = COPY [[ANYEXT]](s32) 848 %0:_(<3 x s16>) = G_IMPLICIT_DEF 849 %1:_(s16) = G_EXTRACT %0, 0 850 %2:_(s32) = G_ANYEXT %1 851 $vgpr0 = COPY %2 852... 853 854--- 855name: test_extract_s8_s64_offset16 856body: | 857 bb.0: 858 liveins: $vgpr0_vgpr1 859 ; CHECK-LABEL: name: test_extract_s8_s64_offset16 860 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1 861 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16 862 ; CHECK: [[LSHR:%[0-9]+]]:_(s64) = G_LSHR [[COPY]], [[C]](s32) 863 ; CHECK: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[LSHR]](s64) 864 ; CHECK: $vgpr0 = COPY [[TRUNC]](s32) 865 %0:_(s64) = COPY $vgpr0_vgpr1 866 %1:_(s8) = G_EXTRACT %0, 16 867 %2:_(s32) = G_ANYEXT %1 868 $vgpr0 = COPY %2 869... 870 871--- 872name: test_extract_s16_s64_offset16 873body: | 874 bb.0: 875 liveins: $vgpr0_vgpr1 876 ; CHECK-LABEL: name: test_extract_s16_s64_offset16 877 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1 878 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s16) = G_EXTRACT [[COPY]](s64), 16 879 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[EXTRACT]](s16) 880 ; CHECK: $vgpr0 = COPY [[ANYEXT]](s32) 881 %0:_(s64) = COPY $vgpr0_vgpr1 882 %1:_(s16) = G_EXTRACT %0, 16 883 %2:_(s32) = G_ANYEXT %1 884 $vgpr0 = COPY %2 885... 886 887--- 888name: test_extract_s16_s64_offset32 889body: | 890 bb.0: 891 liveins: $vgpr0_vgpr1 892 ; CHECK-LABEL: name: test_extract_s16_s64_offset32 893 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1 894 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s16) = G_EXTRACT [[COPY]](s64), 32 895 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[EXTRACT]](s16) 896 ; CHECK: $vgpr0 = COPY [[ANYEXT]](s32) 897 %0:_(s64) = COPY $vgpr0_vgpr1 898 %1:_(s16) = G_EXTRACT %0, 32 899 %2:_(s32) = G_ANYEXT %1 900 $vgpr0 = COPY %2 901... 902 903--- 904name: test_extract_s16_s64_offset48 905body: | 906 bb.0: 907 liveins: $vgpr0_vgpr1 908 ; CHECK-LABEL: name: test_extract_s16_s64_offset48 909 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1 910 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s16) = G_EXTRACT [[COPY]](s64), 48 911 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[EXTRACT]](s16) 912 ; CHECK: $vgpr0 = COPY [[ANYEXT]](s32) 913 %0:_(s64) = COPY $vgpr0_vgpr1 914 %1:_(s16) = G_EXTRACT %0, 48 915 %2:_(s32) = G_ANYEXT %1 916 $vgpr0 = COPY %2 917... 918 919--- 920name: extract_v2s16_v3s16_offset0 921body: | 922 bb.0: 923 924 ; CHECK-LABEL: name: extract_v2s16_v3s16_offset0 925 ; CHECK: [[DEF:%[0-9]+]]:_(<4 x s16>) = G_IMPLICIT_DEF 926 ; CHECK: [[DEF1:%[0-9]+]]:_(<4 x s16>) = G_IMPLICIT_DEF 927 ; CHECK: [[CONCAT_VECTORS:%[0-9]+]]:_(<12 x s16>) = G_CONCAT_VECTORS [[DEF]](<4 x s16>), [[DEF1]](<4 x s16>), [[DEF1]](<4 x s16>) 928 ; CHECK: [[UV:%[0-9]+]]:_(<3 x s16>), [[UV1:%[0-9]+]]:_(<3 x s16>), [[UV2:%[0-9]+]]:_(<3 x s16>), [[UV3:%[0-9]+]]:_(<3 x s16>) = G_UNMERGE_VALUES [[CONCAT_VECTORS]](<12 x s16>) 929 ; CHECK: [[INSERT:%[0-9]+]]:_(<4 x s16>) = G_INSERT [[DEF1]], [[UV]](<3 x s16>), 0 930 ; CHECK: [[EXTRACT:%[0-9]+]]:_(<2 x s16>) = G_EXTRACT [[INSERT]](<4 x s16>), 0 931 ; CHECK: $vgpr0 = COPY [[EXTRACT]](<2 x s16>) 932 %0:_(<3 x s16>) = G_IMPLICIT_DEF 933 %1:_(<2 x s16>) = G_EXTRACT %0, 0 934 $vgpr0 = COPY %1 935... 936 937--- 938name: extract_v2s16_v5s16_offset0 939body: | 940 bb.0: 941 942 ; CHECK-LABEL: name: extract_v2s16_v5s16_offset0 943 ; CHECK: [[DEF:%[0-9]+]]:_(<6 x s16>) = G_IMPLICIT_DEF 944 ; CHECK: [[DEF1:%[0-9]+]]:_(<6 x s16>) = G_IMPLICIT_DEF 945 ; CHECK: [[CONCAT_VECTORS:%[0-9]+]]:_(<30 x s16>) = G_CONCAT_VECTORS [[DEF]](<6 x s16>), [[DEF1]](<6 x s16>), [[DEF1]](<6 x s16>), [[DEF1]](<6 x s16>), [[DEF1]](<6 x s16>) 946 ; CHECK: [[UV:%[0-9]+]]:_(<5 x s16>), [[UV1:%[0-9]+]]:_(<5 x s16>), [[UV2:%[0-9]+]]:_(<5 x s16>), [[UV3:%[0-9]+]]:_(<5 x s16>), [[UV4:%[0-9]+]]:_(<5 x s16>), [[UV5:%[0-9]+]]:_(<5 x s16>) = G_UNMERGE_VALUES [[CONCAT_VECTORS]](<30 x s16>) 947 ; CHECK: [[INSERT:%[0-9]+]]:_(<6 x s16>) = G_INSERT [[DEF1]], [[UV]](<5 x s16>), 0 948 ; CHECK: [[EXTRACT:%[0-9]+]]:_(<2 x s16>) = G_EXTRACT [[INSERT]](<6 x s16>), 0 949 ; CHECK: $vgpr0 = COPY [[EXTRACT]](<2 x s16>) 950 %0:_(<5 x s16>) = G_IMPLICIT_DEF 951 %1:_(<2 x s16>) = G_EXTRACT %0, 0 952 $vgpr0 = COPY %1 953... 954 955--- 956name: extract_s16_v2s16_offset0 957body: | 958 bb.0: 959 liveins: $vgpr0 960 961 ; CHECK-LABEL: name: extract_s16_v2s16_offset0 962 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s16>) = COPY $vgpr0 963 ; CHECK: [[BITCAST:%[0-9]+]]:_(s32) = G_BITCAST [[COPY]](<2 x s16>) 964 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[BITCAST]](s32) 965 ; CHECK: $vgpr0 = COPY [[COPY1]](s32) 966 %0:_(<2 x s16>) = COPY $vgpr0 967 %1:_(s16) = G_EXTRACT %0, 0 968 %2:_(s32) = G_ANYEXT %1 969 $vgpr0 = COPY %2 970... 971 972--- 973name: extract_s16_v2s16_offset1 974body: | 975 bb.0: 976 liveins: $vgpr0 977 978 ; CHECK-LABEL: name: extract_s16_v2s16_offset1 979 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s16>) = COPY $vgpr0 980 ; CHECK: [[BITCAST:%[0-9]+]]:_(s32) = G_BITCAST [[COPY]](<2 x s16>) 981 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1 982 ; CHECK: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST]], [[C]](s32) 983 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32) 984 ; CHECK: $vgpr0 = COPY [[COPY1]](s32) 985 %0:_(<2 x s16>) = COPY $vgpr0 986 %1:_(s16) = G_EXTRACT %0, 1 987 %2:_(s32) = G_ANYEXT %1 988 $vgpr0 = COPY %2 989... 990 991--- 992name: extract_s16_v2s16_offset8 993body: | 994 bb.0: 995 liveins: $vgpr0 996 997 ; CHECK-LABEL: name: extract_s16_v2s16_offset8 998 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s16>) = COPY $vgpr0 999 ; CHECK: [[BITCAST:%[0-9]+]]:_(s32) = G_BITCAST [[COPY]](<2 x s16>) 1000 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 8 1001 ; CHECK: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST]], [[C]](s32) 1002 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32) 1003 ; CHECK: $vgpr0 = COPY [[COPY1]](s32) 1004 %0:_(<2 x s16>) = COPY $vgpr0 1005 %1:_(s16) = G_EXTRACT %0, 8 1006 %2:_(s32) = G_ANYEXT %1 1007 $vgpr0 = COPY %2 1008... 1009 1010--- 1011name: extract_s16_v2s16_offset16 1012body: | 1013 bb.0: 1014 liveins: $vgpr0 1015 1016 ; CHECK-LABEL: name: extract_s16_v2s16_offset16 1017 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s16>) = COPY $vgpr0 1018 ; CHECK: [[BITCAST:%[0-9]+]]:_(s32) = G_BITCAST [[COPY]](<2 x s16>) 1019 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16 1020 ; CHECK: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST]], [[C]](s32) 1021 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32) 1022 ; CHECK: $vgpr0 = COPY [[COPY1]](s32) 1023 %0:_(<2 x s16>) = COPY $vgpr0 1024 %1:_(s16) = G_EXTRACT %0, 16 1025 %2:_(s32) = G_ANYEXT %1 1026 $vgpr0 = COPY %2 1027... 1028 1029--- 1030name: extract_s16_s32_offset0 1031body: | 1032 bb.0: 1033 liveins: $vgpr0 1034 1035 ; CHECK-LABEL: name: extract_s16_s32_offset0 1036 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0 1037 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[COPY]](s32) 1038 ; CHECK: $vgpr0 = COPY [[COPY1]](s32) 1039 %0:_(s32) = COPY $vgpr0 1040 %1:_(s16) = G_EXTRACT %0, 0 1041 %2:_(s32) = G_ANYEXT %1 1042 $vgpr0 = COPY %2 1043... 1044 1045--- 1046name: extract_s16_s32_offset1 1047body: | 1048 bb.0: 1049 liveins: $vgpr0 1050 1051 ; CHECK-LABEL: name: extract_s16_s32_offset1 1052 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0 1053 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1 1054 ; CHECK: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C]](s32) 1055 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32) 1056 ; CHECK: $vgpr0 = COPY [[COPY1]](s32) 1057 %0:_(s32) = COPY $vgpr0 1058 %1:_(s16) = G_EXTRACT %0, 1 1059 %2:_(s32) = G_ANYEXT %1 1060 $vgpr0 = COPY %2 1061... 1062 1063--- 1064name: extract_s16_s32_offset8 1065body: | 1066 bb.0: 1067 liveins: $vgpr0 1068 1069 ; CHECK-LABEL: name: extract_s16_s32_offset8 1070 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0 1071 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 8 1072 ; CHECK: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C]](s32) 1073 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32) 1074 ; CHECK: $vgpr0 = COPY [[COPY1]](s32) 1075 %0:_(s32) = COPY $vgpr0 1076 %1:_(s16) = G_EXTRACT %0, 8 1077 %2:_(s32) = G_ANYEXT %1 1078 $vgpr0 = COPY %2 1079... 1080 1081--- 1082name: extract_s16_s32_offset16 1083body: | 1084 bb.0: 1085 liveins: $vgpr0 1086 1087 ; CHECK-LABEL: name: extract_s16_s32_offset16 1088 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0 1089 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16 1090 ; CHECK: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C]](s32) 1091 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32) 1092 ; CHECK: $vgpr0 = COPY [[COPY1]](s32) 1093 %0:_(s32) = COPY $vgpr0 1094 %1:_(s16) = G_EXTRACT %0, 16 1095 %2:_(s32) = G_ANYEXT %1 1096 $vgpr0 = COPY %2 1097... 1098 1099--- 1100name: extract_s16_p3_offset0 1101body: | 1102 bb.0: 1103 liveins: $vgpr0 1104 1105 ; CHECK-LABEL: name: extract_s16_p3_offset0 1106 ; CHECK: [[COPY:%[0-9]+]]:_(p3) = COPY $vgpr0 1107 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s16) = G_EXTRACT [[COPY]](p3), 0 1108 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[EXTRACT]](s16) 1109 ; CHECK: $vgpr0 = COPY [[ANYEXT]](s32) 1110 %0:_(p3) = COPY $vgpr0 1111 %1:_(s16) = G_EXTRACT %0, 0 1112 %2:_(s32) = G_ANYEXT %1 1113 $vgpr0 = COPY %2 1114... 1115 1116--- 1117name: extract_s16_p3_offset1 1118body: | 1119 bb.0: 1120 liveins: $vgpr0 1121 1122 ; CHECK-LABEL: name: extract_s16_p3_offset1 1123 ; CHECK: [[COPY:%[0-9]+]]:_(p3) = COPY $vgpr0 1124 ; CHECK: [[EXTRACT:%[0-9]+]]:_(s16) = G_EXTRACT [[COPY]](p3), 1 1125 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[EXTRACT]](s16) 1126 ; CHECK: $vgpr0 = COPY [[ANYEXT]](s32) 1127 %0:_(p3) = COPY $vgpr0 1128 %1:_(s16) = G_EXTRACT %0, 1 1129 %2:_(s32) = G_ANYEXT %1 1130 $vgpr0 = COPY %2 1131... 1132