1 ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=corei7-avx -mattr=+avx | FileCheck %s 2 3 ; CHECK: vcvtdq2ps %ymm 4 define <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 10 define <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 16 define <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: vcvtdq2ps %ymm 22 define <8 x float> @sitofp02(<8 x i16> %a) { 23 %b = sitofp <8 x i16> %a to <8 x float> 24 ret <8 x float> %b 25 } 26 27 ; CHECK: vcvttpd2dqy %ymm 28 define <4 x i32> @fptosi01(<4 x double> %a) { 29 %b = fptosi <4 x double> %a to <4 x i32> 30 ret <4 x i32> %b 31 } 32 33 ; CHECK: vcvtpd2psy %ymm 34 ; CHECK-NEXT: vcvtpd2psy %ymm 35 ; CHECK-NEXT: vinsertf128 $1 36 define <8 x float> @fptrunc00(<8 x double> %b) nounwind { 37 %a = fptrunc <8 x double> %b to <8 x float> 38 ret <8 x float> %a 39 } 40 41 ; CHECK: vcvtps2pd %xmm 42 define <4 x double> @fpext00(<4 x float> %b) nounwind { 43 %a = fpext <4 x float> %b to <4 x double> 44 ret <4 x double> %a 45 } 46 47 ; CHECK: vcvtsi2sdq (% 48 define double @funcA(i64* nocapture %e) nounwind uwtable readonly ssp { 49 entry: 50 %tmp1 = load i64* %e, align 8 51 %conv = sitofp i64 %tmp1 to double 52 ret double %conv 53 } 54 55 ; CHECK: vcvtsi2sdl (% 56 define double @funcB(i32* nocapture %e) nounwind uwtable readonly ssp { 57 entry: 58 %tmp1 = load i32* %e, align 4 59 %conv = sitofp i32 %tmp1 to double 60 ret double %conv 61 } 62 63 ; CHECK: vcvtsi2ssl (% 64 define float @funcC(i32* nocapture %e) nounwind uwtable readonly ssp { 65 entry: 66 %tmp1 = load i32* %e, align 4 67 %conv = sitofp i32 %tmp1 to float 68 ret float %conv 69 } 70 71 ; CHECK: vcvtsi2ssq (% 72 define float @funcD(i64* nocapture %e) nounwind uwtable readonly ssp { 73 entry: 74 %tmp1 = load i64* %e, align 8 75 %conv = sitofp i64 %tmp1 to float 76 ret float %conv 77 } 78 79 ; CHECK: vcvtss2sd 80 define void @fpext() nounwind uwtable { 81 entry: 82 %f = alloca float, align 4 83 %d = alloca double, align 8 84 %tmp = load float* %f, align 4 85 %conv = fpext float %tmp to double 86 store double %conv, double* %d, align 8 87 ret void 88 } 89 90