1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -march=amdgcn -mcpu=fiji -run-pass=regbankselect %s -verify-machineinstrs -o - -regbankselect-fast | FileCheck %s
3 # RUN: llc -march=amdgcn -mcpu=fiji -run-pass=regbankselect %s -verify-machineinstrs -o - -regbankselect-greedy | FileCheck %s
10 liveins: $sgpr0, $sgpr1
11 ; CHECK-LABEL: name: add_s16_ss
12 ; CHECK: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
13 ; CHECK: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
14 ; CHECK: [[TRUNC:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY]](s32)
15 ; CHECK: [[TRUNC1:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY1]](s32)
16 ; CHECK: [[ANYEXT:%[0-9]+]]:sgpr(s32) = G_ANYEXT [[TRUNC]](s16)
17 ; CHECK: [[ANYEXT1:%[0-9]+]]:sgpr(s32) = G_ANYEXT [[TRUNC1]](s16)
18 ; CHECK: [[ADD:%[0-9]+]]:sgpr(s32) = G_ADD [[ANYEXT]], [[ANYEXT1]]
19 ; CHECK: [[TRUNC2:%[0-9]+]]:sgpr(s16) = G_TRUNC [[ADD]](s32)
20 ; CHECK: S_ENDPGM 0, implicit [[TRUNC2]](s16)
21 %0:_(s32) = COPY $sgpr0
22 %1:_(s32) = COPY $sgpr1
23 %2:_(s16) = G_TRUNC %0
24 %3:_(s16) = G_TRUNC %1
25 %4:_(s16) = G_ADD %2, %3
26 S_ENDPGM 0, implicit %4
35 liveins: $sgpr0, $vgpr0
36 ; CHECK-LABEL: name: add_s16_sv
37 ; CHECK: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
38 ; CHECK: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
39 ; CHECK: [[TRUNC:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY]](s32)
40 ; CHECK: [[TRUNC1:%[0-9]+]]:vgpr(s16) = G_TRUNC [[COPY1]](s32)
41 ; CHECK: [[COPY2:%[0-9]+]]:vgpr(s16) = COPY [[TRUNC]](s16)
42 ; CHECK: [[ADD:%[0-9]+]]:vgpr(s16) = G_ADD [[COPY2]], [[TRUNC1]]
43 ; CHECK: S_ENDPGM 0, implicit [[ADD]](s16)
44 %0:_(s32) = COPY $sgpr0
45 %1:_(s32) = COPY $vgpr0
46 %2:_(s16) = G_TRUNC %0
47 %3:_(s16) = G_TRUNC %1
48 %4:_(s16) = G_ADD %2, %3
49 S_ENDPGM 0, implicit %4
58 liveins: $sgpr0, $vgpr0
59 ; CHECK-LABEL: name: add_s16_vs
60 ; CHECK: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
61 ; CHECK: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
62 ; CHECK: [[TRUNC:%[0-9]+]]:vgpr(s16) = G_TRUNC [[COPY]](s32)
63 ; CHECK: [[TRUNC1:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY1]](s32)
64 ; CHECK: [[COPY2:%[0-9]+]]:vgpr(s16) = COPY [[TRUNC1]](s16)
65 ; CHECK: [[ADD:%[0-9]+]]:vgpr(s16) = G_ADD [[TRUNC]], [[COPY2]]
66 ; CHECK: S_ENDPGM 0, implicit [[ADD]](s16)
67 %0:_(s32) = COPY $vgpr0
68 %1:_(s32) = COPY $sgpr0
69 %2:_(s16) = G_TRUNC %0
70 %3:_(s16) = G_TRUNC %1
71 %4:_(s16) = G_ADD %2, %3
72 S_ENDPGM 0, implicit %4
81 liveins: $vgpr0, $vgpr1
82 ; CHECK-LABEL: name: add_s16_vv
83 ; CHECK: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
84 ; CHECK: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
85 ; CHECK: [[TRUNC:%[0-9]+]]:vgpr(s16) = G_TRUNC [[COPY]](s32)
86 ; CHECK: [[TRUNC1:%[0-9]+]]:vgpr(s16) = G_TRUNC [[COPY1]](s32)
87 ; CHECK: [[ADD:%[0-9]+]]:vgpr(s16) = G_ADD [[TRUNC]], [[TRUNC1]]
88 ; CHECK: S_ENDPGM 0, implicit [[ADD]](s16)
89 %0:_(s32) = COPY $vgpr0
90 %1:_(s32) = COPY $vgpr1
91 %2:_(s16) = G_TRUNC %0
92 %3:_(s16) = G_TRUNC %1
93 %4:_(s16) = G_ADD %2, %3
94 S_ENDPGM 0, implicit %4