blob: c5ac4466b5faae8d46c6bd360361dcd3a419631e [file] [log] [blame]
Andrew V. Tischenko5f643ad2016-12-16 09:56:02 +00001; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
Simon Pilgrim33c3e912017-01-22 21:15:27 +00002; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx | FileCheck %s
Andrew V. Tischenko5f643ad2016-12-16 09:56:02 +00003
4; Function Attrs: nounwind readonly uwtable
5define <2 x double> @sqrtd2(double* nocapture readonly %v) local_unnamed_addr #0 {
6; CHECK-LABEL: sqrtd2:
Simon Pilgrim33c3e912017-01-22 21:15:27 +00007; CHECK: # BB#0: # %entry
8; CHECK-NEXT: vsqrtsd (%rdi), %xmm0, %xmm0
9; CHECK-NEXT: vsqrtsd 8(%rdi), %xmm1, %xmm1
10; CHECK-NEXT: vunpcklpd {{.*#+}} xmm0 = xmm0[0],xmm1[0]
11; CHECK-NEXT: retq
Andrew V. Tischenko5f643ad2016-12-16 09:56:02 +000012entry:
13 %0 = load double, double* %v, align 8
14 %call = tail call double @sqrt(double %0) #2
15 %arrayidx1 = getelementptr inbounds double, double* %v, i64 1
16 %1 = load double, double* %arrayidx1, align 8
17 %call2 = tail call double @sqrt(double %1) #2
18 %vecinit.i = insertelement <2 x double> undef, double %call, i32 0
19 %vecinit1.i = insertelement <2 x double> %vecinit.i, double %call2, i32 1
20 ret <2 x double> %vecinit1.i
21}
22
23; Function Attrs: nounwind readnone
24declare double @sqrt(double) local_unnamed_addr #1
25
26; Function Attrs: nounwind readonly uwtable
27define <4 x float> @sqrtf4(float* nocapture readonly %v) local_unnamed_addr #0 {
28; CHECK-LABEL: sqrtf4:
Simon Pilgrim33c3e912017-01-22 21:15:27 +000029; CHECK: # BB#0: # %entry
30; CHECK-NEXT: vsqrtss (%rdi), %xmm0, %xmm0
31; CHECK-NEXT: vsqrtss 4(%rdi), %xmm1, %xmm1
32; CHECK-NEXT: vsqrtss 8(%rdi), %xmm2, %xmm2
33; CHECK-NEXT: vsqrtss 12(%rdi), %xmm3, %xmm3
34; CHECK-NEXT: vinsertps {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[2,3]
35; CHECK-NEXT: vinsertps {{.*#+}} xmm0 = xmm0[0,1],xmm2[0],xmm0[3]
36; CHECK-NEXT: vinsertps {{.*#+}} xmm0 = xmm0[0,1,2],xmm3[0]
37; CHECK-NEXT: retq
Andrew V. Tischenko5f643ad2016-12-16 09:56:02 +000038entry:
39 %0 = load float, float* %v, align 4
40 %call = tail call float @sqrtf(float %0) #2
41 %arrayidx1 = getelementptr inbounds float, float* %v, i64 1
42 %1 = load float, float* %arrayidx1, align 4
43 %call2 = tail call float @sqrtf(float %1) #2
44 %arrayidx3 = getelementptr inbounds float, float* %v, i64 2
45 %2 = load float, float* %arrayidx3, align 4
46 %call4 = tail call float @sqrtf(float %2) #2
47 %arrayidx5 = getelementptr inbounds float, float* %v, i64 3
48 %3 = load float, float* %arrayidx5, align 4
49 %call6 = tail call float @sqrtf(float %3) #2
50 %vecinit.i = insertelement <4 x float> undef, float %call, i32 0
51 %vecinit1.i = insertelement <4 x float> %vecinit.i, float %call2, i32 1
52 %vecinit2.i = insertelement <4 x float> %vecinit1.i, float %call4, i32 2
53 %vecinit3.i = insertelement <4 x float> %vecinit2.i, float %call6, i32 3
54 ret <4 x float> %vecinit3.i
55}
56
57; Function Attrs: nounwind readnone
58declare float @sqrtf(float) local_unnamed_addr #1
59
60attributes #0 = { nounwind readonly uwtable "target-features"="+avx" "unsafe-fp-math"="false" "use-soft-float"="false" }
61attributes #1 = { nounwind readnone "target-features"="+avx2" "unsafe-fp-math"="false" "use-soft-float"="false" }
62attributes #2 = { nounwind readnone }