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