1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i686-darwin -mattr=+mmx,+sse2 | FileCheck --check-prefix=X32 %s
3 ; RUN: llc < %s -mtriple=x86_64-darwin -mattr=+mmx,+sse2 | FileCheck --check-prefix=X64 %s
5 ; If there is no explicit MMX type usage, always promote to XMM.
7 define void @test0(<1 x i64>* %x) {
9 ; X32: ## BB#0: ## %entry
10 ; X32-NEXT: movl {{[0-9]+}}(%esp), %eax
11 ; X32-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero
12 ; X32-NEXT: shufps {{.*#+}} xmm0 = xmm0[1,1,2,3]
13 ; X32-NEXT: movlps %xmm0, (%eax)
17 ; X64: ## BB#0: ## %entry
18 ; X64-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
19 ; X64-NEXT: pshufd {{.*#+}} xmm0 = xmm0[1,1,2,3]
20 ; X64-NEXT: movq %xmm0, (%rdi)
23 %tmp2 = load <1 x i64>, <1 x i64>* %x
24 %tmp6 = bitcast <1 x i64> %tmp2 to <2 x i32>
25 %tmp9 = shufflevector <2 x i32> %tmp6, <2 x i32> undef, <2 x i32> < i32 1, i32 1 >
26 %tmp10 = bitcast <2 x i32> %tmp9 to <1 x i64>
27 store <1 x i64> %tmp10, <1 x i64>* %x
31 define void @test1() {
33 ; X32: ## BB#0: ## %entry
34 ; X32-NEXT: pushl %edi
35 ; X32-NEXT: .cfi_def_cfa_offset 8
36 ; X32-NEXT: subl $16, %esp
37 ; X32-NEXT: .cfi_def_cfa_offset 24
38 ; X32-NEXT: .cfi_offset %edi, -8
39 ; X32-NEXT: xorps %xmm0, %xmm0
40 ; X32-NEXT: movlps %xmm0, (%esp)
41 ; X32-NEXT: movq (%esp), %mm0
42 ; X32-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero
43 ; X32-NEXT: movsd %xmm0, {{[0-9]+}}(%esp)
44 ; X32-NEXT: movq {{[0-9]+}}(%esp), %mm1
45 ; X32-NEXT: xorl %edi, %edi
46 ; X32-NEXT: maskmovq %mm1, %mm0
47 ; X32-NEXT: addl $16, %esp
52 ; X64: ## BB#0: ## %entry
53 ; X64-NEXT: xorps %xmm0, %xmm0
54 ; X64-NEXT: movlps %xmm0, -{{[0-9]+}}(%rsp)
55 ; X64-NEXT: movq -{{[0-9]+}}(%rsp), %mm0
56 ; X64-NEXT: movq {{.*}}(%rip), %rax
57 ; X64-NEXT: movq %rax, -{{[0-9]+}}(%rsp)
58 ; X64-NEXT: movq -{{[0-9]+}}(%rsp), %mm1
59 ; X64-NEXT: xorl %edi, %edi
60 ; X64-NEXT: maskmovq %mm1, %mm0
63 %tmp528 = bitcast <8 x i8> zeroinitializer to <2 x i32>
64 %tmp529 = and <2 x i32> %tmp528, bitcast (<4 x i16> < i16 -32640, i16 16448, i16 8224, i16 4112 > to <2 x i32>)
65 %tmp542 = bitcast <2 x i32> %tmp529 to <4 x i16>
66 %tmp543 = add <4 x i16> %tmp542, < i16 0, i16 16448, i16 24672, i16 28784 >
67 %tmp555 = bitcast <4 x i16> %tmp543 to <8 x i8>
68 %tmp556 = bitcast <8 x i8> %tmp555 to x86_mmx
69 %tmp557 = bitcast <8 x i8> zeroinitializer to x86_mmx
70 tail call void @llvm.x86.mmx.maskmovq( x86_mmx %tmp557, x86_mmx %tmp556, i8* null)
74 @tmp_V2i = common global <2 x i32> zeroinitializer
76 define void @test2() nounwind {
78 ; X32: ## BB#0: ## %entry
79 ; X32-NEXT: movl L_tmp_V2i$non_lazy_ptr, %eax
80 ; X32-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero
81 ; X32-NEXT: unpcklps {{.*#+}} xmm0 = xmm0[0,0,1,1]
82 ; X32-NEXT: movlps %xmm0, (%eax)
86 ; X64: ## BB#0: ## %entry
87 ; X64-NEXT: movq _tmp_V2i@{{.*}}(%rip), %rax
88 ; X64-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
89 ; X64-NEXT: pshufd {{.*#+}} xmm0 = xmm0[0,0,1,1]
90 ; X64-NEXT: movq %xmm0, (%rax)
93 %0 = load <2 x i32>, <2 x i32>* @tmp_V2i, align 8
94 %1 = shufflevector <2 x i32> %0, <2 x i32> undef, <2 x i32> zeroinitializer
95 store <2 x i32> %1, <2 x i32>* @tmp_V2i, align 8
99 declare void @llvm.x86.mmx.maskmovq(x86_mmx, x86_mmx, i8*)