• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=corei7-avx -mattr=+avx | FileCheck %s
2
3; CHECK: vcvtdq2ps %ymm
4define <8 x float> @sitofp00(<8 x i32> %a) nounwind {
5  %b = sitofp <8 x i32> %a to <8 x float>
6  ret <8 x float> %b
7}
8
9; CHECK: vcvttps2dq %ymm
10define <8 x i32> @fptosi00(<8 x float> %a) nounwind {
11  %b = fptosi <8 x float> %a to <8 x i32>
12  ret <8 x i32> %b
13}
14
15; CHECK: vcvtdq2pd %xmm
16define <4 x double> @sitofp01(<4 x i32> %a) {
17  %b = sitofp <4 x i32> %a to <4 x double>
18  ret <4 x double> %b
19}
20
21; CHECK: vcvtpd2dqy %ymm
22define <4 x i32> @fptosi01(<4 x double> %a) {
23  %b = fptosi <4 x double> %a to <4 x i32>
24  ret <4 x i32> %b
25}
26
27; CHECK: vcvtpd2psy %ymm
28; CHECK-NEXT: vcvtpd2psy %ymm
29; CHECK-NEXT: vinsertf128 $1
30define <8 x float> @fptrunc00(<8 x double> %b) nounwind {
31  %a = fptrunc <8 x double> %b to <8 x float>
32  ret <8 x float> %a
33}
34
35; CHECK: vcvtps2pd %xmm
36define <4 x double> @fpext00(<4 x float> %b) nounwind {
37  %a = fpext <4 x float> %b to <4 x double>
38  ret <4 x double> %a
39}
40
41; CHECK: vcvtsi2sdq (%
42define double @funcA(i64* nocapture %e) nounwind uwtable readonly ssp {
43entry:
44  %tmp1 = load i64* %e, align 8
45  %conv = sitofp i64 %tmp1 to double
46  ret double %conv
47}
48
49; CHECK: vcvtsi2sd (%
50define double @funcB(i32* nocapture %e) nounwind uwtable readonly ssp {
51entry:
52  %tmp1 = load i32* %e, align 4
53  %conv = sitofp i32 %tmp1 to double
54  ret double %conv
55}
56
57; CHECK: vcvtsi2ss (%
58define float @funcC(i32* nocapture %e) nounwind uwtable readonly ssp {
59entry:
60  %tmp1 = load i32* %e, align 4
61  %conv = sitofp i32 %tmp1 to float
62  ret float %conv
63}
64
65; CHECK: vcvtsi2ssq  (%
66define float @funcD(i64* nocapture %e) nounwind uwtable readonly ssp {
67entry:
68  %tmp1 = load i64* %e, align 8
69  %conv = sitofp i64 %tmp1 to float
70  ret float %conv
71}
72
73; CHECK: vcvtss2sd
74define void @fpext() nounwind uwtable {
75entry:
76  %f = alloca float, align 4
77  %d = alloca double, align 8
78  %tmp = load float* %f, align 4
79  %conv = fpext float %tmp to double
80  store double %conv, double* %d, align 8
81  ret void
82}
83
84