2018-12-13 16:23:51 +08:00
|
|
|
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
|
|
|
|
# RUN: llc -march=amdgcn -mcpu=fiji -run-pass=regbankselect %s -verify-machineinstrs -o - -regbankselect-fast | FileCheck %s
|
|
|
|
# RUN: llc -march=amdgcn -mcpu=fiji -run-pass=regbankselect %s -verify-machineinstrs -o - -regbankselect-greedy | FileCheck %s
|
|
|
|
|
|
|
|
---
|
2019-06-24 22:53:58 +08:00
|
|
|
name: sext_s32_to_s64_s
|
2018-12-13 16:23:51 +08:00
|
|
|
legalized: true
|
|
|
|
|
|
|
|
body: |
|
|
|
|
bb.0:
|
|
|
|
liveins: $sgpr0
|
2019-06-24 22:53:58 +08:00
|
|
|
; CHECK-LABEL: name: sext_s32_to_s64_s
|
2018-12-13 16:23:51 +08:00
|
|
|
; CHECK: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
|
|
|
|
; CHECK: [[SEXT:%[0-9]+]]:sgpr(s64) = G_SEXT [[COPY]](s32)
|
|
|
|
%0:_(s32) = COPY $sgpr0
|
|
|
|
%1:_(s64) = G_SEXT %0
|
|
|
|
...
|
|
|
|
|
|
|
|
---
|
2019-06-24 22:53:58 +08:00
|
|
|
name: sext_s32_to_s64_v
|
2018-12-13 16:23:51 +08:00
|
|
|
legalized: true
|
|
|
|
|
|
|
|
body: |
|
|
|
|
bb.0:
|
|
|
|
liveins: $vgpr0_vgpr1
|
2019-06-24 22:53:58 +08:00
|
|
|
; CHECK-LABEL: name: sext_s32_to_s64_v
|
2018-12-13 16:23:51 +08:00
|
|
|
; CHECK: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
|
|
|
|
; CHECK: [[SEXT:%[0-9]+]]:vgpr(s64) = G_SEXT [[COPY]](s32)
|
|
|
|
%0:_(s32) = COPY $vgpr0
|
|
|
|
%1:_(s64) = G_SEXT %0
|
|
|
|
...
|
2019-06-24 22:53:58 +08:00
|
|
|
|
|
|
|
---
|
|
|
|
name: sext_s1_to_s16_scc
|
|
|
|
legalized: true
|
|
|
|
|
|
|
|
body: |
|
|
|
|
bb.0:
|
|
|
|
liveins: $sgpr0, $sgpr1
|
|
|
|
; CHECK-LABEL: name: sext_s1_to_s16_scc
|
|
|
|
; CHECK: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
|
|
|
|
; CHECK: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
|
|
|
|
; CHECK: [[ICMP:%[0-9]+]]:scc(s1) = G_ICMP intpred(eq), [[COPY]](s32), [[COPY1]]
|
|
|
|
; CHECK: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 -1
|
|
|
|
; CHECK: [[C1:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
|
|
|
|
; CHECK: [[SELECT:%[0-9]+]]:sgpr(s32) = G_SELECT [[ICMP]](s1), [[C]], [[C1]]
|
|
|
|
; CHECK: [[TRUNC:%[0-9]+]]:sgpr(s16) = G_TRUNC [[SELECT]](s32)
|
|
|
|
%0:_(s32) = COPY $sgpr0
|
|
|
|
%1:_(s32) = COPY $sgpr1
|
|
|
|
%2:_(s1) = G_ICMP intpred(eq), %0, %1
|
|
|
|
%3:_(s16) = G_SEXT %2
|
|
|
|
...
|
|
|
|
|
|
|
|
---
|
|
|
|
name: sext_s1_to_s32_scc
|
|
|
|
legalized: true
|
|
|
|
|
|
|
|
body: |
|
|
|
|
bb.0:
|
|
|
|
liveins: $sgpr0, $sgpr1
|
|
|
|
; CHECK-LABEL: name: sext_s1_to_s32_scc
|
|
|
|
; CHECK: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
|
|
|
|
; CHECK: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
|
|
|
|
; CHECK: [[ICMP:%[0-9]+]]:scc(s1) = G_ICMP intpred(eq), [[COPY]](s32), [[COPY1]]
|
|
|
|
; CHECK: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 -1
|
|
|
|
; CHECK: [[C1:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
|
|
|
|
; CHECK: [[SELECT:%[0-9]+]]:sgpr(s32) = G_SELECT [[ICMP]](s1), [[C]], [[C1]]
|
|
|
|
%0:_(s32) = COPY $sgpr0
|
|
|
|
%1:_(s32) = COPY $sgpr1
|
|
|
|
%2:_(s1) = G_ICMP intpred(eq), %0, %1
|
|
|
|
%3:_(s32) = G_SEXT %2
|
|
|
|
...
|
|
|
|
|
|
|
|
---
|
|
|
|
name: sext_s1_to_s64_scc
|
|
|
|
legalized: true
|
|
|
|
|
|
|
|
body: |
|
|
|
|
bb.0:
|
|
|
|
liveins: $sgpr0, $sgpr1
|
|
|
|
; CHECK-LABEL: name: sext_s1_to_s64_scc
|
|
|
|
; CHECK: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
|
|
|
|
; CHECK: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
|
|
|
|
; CHECK: [[ICMP:%[0-9]+]]:scc(s1) = G_ICMP intpred(eq), [[COPY]](s32), [[COPY1]]
|
|
|
|
; CHECK: [[C:%[0-9]+]]:sgpr(s64) = G_CONSTANT i64 -1
|
|
|
|
; CHECK: [[C1:%[0-9]+]]:sgpr(s64) = G_CONSTANT i64 0
|
|
|
|
; CHECK: [[SELECT:%[0-9]+]]:sgpr(s64) = G_SELECT [[ICMP]](s1), [[C]], [[C1]]
|
|
|
|
%0:_(s32) = COPY $sgpr0
|
|
|
|
%1:_(s32) = COPY $sgpr1
|
|
|
|
%2:_(s1) = G_ICMP intpred(eq), %0, %1
|
|
|
|
%3:_(s64) = G_SEXT %2
|
|
|
|
...
|
|
|
|
|
|
|
|
---
|
|
|
|
name: sext_s1_to_s16_vcc
|
|
|
|
legalized: true
|
|
|
|
|
|
|
|
body: |
|
|
|
|
bb.0:
|
|
|
|
liveins: $vgpr0, $vgpr1
|
|
|
|
; CHECK-LABEL: name: sext_s1_to_s16_vcc
|
|
|
|
; CHECK: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
|
|
|
|
; CHECK: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
|
|
|
|
; CHECK: [[ICMP:%[0-9]+]]:vcc(s1) = G_ICMP intpred(eq), [[COPY]](s32), [[COPY1]]
|
|
|
|
; CHECK: [[C:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 -1
|
|
|
|
; CHECK: [[C1:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 0
|
|
|
|
; CHECK: [[SELECT:%[0-9]+]]:vgpr(s32) = G_SELECT [[ICMP]](s1), [[C]], [[C1]]
|
|
|
|
; CHECK: [[TRUNC:%[0-9]+]]:vgpr(s16) = G_TRUNC [[SELECT]](s32)
|
|
|
|
%0:_(s32) = COPY $vgpr0
|
|
|
|
%1:_(s32) = COPY $vgpr1
|
|
|
|
%2:_(s1) = G_ICMP intpred(eq), %0, %1
|
|
|
|
%3:_(s16) = G_SEXT %2
|
|
|
|
...
|
|
|
|
|
|
|
|
---
|
|
|
|
name: sext_s1_to_s32_vcc
|
|
|
|
legalized: true
|
|
|
|
|
|
|
|
body: |
|
|
|
|
bb.0:
|
|
|
|
liveins: $vgpr0, $vgpr1
|
|
|
|
; CHECK-LABEL: name: sext_s1_to_s32_vcc
|
|
|
|
; CHECK: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
|
|
|
|
; CHECK: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
|
|
|
|
; CHECK: [[ICMP:%[0-9]+]]:vcc(s1) = G_ICMP intpred(eq), [[COPY]](s32), [[COPY1]]
|
|
|
|
; CHECK: [[C:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 -1
|
|
|
|
; CHECK: [[C1:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 0
|
|
|
|
; CHECK: [[SELECT:%[0-9]+]]:vgpr(s32) = G_SELECT [[ICMP]](s1), [[C]], [[C1]]
|
|
|
|
%0:_(s32) = COPY $vgpr0
|
|
|
|
%1:_(s32) = COPY $vgpr1
|
|
|
|
%2:_(s1) = G_ICMP intpred(eq), %0, %1
|
|
|
|
%3:_(s32) = G_SEXT %2
|
|
|
|
...
|
|
|
|
|
|
|
|
---
|
|
|
|
name: sext_s1_to_s64_vcc
|
|
|
|
legalized: true
|
|
|
|
|
|
|
|
body: |
|
|
|
|
bb.0:
|
|
|
|
liveins: $vgpr0, $vgpr1
|
|
|
|
; CHECK-LABEL: name: sext_s1_to_s64_vcc
|
|
|
|
; CHECK: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
|
|
|
|
; CHECK: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
|
|
|
|
; CHECK: [[ICMP:%[0-9]+]]:vcc(s1) = G_ICMP intpred(eq), [[COPY]](s32), [[COPY1]]
|
|
|
|
; CHECK: [[C:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 -1
|
|
|
|
; CHECK: [[C1:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 0
|
|
|
|
; CHECK: [[SELECT:%[0-9]+]]:vgpr(s32) = G_SELECT [[ICMP]](s1), [[C]], [[C1]]
|
|
|
|
; CHECK: [[MV:%[0-9]+]]:vgpr(s64) = G_MERGE_VALUES [[SELECT]](s32), [[SELECT]](s32)
|
|
|
|
%0:_(s32) = COPY $vgpr0
|
|
|
|
%1:_(s32) = COPY $vgpr1
|
|
|
|
%2:_(s1) = G_ICMP intpred(eq), %0, %1
|
|
|
|
%3:_(s64) = G_SEXT %2
|
|
|
|
...
|
|
|
|
|
|
|
|
---
|
|
|
|
name: sext_s1_to_s16_sgpr
|
|
|
|
legalized: true
|
|
|
|
|
|
|
|
body: |
|
|
|
|
bb.0:
|
|
|
|
liveins: $sgpr0
|
|
|
|
; CHECK-LABEL: name: sext_s1_to_s16_sgpr
|
|
|
|
; CHECK: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
|
|
|
|
; CHECK: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[COPY]](s32)
|
|
|
|
; CHECK: [[ANYEXT:%[0-9]+]]:sgpr(s16) = G_ANYEXT [[TRUNC]](s1)
|
|
|
|
; CHECK: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 15
|
|
|
|
; CHECK: [[SHL:%[0-9]+]]:sgpr(s16) = G_SHL [[ANYEXT]], [[C]](s32)
|
|
|
|
; CHECK: [[ASHR:%[0-9]+]]:sgpr(s16) = G_ASHR [[SHL]], [[C]](s32)
|
|
|
|
%0:_(s32) = COPY $sgpr0
|
|
|
|
%1:_(s1) = G_TRUNC %0
|
|
|
|
%2:_(s16) = G_SEXT %1
|
|
|
|
...
|
|
|
|
|
|
|
|
---
|
|
|
|
name: sext_s1_to_s32_sgpr
|
|
|
|
legalized: true
|
|
|
|
|
|
|
|
body: |
|
|
|
|
bb.0:
|
|
|
|
liveins: $sgpr0
|
|
|
|
; CHECK-LABEL: name: sext_s1_to_s32_sgpr
|
|
|
|
; CHECK: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
|
|
|
|
; CHECK: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[COPY]](s32)
|
|
|
|
; CHECK: [[ANYEXT:%[0-9]+]]:sgpr(s32) = G_ANYEXT [[TRUNC]](s1)
|
|
|
|
; CHECK: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 31
|
|
|
|
; CHECK: [[SHL:%[0-9]+]]:sgpr(s32) = G_SHL [[ANYEXT]], [[C]](s32)
|
|
|
|
; CHECK: [[ASHR:%[0-9]+]]:sgpr(s32) = G_ASHR [[SHL]], [[C]](s32)
|
|
|
|
%0:_(s32) = COPY $sgpr0
|
|
|
|
%1:_(s1) = G_TRUNC %0
|
|
|
|
%2:_(s32) = G_SEXT %1
|
|
|
|
...
|
|
|
|
|
|
|
|
---
|
|
|
|
name: sext_s1_to_s64_sgpr
|
|
|
|
legalized: true
|
|
|
|
|
|
|
|
body: |
|
|
|
|
bb.0:
|
|
|
|
liveins: $sgpr0
|
|
|
|
; CHECK-LABEL: name: sext_s1_to_s64_sgpr
|
|
|
|
; CHECK: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
|
|
|
|
; CHECK: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[COPY]](s32)
|
|
|
|
; CHECK: [[ANYEXT:%[0-9]+]]:sgpr(s64) = G_ANYEXT [[TRUNC]](s1)
|
|
|
|
; CHECK: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 63
|
|
|
|
; CHECK: [[SHL:%[0-9]+]]:sgpr(s64) = G_SHL [[ANYEXT]], [[C]](s32)
|
|
|
|
; CHECK: [[ASHR:%[0-9]+]]:sgpr(s64) = G_ASHR [[SHL]], [[C]](s32)
|
|
|
|
%0:_(s32) = COPY $sgpr0
|
|
|
|
%1:_(s1) = G_TRUNC %0
|
|
|
|
%2:_(s64) = G_SEXT %1
|
|
|
|
...
|
|
|
|
|
|
|
|
---
|
|
|
|
name: sext_s1_to_s16_vgpr
|
|
|
|
legalized: true
|
|
|
|
|
|
|
|
body: |
|
|
|
|
bb.0:
|
|
|
|
liveins: $vgpr0
|
|
|
|
; CHECK-LABEL: name: sext_s1_to_s16_vgpr
|
|
|
|
; CHECK: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
|
|
|
|
; CHECK: [[TRUNC:%[0-9]+]]:vgpr(s1) = G_TRUNC [[COPY]](s32)
|
|
|
|
; CHECK: [[ANYEXT:%[0-9]+]]:vgpr(s16) = G_ANYEXT [[TRUNC]](s1)
|
|
|
|
; CHECK: [[C:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 15
|
|
|
|
; CHECK: [[SHL:%[0-9]+]]:vgpr(s16) = G_SHL [[ANYEXT]], [[C]](s32)
|
|
|
|
; CHECK: [[ASHR:%[0-9]+]]:vgpr(s16) = G_ASHR [[SHL]], [[C]](s32)
|
|
|
|
%0:_(s32) = COPY $vgpr0
|
|
|
|
%1:_(s1) = G_TRUNC %0
|
|
|
|
%2:_(s16) = G_SEXT %1
|
|
|
|
...
|
|
|
|
|
|
|
|
---
|
|
|
|
name: sext_s1_to_s32_vgpr
|
|
|
|
legalized: true
|
|
|
|
|
|
|
|
body: |
|
|
|
|
bb.0:
|
|
|
|
liveins: $vgpr0
|
|
|
|
; CHECK-LABEL: name: sext_s1_to_s32_vgpr
|
|
|
|
; CHECK: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
|
|
|
|
; CHECK: [[TRUNC:%[0-9]+]]:vgpr(s1) = G_TRUNC [[COPY]](s32)
|
|
|
|
; CHECK: [[ANYEXT:%[0-9]+]]:vgpr(s32) = G_ANYEXT [[TRUNC]](s1)
|
|
|
|
; CHECK: [[C:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 31
|
|
|
|
; CHECK: [[SHL:%[0-9]+]]:vgpr(s32) = G_SHL [[ANYEXT]], [[C]](s32)
|
|
|
|
; CHECK: [[ASHR:%[0-9]+]]:vgpr(s32) = G_ASHR [[SHL]], [[C]](s32)
|
|
|
|
%0:_(s32) = COPY $vgpr0
|
|
|
|
%1:_(s1) = G_TRUNC %0
|
|
|
|
%2:_(s32) = G_SEXT %1
|
|
|
|
...
|
|
|
|
|
|
|
|
---
|
|
|
|
name: sext_s1_to_s64_vgpr
|
|
|
|
legalized: true
|
|
|
|
|
|
|
|
body: |
|
|
|
|
bb.0:
|
|
|
|
liveins: $vgpr0
|
|
|
|
; CHECK-LABEL: name: sext_s1_to_s64_vgpr
|
|
|
|
; CHECK: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
|
|
|
|
; CHECK: [[TRUNC:%[0-9]+]]:vgpr(s1) = G_TRUNC [[COPY]](s32)
|
|
|
|
; CHECK: [[ANYEXT:%[0-9]+]]:vgpr(s64) = G_ANYEXT [[TRUNC]](s1)
|
|
|
|
; CHECK: [[C:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 63
|
|
|
|
; CHECK: [[SHL:%[0-9]+]]:vgpr(s64) = G_SHL [[ANYEXT]], [[C]](s32)
|
|
|
|
; CHECK: [[ASHR:%[0-9]+]]:vgpr(s64) = G_ASHR [[SHL]], [[C]](s32)
|
|
|
|
%0:_(s32) = COPY $vgpr0
|
|
|
|
%1:_(s1) = G_TRUNC %0
|
|
|
|
%2:_(s64) = G_SEXT %1
|
|
|
|
...
|