OLD | NEW |
1 ; This file checks that Subzero generates code in accordance with the | 1 ; This file checks that Subzero generates code in accordance with the |
2 ; calling convention for vectors. | 2 ; calling convention for vectors. |
3 | 3 |
4 ; RUN: %p2i -i %s --args -O2 --verbose none \ | 4 ; RUN: %p2i -i %s --args -O2 --verbose none \ |
5 ; RUN: | llvm-mc -triple=i686-none-nacl -filetype=obj \ | 5 ; RUN: | llvm-mc -triple=i686-none-nacl -filetype=obj \ |
6 ; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - | FileCheck %s | 6 ; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - | FileCheck %s |
7 ; RUN: %p2i -i %s --args -Om1 --verbose none \ | 7 ; RUN: %p2i -i %s --args -Om1 --verbose none \ |
8 ; RUN: | llvm-mc -triple=i686-none-nacl -filetype=obj \ | 8 ; RUN: | llvm-mc -triple=i686-none-nacl -filetype=obj \ |
9 ; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - \ | 9 ; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - \ |
10 ; RUN: | FileCheck --check-prefix=OPTM1 %s | 10 ; RUN: | FileCheck --check-prefix=OPTM1 %s |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 ; CHECK-LABEL: test_passing_vectors: | 160 ; CHECK-LABEL: test_passing_vectors: |
161 ; CHECK: sub esp, 32 | 161 ; CHECK: sub esp, 32 |
162 ; CHECK: movups [[ARG5:.*]], xmmword ptr [esp + 64] | 162 ; CHECK: movups [[ARG5:.*]], xmmword ptr [esp + 64] |
163 ; CHECK: movups xmmword ptr [esp], [[ARG5]] | 163 ; CHECK: movups xmmword ptr [esp], [[ARG5]] |
164 ; CHECK: movups [[ARG6:.*]], xmmword ptr [esp + 48] | 164 ; CHECK: movups [[ARG6:.*]], xmmword ptr [esp + 48] |
165 ; CHECK: movups xmmword ptr [esp + 16], [[ARG6]] | 165 ; CHECK: movups xmmword ptr [esp + 16], [[ARG6]] |
166 ; CHECK: movups xmm0, xmmword ptr [esp + 128] | 166 ; CHECK: movups xmm0, xmmword ptr [esp + 128] |
167 ; CHECK: movups xmm1, xmmword ptr [esp + 112] | 167 ; CHECK: movups xmm1, xmmword ptr [esp + 112] |
168 ; CHECK: movups xmm2, xmmword ptr [esp + 96] | 168 ; CHECK: movups xmm2, xmmword ptr [esp + 96] |
169 ; CHECK: movups xmm3, xmmword ptr [esp + 80] | 169 ; CHECK: movups xmm3, xmmword ptr [esp + 80] |
170 ; CHECK: call -4 | 170 ; CHECK: call VectorArgs |
171 ; CHECK-NEXT: add esp, 32 | 171 ; CHECK-NEXT: add esp, 32 |
172 | 172 |
173 ; OPTM1-LABEL: test_passing_vectors: | 173 ; OPTM1-LABEL: test_passing_vectors: |
174 ; OPTM1: sub esp, 32 | 174 ; OPTM1: sub esp, 32 |
175 ; OPTM1: movups [[ARG5:.*]], xmmword ptr {{.*}} | 175 ; OPTM1: movups [[ARG5:.*]], xmmword ptr {{.*}} |
176 ; OPTM1: movups xmmword ptr [esp], [[ARG5]] | 176 ; OPTM1: movups xmmword ptr [esp], [[ARG5]] |
177 ; OPTM1: movups [[ARG6:.*]], xmmword ptr {{.*}} | 177 ; OPTM1: movups [[ARG6:.*]], xmmword ptr {{.*}} |
178 ; OPTM1: movups xmmword ptr [esp + 16], [[ARG6]] | 178 ; OPTM1: movups xmmword ptr [esp + 16], [[ARG6]] |
179 ; OPTM1: movups xmm0, xmmword ptr {{.*}} | 179 ; OPTM1: movups xmm0, xmmword ptr {{.*}} |
180 ; OPTM1: movups xmm1, xmmword ptr {{.*}} | 180 ; OPTM1: movups xmm1, xmmword ptr {{.*}} |
181 ; OPTM1: movups xmm2, xmmword ptr {{.*}} | 181 ; OPTM1: movups xmm2, xmmword ptr {{.*}} |
182 ; OPTM1: movups xmm3, xmmword ptr {{.*}} | 182 ; OPTM1: movups xmm3, xmmword ptr {{.*}} |
183 ; OPTM1: call -4 | 183 ; OPTM1: call VectorArgs |
184 ; OPTM1-NEXT: add esp, 32 | 184 ; OPTM1-NEXT: add esp, 32 |
185 } | 185 } |
186 | 186 |
187 declare void @InterspersedVectorArgs(<4 x float>, i64, <4 x float>, i64, <4 x fl
oat>, float, <4 x float>, double, <4 x float>, i32, <4 x float>) | 187 declare void @InterspersedVectorArgs(<4 x float>, i64, <4 x float>, i64, <4 x fl
oat>, float, <4 x float>, double, <4 x float>, i32, <4 x float>) |
188 | 188 |
189 define void @test_passing_vectors_interspersed(<4 x float> %arg0, <4 x float> %a
rg1, <4 x float> %arg2, <4 x float> %arg3, <4 x float> %arg4, <4 x float> %arg5,
<4 x float> %arg6, <4 x float> %arg7, <4 x float> %arg8, <4 x float> %arg9) { | 189 define void @test_passing_vectors_interspersed(<4 x float> %arg0, <4 x float> %a
rg1, <4 x float> %arg2, <4 x float> %arg3, <4 x float> %arg4, <4 x float> %arg5,
<4 x float> %arg6, <4 x float> %arg7, <4 x float> %arg8, <4 x float> %arg9) { |
190 entry: | 190 entry: |
191 ; Kills XMM registers so that no in-arg lowering code interferes | 191 ; Kills XMM registers so that no in-arg lowering code interferes |
192 ; with the test. | 192 ; with the test. |
193 call void @killXmmRegisters() | 193 call void @killXmmRegisters() |
194 call void @InterspersedVectorArgs(<4 x float> %arg9, i64 0, <4 x float> %arg8,
i64 1, <4 x float> %arg7, float 2.000000e+00, <4 x float> %arg6, double 3.00000
0e+00, <4 x float> %arg5, i32 4, <4 x float> %arg4) | 194 call void @InterspersedVectorArgs(<4 x float> %arg9, i64 0, <4 x float> %arg8,
i64 1, <4 x float> %arg7, float 2.000000e+00, <4 x float> %arg6, double 3.00000
0e+00, <4 x float> %arg5, i32 4, <4 x float> %arg4) |
195 ret void | 195 ret void |
196 ; CHECK-LABEL: test_passing_vectors_interspersed: | 196 ; CHECK-LABEL: test_passing_vectors_interspersed: |
197 ; CHECK: sub esp, 80 | 197 ; CHECK: sub esp, 80 |
198 ; CHECK: movups [[ARG9:.*]], xmmword ptr [esp + 112] | 198 ; CHECK: movups [[ARG9:.*]], xmmword ptr [esp + 112] |
199 ; CHECK: movups xmmword ptr [esp + 32], [[ARG9]] | 199 ; CHECK: movups xmmword ptr [esp + 32], [[ARG9]] |
200 ; CHECK: movups [[ARG11:.*]], xmmword ptr [esp + 96] | 200 ; CHECK: movups [[ARG11:.*]], xmmword ptr [esp + 96] |
201 ; CHECK: movups xmmword ptr [esp + 64], [[ARG11]] | 201 ; CHECK: movups xmmword ptr [esp + 64], [[ARG11]] |
202 ; CHECK: movups xmm0, xmmword ptr [esp + 176] | 202 ; CHECK: movups xmm0, xmmword ptr [esp + 176] |
203 ; CHECK: movups xmm1, xmmword ptr [esp + 160] | 203 ; CHECK: movups xmm1, xmmword ptr [esp + 160] |
204 ; CHECK: movups xmm2, xmmword ptr [esp + 144] | 204 ; CHECK: movups xmm2, xmmword ptr [esp + 144] |
205 ; CHECK: movups xmm3, xmmword ptr [esp + 128] | 205 ; CHECK: movups xmm3, xmmword ptr [esp + 128] |
206 ; CHECK: call -4 | 206 ; CHECK: call InterspersedVectorArgs |
207 ; CHECK-NEXT: add esp, 80 | 207 ; CHECK-NEXT: add esp, 80 |
208 ; CHECK: ret | 208 ; CHECK: ret |
209 | 209 |
210 ; OPTM1-LABEL: test_passing_vectors_interspersed: | 210 ; OPTM1-LABEL: test_passing_vectors_interspersed: |
211 ; OPTM1: sub esp, 80 | 211 ; OPTM1: sub esp, 80 |
212 ; OPTM1: movups [[ARG9:.*]], xmmword ptr {{.*}} | 212 ; OPTM1: movups [[ARG9:.*]], xmmword ptr {{.*}} |
213 ; OPTM1: movups xmmword ptr [esp + 32], [[ARG9]] | 213 ; OPTM1: movups xmmword ptr [esp + 32], [[ARG9]] |
214 ; OPTM1: movups [[ARG11:.*]], xmmword ptr {{.*}} | 214 ; OPTM1: movups [[ARG11:.*]], xmmword ptr {{.*}} |
215 ; OPTM1: movups xmmword ptr [esp + 64], [[ARG11]] | 215 ; OPTM1: movups xmmword ptr [esp + 64], [[ARG11]] |
216 ; OPTM1: movups xmm0, xmmword ptr {{.*}} | 216 ; OPTM1: movups xmm0, xmmword ptr {{.*}} |
217 ; OPTM1: movups xmm1, xmmword ptr {{.*}} | 217 ; OPTM1: movups xmm1, xmmword ptr {{.*}} |
218 ; OPTM1: movups xmm2, xmmword ptr {{.*}} | 218 ; OPTM1: movups xmm2, xmmword ptr {{.*}} |
219 ; OPTM1: movups xmm3, xmmword ptr {{.*}} | 219 ; OPTM1: movups xmm3, xmmword ptr {{.*}} |
220 ; OPTM1: call -4 | 220 ; OPTM1: call InterspersedVectorArgs |
221 ; OPTM1-NEXT: add esp, 80 | 221 ; OPTM1-NEXT: add esp, 80 |
222 ; OPTM1: ret | 222 ; OPTM1: ret |
223 } | 223 } |
224 | 224 |
225 ; Test that a vector returned from a function is recognized to be in | 225 ; Test that a vector returned from a function is recognized to be in |
226 ; xmm0. | 226 ; xmm0. |
227 | 227 |
228 declare <4 x float> @VectorReturn(<4 x float> %arg0) | 228 declare <4 x float> @VectorReturn(<4 x float> %arg0) |
229 | 229 |
230 define void @test_receiving_vectors(<4 x float> %arg0) { | 230 define void @test_receiving_vectors(<4 x float> %arg0) { |
231 entry: | 231 entry: |
232 %result = call <4 x float> @VectorReturn(<4 x float> %arg0) | 232 %result = call <4 x float> @VectorReturn(<4 x float> %arg0) |
233 %result2 = call <4 x float> @VectorReturn(<4 x float> %result) | 233 %result2 = call <4 x float> @VectorReturn(<4 x float> %result) |
234 ret void | 234 ret void |
235 ; CHECK-LABEL: test_receiving_vectors: | 235 ; CHECK-LABEL: test_receiving_vectors: |
236 ; CHECK: call -4 | 236 ; CHECK: call VectorReturn |
237 ; CHECK-NOT: movups xmm0 | 237 ; CHECK-NOT: movups xmm0 |
238 ; CHECK: call -4 | 238 ; CHECK: call VectorReturn |
239 ; CHECK: ret | 239 ; CHECK: ret |
240 | 240 |
241 ; OPTM1-LABEL: test_receiving_vectors: | 241 ; OPTM1-LABEL: test_receiving_vectors: |
242 ; OPTM1: call -4 | 242 ; OPTM1: call VectorReturn |
243 ; OPTM1: movups {{.*}}, xmm0 | 243 ; OPTM1: movups {{.*}}, xmm0 |
244 ; OPTM1: movups xmm0, {{.*}} | 244 ; OPTM1: movups xmm0, {{.*}} |
245 ; OPTM1: call -4 | 245 ; OPTM1: call VectorReturn |
246 ; OPTM1: ret | 246 ; OPTM1: ret |
247 } | 247 } |
OLD | NEW |