• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
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:       # %bb.0: # %entry
8; CHECK-NEXT:    vmovsd {{.*#+}} xmm0 = mem[0],zero
9; CHECK-NEXT:    vmovsd {{.*#+}} xmm1 = mem[0],zero
10; CHECK-NEXT:    vsqrtsd %xmm0, %xmm0, %xmm0
11; CHECK-NEXT:    vsqrtsd %xmm1, %xmm1, %xmm1
12; CHECK-NEXT:    vunpcklpd {{.*#+}} xmm0 = xmm0[0],xmm1[0]
13; CHECK-NEXT:    retq
14entry:
15  %0 = load double, double* %v, align 8
16  %call = tail call double @sqrt(double %0) #2
17  %arrayidx1 = getelementptr inbounds double, double* %v, i64 1
18  %1 = load double, double* %arrayidx1, align 8
19  %call2 = tail call double @sqrt(double %1) #2
20  %vecinit.i = insertelement <2 x double> undef, double %call, i32 0
21  %vecinit1.i = insertelement <2 x double> %vecinit.i, double %call2, i32 1
22  ret <2 x double> %vecinit1.i
23}
24
25; Function Attrs: nounwind readnone
26declare double @sqrt(double) local_unnamed_addr #1
27
28; Function Attrs: nounwind readonly uwtable
29define <4 x float> @sqrtf4(float* nocapture readonly %v) local_unnamed_addr #0 {
30; CHECK-LABEL: sqrtf4:
31; CHECK:       # %bb.0: # %entry
32; CHECK-NEXT:    vmovss {{.*#+}} xmm0 = mem[0],zero,zero,zero
33; CHECK-NEXT:    vmovss {{.*#+}} xmm1 = mem[0],zero,zero,zero
34; CHECK-NEXT:    vsqrtss %xmm0, %xmm0, %xmm0
35; CHECK-NEXT:    vsqrtss %xmm1, %xmm1, %xmm1
36; CHECK-NEXT:    vinsertps {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[2,3]
37; CHECK-NEXT:    vmovss {{.*#+}} xmm1 = mem[0],zero,zero,zero
38; CHECK-NEXT:    vsqrtss %xmm1, %xmm1, %xmm1
39; CHECK-NEXT:    vinsertps {{.*#+}} xmm0 = xmm0[0,1],xmm1[0],xmm0[3]
40; CHECK-NEXT:    vmovss {{.*#+}} xmm1 = mem[0],zero,zero,zero
41; CHECK-NEXT:    vsqrtss %xmm1, %xmm1, %xmm1
42; CHECK-NEXT:    vinsertps {{.*#+}} xmm0 = xmm0[0,1,2],xmm1[0]
43; CHECK-NEXT:    retq
44entry:
45  %0 = load float, float* %v, align 4
46  %call = tail call float @sqrtf(float %0) #2
47  %arrayidx1 = getelementptr inbounds float, float* %v, i64 1
48  %1 = load float, float* %arrayidx1, align 4
49  %call2 = tail call float @sqrtf(float %1) #2
50  %arrayidx3 = getelementptr inbounds float, float* %v, i64 2
51  %2 = load float, float* %arrayidx3, align 4
52  %call4 = tail call float @sqrtf(float %2) #2
53  %arrayidx5 = getelementptr inbounds float, float* %v, i64 3
54  %3 = load float, float* %arrayidx5, align 4
55  %call6 = tail call float @sqrtf(float %3) #2
56  %vecinit.i = insertelement <4 x float> undef, float %call, i32 0
57  %vecinit1.i = insertelement <4 x float> %vecinit.i, float %call2, i32 1
58  %vecinit2.i = insertelement <4 x float> %vecinit1.i, float %call4, i32 2
59  %vecinit3.i = insertelement <4 x float> %vecinit2.i, float %call6, i32 3
60  ret <4 x float> %vecinit3.i
61}
62
63; Function Attrs: nounwind readnone
64declare float @sqrtf(float) local_unnamed_addr #1
65
66attributes #0 = { nounwind readonly uwtable "target-features"="+avx" "unsafe-fp-math"="false" "use-soft-float"="false" }
67attributes #1 = { nounwind readnone  "target-features"="+avx2" "unsafe-fp-math"="false" "use-soft-float"="false" }
68attributes #2 = { nounwind readnone }
69