1 ; RUN: llc < %s -mtriple=i386-apple-darwin10 -mcpu=corei7-avx -mattr=+avx | FileCheck %s 2 ; RUN: llc < %s -mtriple=i386-apple-darwin10 -mcpu=corei7-avx -mattr=+avx -x86-experimental-vector-widening-legalization | FileCheck %s --check-prefix=CHECK-WIDE 3 4 ;CHECK-LABEL: foo1_8: 5 ;CHECK: vcvtdq2ps 6 ;CHECK: ret 7 ; 8 ;CHECK-WIDE-LABEL: foo1_8: 9 ;CHECK-WIDE: vpmovzxbd %xmm0, %xmm1 10 ;CHECK-WIDE-NEXT: vpslld $24, %xmm1, %xmm1 11 ;CHECK-WIDE-NEXT: vpsrad $24, %xmm1, %xmm1 12 ;CHECK-WIDE-NEXT: vpshufb {{.*}}, %xmm0, %xmm0 13 ;CHECK-WIDE-NEXT: vpslld $24, %xmm0, %xmm0 14 ;CHECK-WIDE-NEXT: vpsrad $24, %xmm0, %xmm0 15 ;CHECK-WIDE-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0 16 ;CHECK-WIDE-NEXT: vcvtdq2ps %ymm0, %ymm0 17 ;CHECK-WIDE-NEXT: ret 18 define <8 x float> @foo1_8(<8 x i8> %src) { 19 %res = sitofp <8 x i8> %src to <8 x float> 20 ret <8 x float> %res 21 } 22 23 ;CHECK-LABEL: foo1_4: 24 ;CHECK: vcvtdq2ps 25 ;CHECK: ret 26 ; 27 ;CHECK-WIDE-LABEL: foo1_4: 28 ;CHECK-WIDE: vpmovzxbd %xmm0, %xmm0 29 ;CHECK-WIDE-NEXT: vpslld $24, %xmm0, %xmm0 30 ;CHECK-WIDE-NEXT: vpsrad $24, %xmm0, %xmm0 31 ;CHECK-WIDE-NEXT: vcvtdq2ps %xmm0, %xmm0 32 ;CHECK-WIDE-NEXT: ret 33 define <4 x float> @foo1_4(<4 x i8> %src) { 34 %res = sitofp <4 x i8> %src to <4 x float> 35 ret <4 x float> %res 36 } 37 38 ;CHECK-LABEL: foo2_8: 39 ;CHECK: vcvtdq2ps 40 ;CHECK: ret 41 ; 42 ;CHECK-WIDE-LABEL: foo2_8: 43 ;CHECK-WIDE: vcvtdq2ps %ymm{{.*}}, %ymm{{.*}} 44 ;CHECK-WIDE: ret 45 define <8 x float> @foo2_8(<8 x i8> %src) { 46 %res = uitofp <8 x i8> %src to <8 x float> 47 ret <8 x float> %res 48 } 49 50 ;CHECK-LABEL: foo2_4: 51 ;CHECK: vcvtdq2ps 52 ;CHECK: ret 53 ; 54 ;CHECK-WIDE-LABEL: foo2_4: 55 ;CHECK-WIDE: vcvtdq2ps %xmm{{.*}}, %xmm{{.*}} 56 ;CHECK-WIDE: ret 57 define <4 x float> @foo2_4(<4 x i8> %src) { 58 %res = uitofp <4 x i8> %src to <4 x float> 59 ret <4 x float> %res 60 } 61 62 ;CHECK-LABEL: foo3_8: 63 ;CHECK: vcvttps2dq 64 ;CHECK: ret 65 define <8 x i8> @foo3_8(<8 x float> %src) { 66 %res = fptosi <8 x float> %src to <8 x i8> 67 ret <8 x i8> %res 68 } 69 ;CHECK-LABEL: foo3_4: 70 ;CHECK: vcvttps2dq 71 ;CHECK: ret 72 define <4 x i8> @foo3_4(<4 x float> %src) { 73 %res = fptosi <4 x float> %src to <4 x i8> 74 ret <4 x i8> %res 75 } 76 77