119 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc < %s -mtriple=i386-unknown -mattr=+sse4.1 | FileCheck %s --check-prefix=X323; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+sse4.1 | FileCheck %s --check-prefix=X644 5; Inserts and extracts with variable indices must be lowered6; to memory accesses.7 8define i32 @t0(i32 inreg %t7, <4 x i32> inreg %t8) nounwind {9; X32-LABEL: t0:10; X32: # %bb.0:11; X32-NEXT: pushl %ebp12; X32-NEXT: movl %esp, %ebp13; X32-NEXT: andl $-16, %esp14; X32-NEXT: subl $32, %esp15; X32-NEXT: andl $3, %eax16; X32-NEXT: movaps %xmm0, (%esp)17; X32-NEXT: movl $76, (%esp,%eax,4)18; X32-NEXT: movl (%esp), %eax19; X32-NEXT: movl %ebp, %esp20; X32-NEXT: popl %ebp21; X32-NEXT: retl22;23; X64-LABEL: t0:24; X64: # %bb.0:25; X64-NEXT: # kill: def $edi killed $edi def $rdi26; X64-NEXT: movaps %xmm0, -{{[0-9]+}}(%rsp)27; X64-NEXT: andl $3, %edi28; X64-NEXT: movl $76, -24(%rsp,%rdi,4)29; X64-NEXT: movl -{{[0-9]+}}(%rsp), %eax30; X64-NEXT: retq31 %t13 = insertelement <4 x i32> %t8, i32 76, i32 %t732 %t9 = extractelement <4 x i32> %t13, i32 033 ret i32 %t934}35 36define i32 @t1(i32 inreg %t7, <4 x i32> inreg %t8) nounwind {37; X32-LABEL: t1:38; X32: # %bb.0:39; X32-NEXT: pushl %ebp40; X32-NEXT: movl %esp, %ebp41; X32-NEXT: andl $-16, %esp42; X32-NEXT: subl $32, %esp43; X32-NEXT: andl $3, %eax44; X32-NEXT: movl $76, %ecx45; X32-NEXT: pinsrd $0, %ecx, %xmm046; X32-NEXT: movdqa %xmm0, (%esp)47; X32-NEXT: movl (%esp,%eax,4), %eax48; X32-NEXT: movl %ebp, %esp49; X32-NEXT: popl %ebp50; X32-NEXT: retl51;52; X64-LABEL: t1:53; X64: # %bb.0:54; X64-NEXT: # kill: def $edi killed $edi def $rdi55; X64-NEXT: movl $76, %eax56; X64-NEXT: pinsrd $0, %eax, %xmm057; X64-NEXT: movdqa %xmm0, -{{[0-9]+}}(%rsp)58; X64-NEXT: andl $3, %edi59; X64-NEXT: movl -24(%rsp,%rdi,4), %eax60; X64-NEXT: retq61 %t13 = insertelement <4 x i32> %t8, i32 76, i32 062 %t9 = extractelement <4 x i32> %t13, i32 %t763 ret i32 %t964}65 66define <4 x i32> @t2(i32 inreg %t7, <4 x i32> inreg %t8) nounwind {67; X32-LABEL: t2:68; X32: # %bb.0:69; X32-NEXT: pushl %ebp70; X32-NEXT: movl %esp, %ebp71; X32-NEXT: andl $-16, %esp72; X32-NEXT: subl $32, %esp73; X32-NEXT: andl $3, %eax74; X32-NEXT: movdqa %xmm0, (%esp)75; X32-NEXT: pinsrd $0, (%esp,%eax,4), %xmm076; X32-NEXT: movl %ebp, %esp77; X32-NEXT: popl %ebp78; X32-NEXT: retl79;80; X64-LABEL: t2:81; X64: # %bb.0:82; X64-NEXT: # kill: def $edi killed $edi def $rdi83; X64-NEXT: movdqa %xmm0, -{{[0-9]+}}(%rsp)84; X64-NEXT: andl $3, %edi85; X64-NEXT: pinsrd $0, -24(%rsp,%rdi,4), %xmm086; X64-NEXT: retq87 %t9 = extractelement <4 x i32> %t8, i32 %t788 %t13 = insertelement <4 x i32> %t8, i32 %t9, i32 089 ret <4 x i32> %t1390}91 92define <4 x i32> @t3(i32 inreg %t7, <4 x i32> inreg %t8) nounwind {93; X32-LABEL: t3:94; X32: # %bb.0:95; X32-NEXT: pushl %ebp96; X32-NEXT: movl %esp, %ebp97; X32-NEXT: andl $-16, %esp98; X32-NEXT: subl $32, %esp99; X32-NEXT: andl $3, %eax100; X32-NEXT: movaps %xmm0, (%esp)101; X32-NEXT: movss %xmm0, (%esp,%eax,4)102; X32-NEXT: movaps (%esp), %xmm0103; X32-NEXT: movl %ebp, %esp104; X32-NEXT: popl %ebp105; X32-NEXT: retl106;107; X64-LABEL: t3:108; X64: # %bb.0:109; X64-NEXT: # kill: def $edi killed $edi def $rdi110; X64-NEXT: movaps %xmm0, -{{[0-9]+}}(%rsp)111; X64-NEXT: andl $3, %edi112; X64-NEXT: movss %xmm0, -24(%rsp,%rdi,4)113; X64-NEXT: movaps -{{[0-9]+}}(%rsp), %xmm0114; X64-NEXT: retq115 %t9 = extractelement <4 x i32> %t8, i32 0116 %t13 = insertelement <4 x i32> %t8, i32 %t9, i32 %t7117 ret <4 x i32> %t13118}119