[InstCombine] Signed saturation patterns
[llvm-complete.git] / test / CodeGen / AMDGPU / GlobalISel / inst-select-ashr.v2s16.mir
blob20602f748254f8f1a483ab2c5bbd2090f771308a
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_ASHR %0:sgpr, %1:sgpr(<2 x s16>) (in function: ashr_v2s16_ss)
10 # ERR-GFX910-NEXT: remark: <unknown>:0:0: cannot select: %2:vgpr(<2 x s16>) = G_ASHR %0:sgpr, %1:vgpr(<2 x s16>) (in function: ashr_v2s16_sv)
11 # ERR-GFX910-NEXT: remark: <unknown>:0:0: cannot select: %2:vgpr(<2 x s16>) = G_ASHR %0:vgpr, %1:sgpr(<2 x s16>) (in function: ashr_v2s16_vs)
12 # ERR-GFX910-NEXT: remark: <unknown>:0:0: cannot select: %2:vgpr(<2 x s16>) = G_ASHR %0:vgpr, %1:vgpr(<2 x s16>) (in function: ashr_v2s16_vv)
13 # ERR-NOT: remark
15 ---
16 name: ashr_v2s16_ss
17 legalized: true
18 regBankSelected: true
20 body: |
21   bb.0:
22     liveins: $sgpr0, $sgpr1
23     ; GFX6-LABEL: name: ashr_v2s16_ss
24     ; GFX6: [[COPY:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr0
25     ; GFX6: [[COPY1:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr1
26     ; GFX6: [[ASHR:%[0-9]+]]:sgpr(<2 x s16>) = G_ASHR [[COPY]], [[COPY1]](<2 x s16>)
27     ; GFX6: S_ENDPGM 0, implicit [[ASHR]](<2 x s16>)
28     ; GFX7-LABEL: name: ashr_v2s16_ss
29     ; GFX7: [[COPY:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr0
30     ; GFX7: [[COPY1:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr1
31     ; GFX7: [[ASHR:%[0-9]+]]:sgpr(<2 x s16>) = G_ASHR [[COPY]], [[COPY1]](<2 x s16>)
32     ; GFX7: S_ENDPGM 0, implicit [[ASHR]](<2 x s16>)
33     ; GFX8-LABEL: name: ashr_v2s16_ss
34     ; GFX8: [[COPY:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr0
35     ; GFX8: [[COPY1:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr1
36     ; GFX8: [[ASHR:%[0-9]+]]:sgpr(<2 x s16>) = G_ASHR [[COPY]], [[COPY1]](<2 x s16>)
37     ; GFX8: S_ENDPGM 0, implicit [[ASHR]](<2 x s16>)
38     ; GFX9-LABEL: name: ashr_v2s16_ss
39     ; GFX9: [[COPY:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr0
40     ; GFX9: [[COPY1:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr1
41     ; GFX9: [[ASHR:%[0-9]+]]:sgpr(<2 x s16>) = G_ASHR [[COPY]], [[COPY1]](<2 x s16>)
42     ; GFX9: S_ENDPGM 0, implicit [[ASHR]](<2 x s16>)
43     ; GFX10-LABEL: name: ashr_v2s16_ss
44     ; GFX10: [[COPY:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr0
45     ; GFX10: [[COPY1:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr1
46     ; GFX10: [[ASHR:%[0-9]+]]:sgpr(<2 x s16>) = G_ASHR [[COPY]], [[COPY1]](<2 x s16>)
47     ; GFX10: S_ENDPGM 0, implicit [[ASHR]](<2 x s16>)
48     %0:sgpr(<2 x s16>) = COPY $sgpr0
49     %1:sgpr(<2 x s16>) = COPY $sgpr1
50     %2:sgpr(<2 x s16>) = G_ASHR %0, %1
51     S_ENDPGM 0, implicit %2
52 ...
54 ---
55 name: ashr_v2s16_sv
56 legalized: true
57 regBankSelected: true
59 body: |
60   bb.0:
61     liveins: $sgpr0, $vgpr0
62     ; GFX6-LABEL: name: ashr_v2s16_sv
63     ; GFX6: [[COPY:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr0
64     ; GFX6: [[COPY1:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr0
65     ; GFX6: [[ASHR:%[0-9]+]]:vgpr(<2 x s16>) = G_ASHR [[COPY]], [[COPY1]](<2 x s16>)
66     ; GFX6: S_ENDPGM 0, implicit [[ASHR]](<2 x s16>)
67     ; GFX7-LABEL: name: ashr_v2s16_sv
68     ; GFX7: [[COPY:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr0
69     ; GFX7: [[COPY1:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr0
70     ; GFX7: [[ASHR:%[0-9]+]]:vgpr(<2 x s16>) = G_ASHR [[COPY]], [[COPY1]](<2 x s16>)
71     ; GFX7: S_ENDPGM 0, implicit [[ASHR]](<2 x s16>)
72     ; GFX8-LABEL: name: ashr_v2s16_sv
73     ; GFX8: [[COPY:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr0
74     ; GFX8: [[COPY1:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr0
75     ; GFX8: [[ASHR:%[0-9]+]]:vgpr(<2 x s16>) = G_ASHR [[COPY]], [[COPY1]](<2 x s16>)
76     ; GFX8: S_ENDPGM 0, implicit [[ASHR]](<2 x s16>)
77     ; GFX9-LABEL: name: ashr_v2s16_sv
78     ; GFX9: [[COPY:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr0
79     ; GFX9: [[COPY1:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr0
80     ; GFX9: [[ASHR:%[0-9]+]]:vgpr(<2 x s16>) = G_ASHR [[COPY]], [[COPY1]](<2 x s16>)
81     ; GFX9: S_ENDPGM 0, implicit [[ASHR]](<2 x s16>)
82     ; GFX10-LABEL: name: ashr_v2s16_sv
83     ; GFX10: [[COPY:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr0
84     ; GFX10: [[COPY1:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr0
85     ; GFX10: [[ASHR:%[0-9]+]]:vgpr(<2 x s16>) = G_ASHR [[COPY]], [[COPY1]](<2 x s16>)
86     ; GFX10: S_ENDPGM 0, implicit [[ASHR]](<2 x s16>)
87     %0:sgpr(<2 x s16>) = COPY $sgpr0
88     %1:vgpr(<2 x s16>) = COPY $vgpr0
89     %2:vgpr(<2 x s16>) = G_ASHR %0, %1
90     S_ENDPGM 0, implicit %2
91 ...
93 ---
94 name: ashr_v2s16_vs
95 legalized: true
96 regBankSelected: true
98 body: |
99   bb.0:
100     liveins: $sgpr0, $vgpr0
101     ; GFX6-LABEL: name: ashr_v2s16_vs
102     ; GFX6: [[COPY:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr0
103     ; GFX6: [[COPY1:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr0
104     ; GFX6: [[ASHR:%[0-9]+]]:vgpr(<2 x s16>) = G_ASHR [[COPY]], [[COPY1]](<2 x s16>)
105     ; GFX6: S_ENDPGM 0, implicit [[ASHR]](<2 x s16>)
106     ; GFX7-LABEL: name: ashr_v2s16_vs
107     ; GFX7: [[COPY:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr0
108     ; GFX7: [[COPY1:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr0
109     ; GFX7: [[ASHR:%[0-9]+]]:vgpr(<2 x s16>) = G_ASHR [[COPY]], [[COPY1]](<2 x s16>)
110     ; GFX7: S_ENDPGM 0, implicit [[ASHR]](<2 x s16>)
111     ; GFX8-LABEL: name: ashr_v2s16_vs
112     ; GFX8: [[COPY:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr0
113     ; GFX8: [[COPY1:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr0
114     ; GFX8: [[ASHR:%[0-9]+]]:vgpr(<2 x s16>) = G_ASHR [[COPY]], [[COPY1]](<2 x s16>)
115     ; GFX8: S_ENDPGM 0, implicit [[ASHR]](<2 x s16>)
116     ; GFX9-LABEL: name: ashr_v2s16_vs
117     ; GFX9: [[COPY:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr0
118     ; GFX9: [[COPY1:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr0
119     ; GFX9: [[ASHR:%[0-9]+]]:vgpr(<2 x s16>) = G_ASHR [[COPY]], [[COPY1]](<2 x s16>)
120     ; GFX9: S_ENDPGM 0, implicit [[ASHR]](<2 x s16>)
121     ; GFX10-LABEL: name: ashr_v2s16_vs
122     ; GFX10: [[COPY:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr0
123     ; GFX10: [[COPY1:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr0
124     ; GFX10: [[ASHR:%[0-9]+]]:vgpr(<2 x s16>) = G_ASHR [[COPY]], [[COPY1]](<2 x s16>)
125     ; GFX10: S_ENDPGM 0, implicit [[ASHR]](<2 x s16>)
126     %0:vgpr(<2 x s16>) = COPY $vgpr0
127     %1:sgpr(<2 x s16>) = COPY $sgpr0
128     %2:vgpr(<2 x s16>) = G_ASHR %0, %1
129     S_ENDPGM 0, implicit %2
133 name: ashr_v2s16_vv
134 legalized: true
135 regBankSelected: true
137 body: |
138   bb.0:
139     liveins: $vgpr0, $vgpr1
140     ; GFX6-LABEL: name: ashr_v2s16_vv
141     ; GFX6: [[COPY:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr0
142     ; GFX6: [[COPY1:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr1
143     ; GFX6: [[ASHR:%[0-9]+]]:vgpr(<2 x s16>) = G_ASHR [[COPY]], [[COPY1]](<2 x s16>)
144     ; GFX6: S_ENDPGM 0, implicit [[ASHR]](<2 x s16>)
145     ; GFX7-LABEL: name: ashr_v2s16_vv
146     ; GFX7: [[COPY:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr0
147     ; GFX7: [[COPY1:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr1
148     ; GFX7: [[ASHR:%[0-9]+]]:vgpr(<2 x s16>) = G_ASHR [[COPY]], [[COPY1]](<2 x s16>)
149     ; GFX7: S_ENDPGM 0, implicit [[ASHR]](<2 x s16>)
150     ; GFX8-LABEL: name: ashr_v2s16_vv
151     ; GFX8: [[COPY:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr0
152     ; GFX8: [[COPY1:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr1
153     ; GFX8: [[ASHR:%[0-9]+]]:vgpr(<2 x s16>) = G_ASHR [[COPY]], [[COPY1]](<2 x s16>)
154     ; GFX8: S_ENDPGM 0, implicit [[ASHR]](<2 x s16>)
155     ; GFX9-LABEL: name: ashr_v2s16_vv
156     ; GFX9: [[COPY:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr0
157     ; GFX9: [[COPY1:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr1
158     ; GFX9: [[ASHR:%[0-9]+]]:vgpr(<2 x s16>) = G_ASHR [[COPY]], [[COPY1]](<2 x s16>)
159     ; GFX9: S_ENDPGM 0, implicit [[ASHR]](<2 x s16>)
160     ; GFX10-LABEL: name: ashr_v2s16_vv
161     ; GFX10: [[COPY:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr0
162     ; GFX10: [[COPY1:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr1
163     ; GFX10: [[ASHR:%[0-9]+]]:vgpr(<2 x s16>) = G_ASHR [[COPY]], [[COPY1]](<2 x s16>)
164     ; GFX10: S_ENDPGM 0, implicit [[ASHR]](<2 x s16>)
165     %0:vgpr(<2 x s16>) = COPY $vgpr0
166     %1:vgpr(<2 x s16>) = COPY $vgpr1
167     %2:vgpr(<2 x s16>) = G_ASHR %0, %1
168     S_ENDPGM 0, implicit %2