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 3 4 ; Originally from PR2687, but things don't work that way any more. 5 ; there are no MMX instructions here; we use XMM. 6 7 define <2 x double> @a(<2 x i32> %x) nounwind { 8 ; CHECK-LABEL: a: 9 ; CHECK: # %bb.0: # %entry 10 ; CHECK-NEXT: pshufd {{.*#+}} xmm0 = xmm0[0,2,2,3] 11 ; CHECK-NEXT: cvtdq2pd %xmm0, %xmm0 12 ; CHECK-NEXT: retl 13 entry: 14 %y = sitofp <2 x i32> %x to <2 x double> 15 ret <2 x double> %y 16 } 17 18 define <2 x i32> @b(<2 x double> %x) nounwind { 19 ; CHECK-LABEL: b: 20 ; CHECK: # %bb.0: # %entry 21 ; CHECK-NEXT: cvttpd2dq %xmm0, %xmm0 22 ; CHECK-NEXT: pshufd {{.*#+}} xmm0 = xmm0[0,1,1,3] 23 ; CHECK-NEXT: retl 24 entry: 25 %y = fptosi <2 x double> %x to <2 x i32> 26 ret <2 x i32> %y 27 } 28 29 ; This is how to get MMX instructions. 30 31 define <2 x double> @a2(x86_mmx %x) nounwind { 32 ; CHECK-LABEL: a2: 33 ; CHECK: # %bb.0: # %entry 34 ; CHECK-NEXT: cvtpi2pd %mm0, %xmm0 35 ; CHECK-NEXT: retl 36 entry: 37 %y = tail call <2 x double> @llvm.x86.sse.cvtpi2pd(x86_mmx %x) 38 ret <2 x double> %y 39 } 40 41 define x86_mmx @b2(<2 x double> %x) nounwind { 42 ; CHECK-LABEL: b2: 43 ; CHECK: # %bb.0: # %entry 44 ; CHECK-NEXT: cvttpd2pi %xmm0, %mm0 45 ; CHECK-NEXT: retl 46 entry: 47 %y = tail call x86_mmx @llvm.x86.sse.cvttpd2pi (<2 x double> %x) 48 ret x86_mmx %y 49 } 50 51 declare <2 x double> @llvm.x86.sse.cvtpi2pd(x86_mmx) 52 declare x86_mmx @llvm.x86.sse.cvttpd2pi(<2 x double>) 53