1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i686-darwin -mattr=+mmx,+sse2 | FileCheck %s --check-prefix=X32
3 ; RUN: llc < %s -mtriple=x86_64-darwin -mattr=+mmx,+sse4.1 | FileCheck %s --check-prefix=X64
5 ; This is not an MMX operation; promoted to xmm.
6 define x86_mmx @t0(i32 %A) nounwind {
9 ; X32-NEXT: movd {{[0-9]+}}(%esp), %mm1
10 ; X32-NEXT: pxor %mm0, %mm0
11 ; X32-NEXT: punpckldq %mm1, %mm0 ## mm0 = mm0[0],mm1[0]
16 ; X64-NEXT: movd %edi, %xmm0
17 ; X64-NEXT: pshufd {{.*#+}} xmm0 = xmm0[1,0,1,1]
19 %tmp3 = insertelement <2 x i32> < i32 0, i32 undef >, i32 %A, i32 1
20 %tmp4 = bitcast <2 x i32> %tmp3 to x86_mmx
24 define <8 x i8> @t1(i8 zeroext %x) nounwind {
27 ; X32-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
32 ; X64-NEXT: movd %edi, %xmm0
34 %r = insertelement <8 x i8> undef, i8 %x, i32 0
39 define <2 x float> @t2(<2 x float> %a0) {
42 ; X32-NEXT: xorps %xmm0, %xmm0
47 ; X64-NEXT: xorps %xmm0, %xmm0
49 %v1 = insertelement <2 x float> %a0, float 0.000000e+00, i32 0
50 %v2 = insertelement <2 x float> %v1, float 0.000000e+00, i32 1
54 @g0 = external global i16
55 @g1 = external global <4 x i16>
61 ; X32-NEXT: movl L_g0$non_lazy_ptr, %eax
62 ; X32-NEXT: movl L_g1$non_lazy_ptr, %ecx
63 ; X32-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
64 ; X32-NEXT: pinsrw $0, (%eax), %xmm0
65 ; X32-NEXT: movq %xmm0, (%ecx)
70 ; X64-NEXT: movq _g0@GOTPCREL(%rip), %rax
71 ; X64-NEXT: movq _g1@GOTPCREL(%rip), %rcx
72 ; X64-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
73 ; X64-NEXT: pinsrw $0, (%rax), %xmm0
74 ; X64-NEXT: movq %xmm0, (%rcx)
77 load <4 x i16>, ptr @g1
78 insertelement <4 x i16> %2, i16 %1, i32 0
79 store <4 x i16> %3, ptr @g1