63 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=X863; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+sse4.1 | FileCheck %s --check-prefix=X644 5; tests variable insert and extract of a 4 x i326 7define <4 x i32> @var_insert(<4 x i32> %x, i32 %val, i32 %idx) nounwind {8; X86-LABEL: var_insert:9; X86: # %bb.0: # %entry10; X86-NEXT: pushl %ebp11; X86-NEXT: movl %esp, %ebp12; X86-NEXT: andl $-16, %esp13; X86-NEXT: subl $32, %esp14; X86-NEXT: movl 12(%ebp), %eax15; X86-NEXT: andl $3, %eax16; X86-NEXT: movl 8(%ebp), %ecx17; X86-NEXT: movaps %xmm0, (%esp)18; X86-NEXT: movl %ecx, (%esp,%eax,4)19; X86-NEXT: movaps (%esp), %xmm020; X86-NEXT: movl %ebp, %esp21; X86-NEXT: popl %ebp22; X86-NEXT: retl23;24; X64-LABEL: var_insert:25; X64: # %bb.0: # %entry26; X64-NEXT: # kill: def $esi killed $esi def $rsi27; X64-NEXT: movaps %xmm0, -{{[0-9]+}}(%rsp)28; X64-NEXT: andl $3, %esi29; X64-NEXT: movl %edi, -24(%rsp,%rsi,4)30; X64-NEXT: movaps -{{[0-9]+}}(%rsp), %xmm031; X64-NEXT: retq32entry:33 %tmp3 = insertelement <4 x i32> %x, i32 %val, i32 %idx34 ret <4 x i32> %tmp335}36 37define i32 @var_extract(<4 x i32> %x, i32 %idx) nounwind {38; X86-LABEL: var_extract:39; X86: # %bb.0: # %entry40; X86-NEXT: pushl %ebp41; X86-NEXT: movl %esp, %ebp42; X86-NEXT: andl $-16, %esp43; X86-NEXT: subl $32, %esp44; X86-NEXT: movl 8(%ebp), %eax45; X86-NEXT: andl $3, %eax46; X86-NEXT: movaps %xmm0, (%esp)47; X86-NEXT: movl (%esp,%eax,4), %eax48; X86-NEXT: movl %ebp, %esp49; X86-NEXT: popl %ebp50; X86-NEXT: retl51;52; X64-LABEL: var_extract:53; X64: # %bb.0: # %entry54; X64-NEXT: # kill: def $edi killed $edi def $rdi55; X64-NEXT: movaps %xmm0, -{{[0-9]+}}(%rsp)56; X64-NEXT: andl $3, %edi57; X64-NEXT: movl -24(%rsp,%rdi,4), %eax58; X64-NEXT: retq59entry:60 %tmp3 = extractelement <4 x i32> %x, i32 %idx61 ret i32 %tmp362}63