1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py 2; RUN: llc < %s -mtriple=i686-unknown -mattr=+sse4.1 | FileCheck %s --check-prefix=X32 3; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+sse4.1 | FileCheck %s --check-prefix=X64 4 5define void @t1(float* %R, <4 x float>* %P1) nounwind { 6; X32-LABEL: t1: 7; X32: # %bb.0: 8; X32-NEXT: movl {{[0-9]+}}(%esp), %eax 9; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx 10; X32-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero 11; X32-NEXT: movss %xmm0, (%eax) 12; X32-NEXT: retl 13; 14; X64-LABEL: t1: 15; X64: # %bb.0: 16; X64-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero 17; X64-NEXT: movss %xmm0, (%rdi) 18; X64-NEXT: retq 19 %X = load <4 x float>, <4 x float>* %P1 20 %tmp = extractelement <4 x float> %X, i32 3 21 store float %tmp, float* %R 22 ret void 23} 24 25define float @t2(<4 x float>* %P1) nounwind { 26; X32-LABEL: t2: 27; X32: # %bb.0: 28; X32-NEXT: movl {{[0-9]+}}(%esp), %eax 29; X32-NEXT: flds 8(%eax) 30; X32-NEXT: retl 31; 32; X64-LABEL: t2: 33; X64: # %bb.0: 34; X64-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero 35; X64-NEXT: retq 36 %X = load <4 x float>, <4 x float>* %P1 37 %tmp = extractelement <4 x float> %X, i32 2 38 ret float %tmp 39} 40 41define void @t3(i32* %R, <4 x i32>* %P1) nounwind { 42; X32-LABEL: t3: 43; X32: # %bb.0: 44; X32-NEXT: movl {{[0-9]+}}(%esp), %eax 45; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx 46; X32-NEXT: movl 12(%ecx), %ecx 47; X32-NEXT: movl %ecx, (%eax) 48; X32-NEXT: retl 49; 50; X64-LABEL: t3: 51; X64: # %bb.0: 52; X64-NEXT: movl 12(%rsi), %eax 53; X64-NEXT: movl %eax, (%rdi) 54; X64-NEXT: retq 55 %X = load <4 x i32>, <4 x i32>* %P1 56 %tmp = extractelement <4 x i32> %X, i32 3 57 store i32 %tmp, i32* %R 58 ret void 59} 60 61define i32 @t4(<4 x i32>* %P1) nounwind { 62; X32-LABEL: t4: 63; X32: # %bb.0: 64; X32-NEXT: movl {{[0-9]+}}(%esp), %eax 65; X32-NEXT: movl 12(%eax), %eax 66; X32-NEXT: retl 67; 68; X64-LABEL: t4: 69; X64: # %bb.0: 70; X64-NEXT: movl 12(%rdi), %eax 71; X64-NEXT: retq 72 %X = load <4 x i32>, <4 x i32>* %P1 73 %tmp = extractelement <4 x i32> %X, i32 3 74 ret i32 %tmp 75} 76