1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i386-apple-darwin10 -mattr=+avx | FileCheck %s
4 define <2 x float> @cvt_v2i8_v2f32(<2 x i8> %src) {
5 ; CHECK-LABEL: cvt_v2i8_v2f32:
7 ; CHECK-NEXT: vpmovsxbd %xmm0, %xmm0
8 ; CHECK-NEXT: vcvtdq2ps %xmm0, %xmm0
10 %res = sitofp <2 x i8> %src to <2 x float>
14 define <2 x float> @cvt_v2i16_v2f32(<2 x i16> %src) {
15 ; CHECK-LABEL: cvt_v2i16_v2f32:
17 ; CHECK-NEXT: vpmovsxwd %xmm0, %xmm0
18 ; CHECK-NEXT: vcvtdq2ps %xmm0, %xmm0
20 %res = sitofp <2 x i16> %src to <2 x float>
24 define <2 x float> @cvt_v2i32_v2f32(<2 x i32> %src) {
25 ; CHECK-LABEL: cvt_v2i32_v2f32:
27 ; CHECK-NEXT: vcvtdq2ps %xmm0, %xmm0
29 %res = sitofp <2 x i32> %src to <2 x float>
33 define <2 x float> @cvt_v2u8_v2f32(<2 x i8> %src) {
34 ; CHECK-LABEL: cvt_v2u8_v2f32:
36 ; CHECK-NEXT: vpmovzxbd {{.*#+}} xmm0 = xmm0[0],zero,zero,zero,xmm0[1],zero,zero,zero,xmm0[2],zero,zero,zero,xmm0[3],zero,zero,zero
37 ; CHECK-NEXT: vcvtdq2ps %xmm0, %xmm0
39 %res = uitofp <2 x i8> %src to <2 x float>
43 define <2 x float> @cvt_v2u16_v2f32(<2 x i16> %src) {
44 ; CHECK-LABEL: cvt_v2u16_v2f32:
46 ; CHECK-NEXT: vpmovzxwd {{.*#+}} xmm0 = xmm0[0],zero,xmm0[1],zero,xmm0[2],zero,xmm0[3],zero
47 ; CHECK-NEXT: vcvtdq2ps %xmm0, %xmm0
49 %res = uitofp <2 x i16> %src to <2 x float>
53 define <2 x float> @cvt_v2u32_v2f32(<2 x i32> %src) {
54 ; CHECK-LABEL: cvt_v2u32_v2f32:
56 ; CHECK-NEXT: vpmovzxdq {{.*#+}} xmm0 = xmm0[0],zero,xmm0[1],zero
57 ; CHECK-NEXT: vmovdqa {{.*#+}} xmm1 = [4.503599627370496E+15,4.503599627370496E+15]
58 ; CHECK-NEXT: vpor %xmm1, %xmm0, %xmm0
59 ; CHECK-NEXT: vsubpd %xmm1, %xmm0, %xmm0
60 ; CHECK-NEXT: vcvtpd2ps %xmm0, %xmm0
62 %res = uitofp <2 x i32> %src to <2 x float>
66 define <2 x i8> @cvt_v2f32_v2i8(<2 x float> %src) {
67 ; CHECK-LABEL: cvt_v2f32_v2i8:
69 ; CHECK-NEXT: vcvttps2dq %xmm0, %xmm0
70 ; CHECK-NEXT: vpshufb {{.*#+}} xmm0 = xmm0[0,4,u,u,u,u,u,u,u,u,u,u,u,u,u,u]
72 %res = fptosi <2 x float> %src to <2 x i8>
76 define <2 x i16> @cvt_v2f32_v2i16(<2 x float> %src) {
77 ; CHECK-LABEL: cvt_v2f32_v2i16:
79 ; CHECK-NEXT: vcvttps2dq %xmm0, %xmm0
80 ; CHECK-NEXT: vpshuflw {{.*#+}} xmm0 = xmm0[0,2,2,3,4,5,6,7]
82 %res = fptosi <2 x float> %src to <2 x i16>
86 define <2 x i32> @cvt_v2f32_v2i32(<2 x float> %src) {
87 ; CHECK-LABEL: cvt_v2f32_v2i32:
89 ; CHECK-NEXT: vcvttps2dq %xmm0, %xmm0
91 %res = fptosi <2 x float> %src to <2 x i32>
95 define <2 x i8> @cvt_v2f32_v2u8(<2 x float> %src) {
96 ; CHECK-LABEL: cvt_v2f32_v2u8:
98 ; CHECK-NEXT: vcvttps2dq %xmm0, %xmm0
99 ; CHECK-NEXT: vpshufb {{.*#+}} xmm0 = xmm0[0,4,u,u,u,u,u,u,u,u,u,u,u,u,u,u]
101 %res = fptoui <2 x float> %src to <2 x i8>
105 define <2 x i16> @cvt_v2f32_v2u16(<2 x float> %src) {
106 ; CHECK-LABEL: cvt_v2f32_v2u16:
108 ; CHECK-NEXT: vcvttps2dq %xmm0, %xmm0
109 ; CHECK-NEXT: vpshuflw {{.*#+}} xmm0 = xmm0[0,2,2,3,4,5,6,7]
111 %res = fptoui <2 x float> %src to <2 x i16>
115 define <2 x i32> @cvt_v2f32_v2u32(<2 x float> %src) {
116 ; CHECK-LABEL: cvt_v2f32_v2u32:
118 ; CHECK-NEXT: vmovaps {{.*#+}} xmm1 = [2.14748365E+9,2.14748365E+9,2.14748365E+9,2.14748365E+9]
119 ; CHECK-NEXT: vcmpltps %xmm1, %xmm0, %xmm2
120 ; CHECK-NEXT: vsubps %xmm1, %xmm0, %xmm1
121 ; CHECK-NEXT: vcvttps2dq %xmm1, %xmm1
122 ; CHECK-NEXT: vxorps LCPI11_1, %xmm1, %xmm1
123 ; CHECK-NEXT: vcvttps2dq %xmm0, %xmm0
124 ; CHECK-NEXT: vblendvps %xmm2, %xmm0, %xmm1, %xmm0
126 %res = fptoui <2 x float> %src to <2 x i32>
130 define <32 x i8> @PR40146(<4 x i64> %x) {
131 ; CHECK-LABEL: PR40146:
133 ; CHECK-NEXT: vpshufd {{.*#+}} xmm1 = xmm0[2,3,0,1]
134 ; CHECK-NEXT: vpmovzxbw {{.*#+}} xmm0 = xmm0[0],zero,xmm0[1],zero,xmm0[2],zero,xmm0[3],zero,xmm0[4],zero,xmm0[5],zero,xmm0[6],zero,xmm0[7],zero
135 ; CHECK-NEXT: vpmovzxbw {{.*#+}} xmm1 = xmm1[0],zero,xmm1[1],zero,xmm1[2],zero,xmm1[3],zero,xmm1[4],zero,xmm1[5],zero,xmm1[6],zero,xmm1[7],zero
136 ; CHECK-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
138 %perm = shufflevector <4 x i64> %x, <4 x i64> undef, <4 x i32> <i32 0, i32 undef, i32 1, i32 undef>
139 %t1 = bitcast <4 x i64> %perm to <32 x i8>
140 %t2 = shufflevector <32 x i8> %t1, <32 x i8> <i8 0, i8 undef, i8 undef, i8 undef, i8 undef, i8 undef, i8 undef, i8 undef, i8 undef, i8 undef, i8 undef, i8 undef, i8 undef, i8 undef, i8 undef, i8 undef, i8 0, i8 undef, i8 undef, i8 undef, i8 undef, i8 undef, i8 undef, i8 undef, i8 undef, i8 undef, i8 undef, i8 undef, i8 undef, i8 undef, i8 undef, i8 undef>, <32 x i32> <i32 0, i32 32, i32 1, i32 32, i32 2, i32 32, i32 3, i32 32, i32 4, i32 32, i32 5, i32 32, i32 6, i32 32, i32 7, i32 32, i32 16, i32 48, i32 17, i32 48, i32 18, i32 48, i32 19, i32 48, i32 20, i32 48, i32 21, i32 48, i32 22, i32 48, i32 23, i32 48>