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
|
|
|
|
|
|
|
@z = common global <4 x float> zeroinitializer, align 16
|
|
|
|
|
|
|
|
define void @zero() nounwind ssp {
|
|
|
|
entry:
|
2010-12-10 00:26:57 +00:00
|
|
|
; CHECK: vxorps
|
2010-08-12 20:20:53 +00:00
|
|
|
; CHECK: vmovaps
|
|
|
|
store <4 x float> zeroinitializer, <4 x float>* @z, align 16
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2011-06-16 07:03:21 +00:00
|
|
|
define void @fpext() nounwind uwtable {
|
|
|
|
entry:
|
|
|
|
%f = alloca float, align 4
|
|
|
|
%d = alloca double, align 8
|
|
|
|
%tmp = load float* %f, align 4
|
|
|
|
; CHECK: vcvtss2sd
|
|
|
|
%conv = fpext float %tmp to double
|
|
|
|
store double %conv, double* %d, align 8
|
|
|
|
ret void
|
|
|
|
}
|
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
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: vcvtsi2sd (%
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: vcvtsi2ss (%
|
|
|
|
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
|
|
|
|
|
|
|
; CHECK: vsqrtss
|
|
|
|
define float @sqrtA(float %a) nounwind uwtable readnone ssp {
|
|
|
|
entry:
|
|
|
|
%conv1 = tail call float @sqrtf(float %a) nounwind readnone
|
|
|
|
ret float %conv1
|
|
|
|
}
|
|
|
|
|
|
|
|
declare double @sqrt(double) readnone
|
|
|
|
|
|
|
|
; CHECK: vsqrtsd
|
|
|
|
define double @sqrtB(double %a) nounwind uwtable readnone ssp {
|
|
|
|
entry:
|
|
|
|
%call = tail call double @sqrt(double %a) nounwind readnone
|
|
|
|
ret double %call
|
|
|
|
}
|
|
|
|
|
|
|
|
declare float @sqrtf(float) readnone
|