1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i686-linux-pc -mcpu=corei7 | FileCheck %s --check-prefix=X32
3 ; RUN: llc < %s -mtriple=x86_64-linux-pc -mcpu=corei7 | FileCheck %s --check-prefix=X64
5 ; uitofp <2 x i32> codegen from buildvector or legalization is different but gives the same results
6 ; across the full 0 - 0xFFFFFFFF u32 range.
8 define <2 x float> @uitofp_2i32_cvt_buildvector(i32 %x, i32 %y, <2 x float> %v) {
9 ; X32-LABEL: uitofp_2i32_cvt_buildvector:
11 ; X32-NEXT: movss {{.*#+}} xmm1 = mem[0],zero,zero,zero
12 ; X32-NEXT: movsd {{.*#+}} xmm2 = mem[0],zero
13 ; X32-NEXT: orpd %xmm2, %xmm1
14 ; X32-NEXT: subsd %xmm2, %xmm1
15 ; X32-NEXT: cvtsd2ss %xmm1, %xmm1
16 ; X32-NEXT: movss {{.*#+}} xmm3 = mem[0],zero,zero,zero
17 ; X32-NEXT: orpd %xmm2, %xmm3
18 ; X32-NEXT: subsd %xmm2, %xmm3
19 ; X32-NEXT: xorps %xmm2, %xmm2
20 ; X32-NEXT: cvtsd2ss %xmm3, %xmm2
21 ; X32-NEXT: insertps {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[2,3]
22 ; X32-NEXT: mulps %xmm1, %xmm0
25 ; X64-LABEL: uitofp_2i32_cvt_buildvector:
27 ; X64-NEXT: movl %edi, %eax
28 ; X64-NEXT: cvtsi2ss %rax, %xmm1
29 ; X64-NEXT: movl %esi, %eax
30 ; X64-NEXT: cvtsi2ss %rax, %xmm2
31 ; X64-NEXT: insertps {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[2,3]
32 ; X64-NEXT: mulps %xmm1, %xmm0
34 %t1 = uitofp i32 %x to float
35 %t2 = insertelement <2 x float> undef, float %t1, i32 0
36 %t3 = uitofp i32 %y to float
37 %t4 = insertelement <2 x float> %t2, float %t3, i32 1
38 %t5 = fmul <2 x float> %v, %t4
42 define <2 x float> @uitofp_2i32_buildvector_cvt(i32 %x, i32 %y, <2 x float> %v) {
43 ; X32-LABEL: uitofp_2i32_buildvector_cvt:
45 ; X32-NEXT: movss {{.*#+}} xmm1 = mem[0],zero,zero,zero
46 ; X32-NEXT: movss {{.*#+}} xmm2 = mem[0],zero,zero,zero
47 ; X32-NEXT: unpcklpd {{.*#+}} xmm2 = xmm2[0],xmm1[0]
48 ; X32-NEXT: movapd {{.*#+}} xmm1 = [4.503599627370496E+15,4.503599627370496E+15]
49 ; X32-NEXT: orpd %xmm1, %xmm2
50 ; X32-NEXT: subpd %xmm1, %xmm2
51 ; X32-NEXT: cvtpd2ps %xmm2, %xmm1
52 ; X32-NEXT: mulps %xmm1, %xmm0
55 ; X64-LABEL: uitofp_2i32_buildvector_cvt:
57 ; X64-NEXT: movd %esi, %xmm1
58 ; X64-NEXT: movd %edi, %xmm2
59 ; X64-NEXT: punpcklqdq {{.*#+}} xmm2 = xmm2[0],xmm1[0]
60 ; X64-NEXT: movdqa {{.*#+}} xmm1 = [4.503599627370496E+15,4.503599627370496E+15]
61 ; X64-NEXT: por %xmm1, %xmm2
62 ; X64-NEXT: subpd %xmm1, %xmm2
63 ; X64-NEXT: cvtpd2ps %xmm2, %xmm1
64 ; X64-NEXT: mulps %xmm1, %xmm0
66 %t1 = insertelement <2 x i32> undef, i32 %x, i32 0
67 %t2 = insertelement <2 x i32> %t1, i32 %y, i32 1
68 %t3 = uitofp <2 x i32> %t2 to <2 x float>
69 %t4 = fmul <2 x float> %v, %t3
73 define <2 x float> @uitofp_2i32_legalized(<2 x i32> %in, <2 x float> %v) {
74 ; X32-LABEL: uitofp_2i32_legalized:
76 ; X32-NEXT: xorps %xmm2, %xmm2
77 ; X32-NEXT: blendps {{.*#+}} xmm2 = xmm0[0],xmm2[1],xmm0[2],xmm2[3]
78 ; X32-NEXT: movaps {{.*#+}} xmm0 = [4.503599627370496E+15,4.503599627370496E+15]
79 ; X32-NEXT: orps %xmm0, %xmm2
80 ; X32-NEXT: subpd %xmm0, %xmm2
81 ; X32-NEXT: cvtpd2ps %xmm2, %xmm0
82 ; X32-NEXT: mulps %xmm1, %xmm0
85 ; X64-LABEL: uitofp_2i32_legalized:
87 ; X64-NEXT: xorps %xmm2, %xmm2
88 ; X64-NEXT: blendps {{.*#+}} xmm2 = xmm0[0],xmm2[1],xmm0[2],xmm2[3]
89 ; X64-NEXT: movaps {{.*#+}} xmm0 = [4.503599627370496E+15,4.503599627370496E+15]
90 ; X64-NEXT: orps %xmm0, %xmm2
91 ; X64-NEXT: subpd %xmm0, %xmm2
92 ; X64-NEXT: cvtpd2ps %xmm2, %xmm0
93 ; X64-NEXT: mulps %xmm1, %xmm0
95 %t1 = uitofp <2 x i32> %in to <2 x float>
96 %t2 = fmul <2 x float> %v, %t1