1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i686-pc-linux-gnu -mcpu=corei7 | FileCheck %s
3 ; RUN: llc < %s -mtriple=i686-pc-linux-gnu -mcpu=core-avx-i | FileCheck %s --check-prefix=AVX
5 define <1 x float> @test1(<1 x double> %x) nounwind {
8 ; CHECK-NEXT: pushl %eax
9 ; CHECK-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero
10 ; CHECK-NEXT: cvtsd2ss %xmm0, %xmm0
11 ; CHECK-NEXT: movss %xmm0, (%esp)
12 ; CHECK-NEXT: flds (%esp)
13 ; CHECK-NEXT: popl %eax
18 ; AVX-NEXT: pushl %eax
19 ; AVX-NEXT: vmovsd {{.*#+}} xmm0 = mem[0],zero
20 ; AVX-NEXT: vcvtsd2ss %xmm0, %xmm0, %xmm0
21 ; AVX-NEXT: vmovss %xmm0, (%esp)
22 ; AVX-NEXT: flds (%esp)
25 %y = fptrunc <1 x double> %x to <1 x float>
29 define <2 x float> @test2(<2 x double> %x) nounwind {
32 ; CHECK-NEXT: cvtpd2ps %xmm0, %xmm0
37 ; AVX-NEXT: vcvtpd2ps %xmm0, %xmm0
39 %y = fptrunc <2 x double> %x to <2 x float>
43 define <4 x float> @test3(<4 x double> %x) nounwind {
46 ; CHECK-NEXT: cvtpd2ps %xmm1, %xmm1
47 ; CHECK-NEXT: cvtpd2ps %xmm0, %xmm0
48 ; CHECK-NEXT: unpcklpd {{.*#+}} xmm0 = xmm0[0],xmm1[0]
53 ; AVX-NEXT: vcvtpd2ps %ymm0, %xmm0
54 ; AVX-NEXT: vzeroupper
56 %y = fptrunc <4 x double> %x to <4 x float>
60 define <8 x float> @test4(<8 x double> %x) nounwind {
63 ; CHECK-NEXT: subl $12, %esp
64 ; CHECK-NEXT: cvtpd2ps %xmm1, %xmm3
65 ; CHECK-NEXT: cvtpd2ps %xmm0, %xmm0
66 ; CHECK-NEXT: cvtpd2ps %xmm2, %xmm1
67 ; CHECK-NEXT: cvtpd2ps {{[0-9]+}}(%esp), %xmm2
68 ; CHECK-NEXT: unpcklpd {{.*#+}} xmm0 = xmm0[0],xmm3[0]
69 ; CHECK-NEXT: unpcklpd {{.*#+}} xmm1 = xmm1[0],xmm2[0]
70 ; CHECK-NEXT: addl $12, %esp
75 ; AVX-NEXT: vcvtpd2ps %ymm0, %xmm0
76 ; AVX-NEXT: vcvtpd2ps %ymm1, %xmm1
77 ; AVX-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
79 %y = fptrunc <8 x double> %x to <8 x float>