• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=corei7-avx -mattr=+avx | FileCheck %s
2
3@z = common global <4 x float> zeroinitializer, align 16
4
5define void @zero() nounwind ssp {
6entry:
7  ; CHECK: vxorps
8  ; CHECK: vmovaps
9  store <4 x float> zeroinitializer, <4 x float>* @z, align 16
10  ret void
11}
12
13define void @fpext() nounwind uwtable {
14entry:
15  %f = alloca float, align 4
16  %d = alloca double, align 8
17  %tmp = load float* %f, align 4
18  ; CHECK: vcvtss2sd
19  %conv = fpext float %tmp to double
20  store double %conv, double* %d, align 8
21  ret void
22}
23
24; CHECK: vcvtsi2sdq (%
25define double @funcA(i64* nocapture %e) nounwind uwtable readonly ssp {
26entry:
27  %tmp1 = load i64* %e, align 8
28  %conv = sitofp i64 %tmp1 to double
29  ret double %conv
30}
31
32; CHECK: vcvtsi2sd (%
33define double @funcB(i32* nocapture %e) nounwind uwtable readonly ssp {
34entry:
35  %tmp1 = load i32* %e, align 4
36  %conv = sitofp i32 %tmp1 to double
37  ret double %conv
38}
39
40; CHECK: vcvtsi2ss (%
41define float @funcC(i32* nocapture %e) nounwind uwtable readonly ssp {
42entry:
43  %tmp1 = load i32* %e, align 4
44  %conv = sitofp i32 %tmp1 to float
45  ret float %conv
46}
47
48; CHECK: vcvtsi2ssq  (%
49define float @funcD(i64* nocapture %e) nounwind uwtable readonly ssp {
50entry:
51  %tmp1 = load i64* %e, align 8
52  %conv = sitofp i64 %tmp1 to float
53  ret float %conv
54}
55
56; CHECK: vsqrtss
57define float @sqrtA(float %a) nounwind uwtable readnone ssp {
58entry:
59  %conv1 = tail call float @sqrtf(float %a) nounwind readnone
60  ret float %conv1
61}
62
63declare double @sqrt(double) readnone
64
65; CHECK: vsqrtsd
66define double @sqrtB(double %a) nounwind uwtable readnone ssp {
67entry:
68  %call = tail call double @sqrt(double %a) nounwind readnone
69  ret double %call
70}
71
72declare float @sqrtf(float) readnone
73