1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i686-unknown -mattr=+sse2,+mmx | FileCheck %s
4 ; Originally from PR2687, but things don't work that way any more.
5 ; there are no MMX instructions here; we use XMM.
7 define <2 x double> @a(<2 x i32> %x) nounwind {
9 ; CHECK: # %bb.0: # %entry
10 ; CHECK-NEXT: cvtdq2pd %xmm0, %xmm0
13 %y = sitofp <2 x i32> %x to <2 x double>
17 define <2 x i32> @b(<2 x double> %x) nounwind {
19 ; CHECK: # %bb.0: # %entry
20 ; CHECK-NEXT: cvttpd2dq %xmm0, %xmm0
23 %y = fptosi <2 x double> %x to <2 x i32>
27 ; This is how to get MMX instructions.
29 define <2 x double> @a2(<1 x i64> %x) nounwind {
31 ; CHECK: # %bb.0: # %entry
32 ; CHECK-NEXT: pushl %ebp
33 ; CHECK-NEXT: movl %esp, %ebp
34 ; CHECK-NEXT: andl $-8, %esp
35 ; CHECK-NEXT: subl $8, %esp
36 ; CHECK-NEXT: movl 8(%ebp), %eax
37 ; CHECK-NEXT: movl 12(%ebp), %ecx
38 ; CHECK-NEXT: movl %ecx, {{[0-9]+}}(%esp)
39 ; CHECK-NEXT: movl %eax, (%esp)
40 ; CHECK-NEXT: cvtpi2pd (%esp), %xmm0
41 ; CHECK-NEXT: movl %ebp, %esp
42 ; CHECK-NEXT: popl %ebp
45 %y = tail call <2 x double> @llvm.x86.sse.cvtpi2pd(<1 x i64> %x)
49 define <1 x i64> @b2(<2 x double> %x) nounwind {
51 ; CHECK: # %bb.0: # %entry
52 ; CHECK-NEXT: pushl %ebp
53 ; CHECK-NEXT: movl %esp, %ebp
54 ; CHECK-NEXT: andl $-8, %esp
55 ; CHECK-NEXT: subl $8, %esp
56 ; CHECK-NEXT: cvttpd2pi %xmm0, %mm0
57 ; CHECK-NEXT: movq %mm0, (%esp)
58 ; CHECK-NEXT: movl (%esp), %eax
59 ; CHECK-NEXT: movl {{[0-9]+}}(%esp), %edx
60 ; CHECK-NEXT: movl %ebp, %esp
61 ; CHECK-NEXT: popl %ebp
64 %y = tail call <1 x i64> @llvm.x86.sse.cvttpd2pi (<2 x double> %x)
68 declare <2 x double> @llvm.x86.sse.cvtpi2pd(<1 x i64>)
69 declare <1 x i64> @llvm.x86.sse.cvttpd2pi(<2 x double>)