2011-07-16 00:50:20 +00:00
|
|
|
; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=corei7-avx -mattr=+avx | FileCheck %s
|
2010-08-12 20:20:53 +00:00
|
|
|
|
2011-08-09 03:04:23 +00:00
|
|
|
; CHECK: vcvtdq2ps %ymm
|
|
|
|
define <8 x float> @sitofp00(<8 x i32> %a) nounwind {
|
|
|
|
%b = sitofp <8 x i32> %a to <8 x float>
|
|
|
|
ret <8 x float> %b
|
|
|
|
}
|
2010-08-12 20:20:53 +00:00
|
|
|
|
2011-08-09 03:04:23 +00:00
|
|
|
; CHECK: vcvttps2dq %ymm
|
|
|
|
define <8 x i32> @fptosi00(<8 x float> %a) nounwind {
|
|
|
|
%b = fptosi <8 x float> %a to <8 x i32>
|
|
|
|
ret <8 x i32> %b
|
2010-08-12 20:20:53 +00:00
|
|
|
}
|
|
|
|
|
2011-08-09 17:39:13 +00:00
|
|
|
; CHECK: vcvtdq2pd %xmm
|
|
|
|
define <4 x double> @sitofp01(<4 x i32> %a) {
|
|
|
|
%b = sitofp <4 x i32> %a to <4 x double>
|
|
|
|
ret <4 x double> %b
|
|
|
|
}
|
|
|
|
|
2013-03-31 12:49:15 +00:00
|
|
|
; CHECK: vcvtdq2ps %ymm
|
|
|
|
define <8 x float> @sitofp02(<8 x i16> %a) {
|
|
|
|
%b = sitofp <8 x i16> %a to <8 x float>
|
|
|
|
ret <8 x float> %b
|
|
|
|
}
|
|
|
|
|
2012-01-26 08:51:39 +00:00
|
|
|
; CHECK: vcvttpd2dqy %ymm
|
2011-08-09 17:39:13 +00:00
|
|
|
define <4 x i32> @fptosi01(<4 x double> %a) {
|
|
|
|
%b = fptosi <4 x double> %a to <4 x i32>
|
|
|
|
ret <4 x i32> %b
|
|
|
|
}
|
|
|
|
|
2011-08-09 03:04:23 +00:00
|
|
|
; CHECK: vcvtpd2psy %ymm
|
|
|
|
; CHECK-NEXT: vcvtpd2psy %ymm
|
|
|
|
; CHECK-NEXT: vinsertf128 $1
|
|
|
|
define <8 x float> @fptrunc00(<8 x double> %b) nounwind {
|
|
|
|
%a = fptrunc <8 x double> %b to <8 x float>
|
|
|
|
ret <8 x float> %a
|
2011-08-09 03:04:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: vcvtps2pd %xmm
|
|
|
|
define <4 x double> @fpext00(<4 x float> %b) nounwind {
|
|
|
|
%a = fpext <4 x float> %b to <4 x double>
|
|
|
|
ret <4 x double> %a
|
2011-06-16 07:03:21 +00:00
|
|
|
}
|
2011-07-16 00:50:20 +00:00
|
|
|
|
|
|
|
; CHECK: vcvtsi2sdq (%
|
|
|
|
define double @funcA(i64* nocapture %e) nounwind uwtable readonly ssp {
|
|
|
|
entry:
|
|
|
|
%tmp1 = load i64* %e, align 8
|
|
|
|
%conv = sitofp i64 %tmp1 to double
|
|
|
|
ret double %conv
|
|
|
|
}
|
|
|
|
|
2013-01-06 20:39:29 +00:00
|
|
|
; CHECK: vcvtsi2sdl (%
|
2011-07-16 00:50:20 +00:00
|
|
|
define double @funcB(i32* nocapture %e) nounwind uwtable readonly ssp {
|
|
|
|
entry:
|
|
|
|
%tmp1 = load i32* %e, align 4
|
|
|
|
%conv = sitofp i32 %tmp1 to double
|
|
|
|
ret double %conv
|
|
|
|
}
|
|
|
|
|
2013-01-06 20:39:29 +00:00
|
|
|
; CHECK: vcvtsi2ssl (%
|
2011-07-16 00:50:20 +00:00
|
|
|
define float @funcC(i32* nocapture %e) nounwind uwtable readonly ssp {
|
|
|
|
entry:
|
|
|
|
%tmp1 = load i32* %e, align 4
|
|
|
|
%conv = sitofp i32 %tmp1 to float
|
|
|
|
ret float %conv
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: vcvtsi2ssq (%
|
|
|
|
define float @funcD(i64* nocapture %e) nounwind uwtable readonly ssp {
|
|
|
|
entry:
|
|
|
|
%tmp1 = load i64* %e, align 8
|
|
|
|
%conv = sitofp i64 %tmp1 to float
|
|
|
|
ret float %conv
|
|
|
|
}
|
2011-07-18 17:51:40 +00:00
|
|
|
|
2011-08-09 03:04:23 +00:00
|
|
|
; CHECK: vcvtss2sd
|
|
|
|
define void @fpext() nounwind uwtable {
|
2011-07-18 17:51:40 +00:00
|
|
|
entry:
|
2011-08-09 03:04:23 +00:00
|
|
|
%f = alloca float, align 4
|
|
|
|
%d = alloca double, align 8
|
|
|
|
%tmp = load float* %f, align 4
|
|
|
|
%conv = fpext float %tmp to double
|
|
|
|
store double %conv, double* %d, align 8
|
|
|
|
ret void
|
2011-07-18 17:51:40 +00:00
|
|
|
}
|
|
|
|
|