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>* %p) nounwind {
8 ; CHECK-NEXT: pushl %eax
9 ; CHECK-NEXT: movl {{[0-9]+}}(%esp), %eax
10 ; CHECK-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero
11 ; CHECK-NEXT: cvtsd2ss %xmm0, %xmm0
12 ; CHECK-NEXT: movss %xmm0, (%esp)
13 ; CHECK-NEXT: flds (%esp)
14 ; CHECK-NEXT: popl %eax
19 ; AVX-NEXT: pushl %eax
20 ; AVX-NEXT: movl {{[0-9]+}}(%esp), %eax
21 ; AVX-NEXT: vmovsd {{.*#+}} xmm0 = mem[0],zero
22 ; AVX-NEXT: vcvtsd2ss %xmm0, %xmm0, %xmm0
23 ; AVX-NEXT: vmovss %xmm0, (%esp)
24 ; AVX-NEXT: flds (%esp)
27 %x = load <1 x double>, <1 x double>* %p
28 %y = fptrunc <1 x double> %x to <1 x float>
32 define <2 x float> @test2(<2 x double>* %p) nounwind {
35 ; CHECK-NEXT: movl {{[0-9]+}}(%esp), %eax
36 ; CHECK-NEXT: cvtpd2ps (%eax), %xmm0
41 ; AVX-NEXT: movl {{[0-9]+}}(%esp), %eax
42 ; AVX-NEXT: vcvtpd2psx (%eax), %xmm0
44 %x = load <2 x double>, <2 x double>* %p
45 %y = fptrunc <2 x double> %x to <2 x float>
49 define <4 x float> @test3(<4 x double>* %p) nounwind {
52 ; CHECK-NEXT: movl {{[0-9]+}}(%esp), %eax
53 ; CHECK-NEXT: cvtpd2ps 16(%eax), %xmm1
54 ; CHECK-NEXT: cvtpd2ps (%eax), %xmm0
55 ; CHECK-NEXT: unpcklpd {{.*#+}} xmm0 = xmm0[0],xmm1[0]
60 ; AVX-NEXT: movl {{[0-9]+}}(%esp), %eax
61 ; AVX-NEXT: vcvtpd2psy (%eax), %xmm0
63 %x = load <4 x double>, <4 x double>* %p
64 %y = fptrunc <4 x double> %x to <4 x float>
68 define <8 x float> @test4(<8 x double>* %p) nounwind {
71 ; CHECK-NEXT: movl {{[0-9]+}}(%esp), %eax
72 ; CHECK-NEXT: cvtpd2ps 16(%eax), %xmm1
73 ; CHECK-NEXT: cvtpd2ps (%eax), %xmm0
74 ; CHECK-NEXT: unpcklpd {{.*#+}} xmm0 = xmm0[0],xmm1[0]
75 ; CHECK-NEXT: cvtpd2ps 48(%eax), %xmm2
76 ; CHECK-NEXT: cvtpd2ps 32(%eax), %xmm1
77 ; CHECK-NEXT: unpcklpd {{.*#+}} xmm1 = xmm1[0],xmm2[0]
82 ; AVX-NEXT: movl {{[0-9]+}}(%esp), %eax
83 ; AVX-NEXT: vcvtpd2psy (%eax), %xmm0
84 ; AVX-NEXT: vcvtpd2psy 32(%eax), %xmm1
85 ; AVX-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
87 %x = load <8 x double>, <8 x double>* %p
88 %y = fptrunc <8 x double> %x to <8 x float>