[AMDGPU] Make v8i16/v8f16 legal
[llvm-project.git] / llvm / test / CodeGen / AMDGPU / GlobalISel / inst-select-lshr.v2s16.mir
blobb9039dde48f85e4d2f39180118b03b76f5459c6d
1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -march=amdgcn -mcpu=gfx900 -run-pass=instruction-select -global-isel-abort=2 -pass-remarks-missed='gisel*' -verify-machineinstrs %s -o - 2>%t | FileCheck -check-prefix=GFX9 %s
3 # RUN: FileCheck -check-prefixes=ERR-GFX910,ERR %s < %t
5 # RUN: llc -march=amdgcn -mcpu=gfx1010 -run-pass=instruction-select -global-isel-abort=2 -pass-remarks-missed='gisel*' -verify-machineinstrs %s -o - 2>%t | FileCheck -check-prefix=GFX10 %s
6 # RUN: FileCheck -check-prefixes=ERR-GFX910,ERR %s < %t
8 # ERR-NOT: remark
9 # ERR-GFX910: remark: <unknown>:0:0: cannot select: %2:sgpr(<2 x s16>) = G_LSHR %0:sgpr, %1:sgpr(<2 x s16>) (in function: lshr_v2s16_ss)
10 # ERR-NOT: remark
12 ---
13 name: lshr_v2s16_ss
14 legalized: true
15 regBankSelected: true
17 body: |
18   bb.0:
19     liveins: $sgpr0, $sgpr1
20     ; GFX6-LABEL: name: lshr_v2s16_ss
21     ; GFX6: [[COPY:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr0
22     ; GFX6: [[COPY1:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr1
23     ; GFX6: [[LSHR:%[0-9]+]]:sgpr(<2 x s16>) = G_LSHR [[COPY]], [[COPY1]](<2 x s16>)
24     ; GFX6: S_ENDPGM 0, implicit [[LSHR]](<2 x s16>)
25     ; GFX7-LABEL: name: lshr_v2s16_ss
26     ; GFX7: [[COPY:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr0
27     ; GFX7: [[COPY1:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr1
28     ; GFX7: [[LSHR:%[0-9]+]]:sgpr(<2 x s16>) = G_LSHR [[COPY]], [[COPY1]](<2 x s16>)
29     ; GFX7: S_ENDPGM 0, implicit [[LSHR]](<2 x s16>)
30     ; GFX8-LABEL: name: lshr_v2s16_ss
31     ; GFX8: [[COPY:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr0
32     ; GFX8: [[COPY1:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr1
33     ; GFX8: [[LSHR:%[0-9]+]]:sgpr(<2 x s16>) = G_LSHR [[COPY]], [[COPY1]](<2 x s16>)
34     ; GFX8: S_ENDPGM 0, implicit [[LSHR]](<2 x s16>)
35     ; GFX9-LABEL: name: lshr_v2s16_ss
36     ; GFX9: [[COPY:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr0
37     ; GFX9: [[COPY1:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr1
38     ; GFX9: [[LSHR:%[0-9]+]]:sgpr(<2 x s16>) = G_LSHR [[COPY]], [[COPY1]](<2 x s16>)
39     ; GFX9: S_ENDPGM 0, implicit [[LSHR]](<2 x s16>)
40     ; GFX10-LABEL: name: lshr_v2s16_ss
41     ; GFX10: [[COPY:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr0
42     ; GFX10: [[COPY1:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr1
43     ; GFX10: [[LSHR:%[0-9]+]]:sgpr(<2 x s16>) = G_LSHR [[COPY]], [[COPY1]](<2 x s16>)
44     ; GFX10: S_ENDPGM 0, implicit [[LSHR]](<2 x s16>)
45     %0:sgpr(<2 x s16>) = COPY $sgpr0
46     %1:sgpr(<2 x s16>) = COPY $sgpr1
47     %2:sgpr(<2 x s16>) = G_LSHR %0, %1
48     S_ENDPGM 0, implicit %2
49 ...
51 ---
52 name: lshr_v2s16_sv
53 legalized: true
54 regBankSelected: true
56 body: |
57   bb.0:
58     liveins: $sgpr0, $vgpr0
59     ; GFX6-LABEL: name: lshr_v2s16_sv
60     ; GFX6: [[COPY:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr0
61     ; GFX6: [[COPY1:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr0
62     ; GFX6: [[LSHR:%[0-9]+]]:vgpr(<2 x s16>) = G_LSHR [[COPY]], [[COPY1]](<2 x s16>)
63     ; GFX6: S_ENDPGM 0, implicit [[LSHR]](<2 x s16>)
64     ; GFX7-LABEL: name: lshr_v2s16_sv
65     ; GFX7: [[COPY:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr0
66     ; GFX7: [[COPY1:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr0
67     ; GFX7: [[LSHR:%[0-9]+]]:vgpr(<2 x s16>) = G_LSHR [[COPY]], [[COPY1]](<2 x s16>)
68     ; GFX7: S_ENDPGM 0, implicit [[LSHR]](<2 x s16>)
69     ; GFX8-LABEL: name: lshr_v2s16_sv
70     ; GFX8: [[COPY:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr0
71     ; GFX8: [[COPY1:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr0
72     ; GFX8: [[LSHR:%[0-9]+]]:vgpr(<2 x s16>) = G_LSHR [[COPY]], [[COPY1]](<2 x s16>)
73     ; GFX8: S_ENDPGM 0, implicit [[LSHR]](<2 x s16>)
74     ; GFX9-LABEL: name: lshr_v2s16_sv
75     ; GFX9: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
76     ; GFX9: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr0
77     ; GFX9: [[V_PK_LSHRREV_B16_:%[0-9]+]]:vgpr_32 = V_PK_LSHRREV_B16 8, [[COPY1]], 8, [[COPY]], 0, 0, 0, 0, 0, implicit $exec
78     ; GFX9: S_ENDPGM 0, implicit [[V_PK_LSHRREV_B16_]]
79     ; GFX10-LABEL: name: lshr_v2s16_sv
80     ; GFX10: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
81     ; GFX10: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr0
82     ; GFX10: [[V_PK_LSHRREV_B16_:%[0-9]+]]:vgpr_32 = V_PK_LSHRREV_B16 8, [[COPY1]], 8, [[COPY]], 0, 0, 0, 0, 0, implicit $exec
83     ; GFX10: S_ENDPGM 0, implicit [[V_PK_LSHRREV_B16_]]
84     %0:sgpr(<2 x s16>) = COPY $sgpr0
85     %1:vgpr(<2 x s16>) = COPY $vgpr0
86     %2:vgpr(<2 x s16>) = G_LSHR %0, %1
87     S_ENDPGM 0, implicit %2
88 ...
90 ---
91 name: lshr_v2s16_vs
92 legalized: true
93 regBankSelected: true
95 body: |
96   bb.0:
97     liveins: $sgpr0, $vgpr0
98     ; GFX6-LABEL: name: lshr_v2s16_vs
99     ; GFX6: [[COPY:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr0
100     ; GFX6: [[COPY1:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr0
101     ; GFX6: [[LSHR:%[0-9]+]]:vgpr(<2 x s16>) = G_LSHR [[COPY]], [[COPY1]](<2 x s16>)
102     ; GFX6: S_ENDPGM 0, implicit [[LSHR]](<2 x s16>)
103     ; GFX7-LABEL: name: lshr_v2s16_vs
104     ; GFX7: [[COPY:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr0
105     ; GFX7: [[COPY1:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr0
106     ; GFX7: [[LSHR:%[0-9]+]]:vgpr(<2 x s16>) = G_LSHR [[COPY]], [[COPY1]](<2 x s16>)
107     ; GFX7: S_ENDPGM 0, implicit [[LSHR]](<2 x s16>)
108     ; GFX8-LABEL: name: lshr_v2s16_vs
109     ; GFX8: [[COPY:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr0
110     ; GFX8: [[COPY1:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr0
111     ; GFX8: [[LSHR:%[0-9]+]]:vgpr(<2 x s16>) = G_LSHR [[COPY]], [[COPY1]](<2 x s16>)
112     ; GFX8: S_ENDPGM 0, implicit [[LSHR]](<2 x s16>)
113     ; GFX9-LABEL: name: lshr_v2s16_vs
114     ; GFX9: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
115     ; GFX9: [[COPY1:%[0-9]+]]:sreg_32 = COPY $sgpr0
116     ; GFX9: [[V_PK_LSHRREV_B16_:%[0-9]+]]:vgpr_32 = V_PK_LSHRREV_B16 8, [[COPY1]], 8, [[COPY]], 0, 0, 0, 0, 0, implicit $exec
117     ; GFX9: S_ENDPGM 0, implicit [[V_PK_LSHRREV_B16_]]
118     ; GFX10-LABEL: name: lshr_v2s16_vs
119     ; GFX10: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
120     ; GFX10: [[COPY1:%[0-9]+]]:sreg_32 = COPY $sgpr0
121     ; GFX10: [[V_PK_LSHRREV_B16_:%[0-9]+]]:vgpr_32 = V_PK_LSHRREV_B16 8, [[COPY1]], 8, [[COPY]], 0, 0, 0, 0, 0, implicit $exec
122     ; GFX10: S_ENDPGM 0, implicit [[V_PK_LSHRREV_B16_]]
123     %0:vgpr(<2 x s16>) = COPY $vgpr0
124     %1:sgpr(<2 x s16>) = COPY $sgpr0
125     %2:vgpr(<2 x s16>) = G_LSHR %0, %1
126     S_ENDPGM 0, implicit %2
130 name: lshr_v2s16_vv
131 legalized: true
132 regBankSelected: true
134 body: |
135   bb.0:
136     liveins: $vgpr0, $vgpr1
137     ; GFX6-LABEL: name: lshr_v2s16_vv
138     ; GFX6: [[COPY:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr0
139     ; GFX6: [[COPY1:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr1
140     ; GFX6: [[LSHR:%[0-9]+]]:vgpr(<2 x s16>) = G_LSHR [[COPY]], [[COPY1]](<2 x s16>)
141     ; GFX6: S_ENDPGM 0, implicit [[LSHR]](<2 x s16>)
142     ; GFX7-LABEL: name: lshr_v2s16_vv
143     ; GFX7: [[COPY:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr0
144     ; GFX7: [[COPY1:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr1
145     ; GFX7: [[LSHR:%[0-9]+]]:vgpr(<2 x s16>) = G_LSHR [[COPY]], [[COPY1]](<2 x s16>)
146     ; GFX7: S_ENDPGM 0, implicit [[LSHR]](<2 x s16>)
147     ; GFX8-LABEL: name: lshr_v2s16_vv
148     ; GFX8: [[COPY:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr0
149     ; GFX8: [[COPY1:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr1
150     ; GFX8: [[LSHR:%[0-9]+]]:vgpr(<2 x s16>) = G_LSHR [[COPY]], [[COPY1]](<2 x s16>)
151     ; GFX8: S_ENDPGM 0, implicit [[LSHR]](<2 x s16>)
152     ; GFX9-LABEL: name: lshr_v2s16_vv
153     ; GFX9: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
154     ; GFX9: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
155     ; GFX9: [[V_PK_LSHRREV_B16_:%[0-9]+]]:vgpr_32 = V_PK_LSHRREV_B16 8, [[COPY1]], 8, [[COPY]], 0, 0, 0, 0, 0, implicit $exec
156     ; GFX9: S_ENDPGM 0, implicit [[V_PK_LSHRREV_B16_]]
157     ; GFX10-LABEL: name: lshr_v2s16_vv
158     ; GFX10: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
159     ; GFX10: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
160     ; GFX10: [[V_PK_LSHRREV_B16_:%[0-9]+]]:vgpr_32 = V_PK_LSHRREV_B16 8, [[COPY1]], 8, [[COPY]], 0, 0, 0, 0, 0, implicit $exec
161     ; GFX10: S_ENDPGM 0, implicit [[V_PK_LSHRREV_B16_]]
162     %0:vgpr(<2 x s16>) = COPY $vgpr0
163     %1:vgpr(<2 x s16>) = COPY $vgpr1
164     %2:vgpr(<2 x s16>) = G_LSHR %0, %1
165     S_ENDPGM 0, implicit %2