1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py 2; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=+sse4.2 | FileCheck %s 3 4; widen a v3f32 to vfi32 to do a vector multiple and an add 5 6define void @update(<3 x float>* %dst, <3 x float>* %src, i32 %n) nounwind { 7; CHECK-LABEL: update: 8; CHECK: # %bb.0: # %entry 9; CHECK-NEXT: pushl %ebp 10; CHECK-NEXT: movl %esp, %ebp 11; CHECK-NEXT: andl $-16, %esp 12; CHECK-NEXT: subl $48, %esp 13; CHECK-NEXT: movl $1077936128, {{[0-9]+}}(%esp) # imm = 0x40400000 14; CHECK-NEXT: movl $1073741824, {{[0-9]+}}(%esp) # imm = 0x40000000 15; CHECK-NEXT: movl $1065353216, {{[0-9]+}}(%esp) # imm = 0x3F800000 16; CHECK-NEXT: movl $0, {{[0-9]+}}(%esp) 17; CHECK-NEXT: movaps {{.*#+}} xmm0 = <1976.04004,1976.04004,1976.04004,u> 18; CHECK-NEXT: jmp .LBB0_1 19; CHECK-NEXT: .p2align 4, 0x90 20; CHECK-NEXT: .LBB0_2: # %forbody 21; CHECK-NEXT: # in Loop: Header=BB0_1 Depth=1 22; CHECK-NEXT: movl {{[0-9]+}}(%esp), %eax 23; CHECK-NEXT: movl 8(%ebp), %ecx 24; CHECK-NEXT: shll $4, %eax 25; CHECK-NEXT: movl 12(%ebp), %edx 26; CHECK-NEXT: movaps (%edx,%eax), %xmm1 27; CHECK-NEXT: mulps {{[0-9]+}}(%esp), %xmm1 28; CHECK-NEXT: addps %xmm0, %xmm1 29; CHECK-NEXT: extractps $2, %xmm1, 8(%ecx,%eax) 30; CHECK-NEXT: extractps $1, %xmm1, 4(%ecx,%eax) 31; CHECK-NEXT: movss %xmm1, (%ecx,%eax) 32; CHECK-NEXT: incl {{[0-9]+}}(%esp) 33; CHECK-NEXT: .LBB0_1: # %forcond 34; CHECK-NEXT: # =>This Inner Loop Header: Depth=1 35; CHECK-NEXT: movl {{[0-9]+}}(%esp), %eax 36; CHECK-NEXT: cmpl 16(%ebp), %eax 37; CHECK-NEXT: jl .LBB0_2 38; CHECK-NEXT: # %bb.3: # %afterfor 39; CHECK-NEXT: movl %ebp, %esp 40; CHECK-NEXT: popl %ebp 41; CHECK-NEXT: retl 42entry: 43 %dst.addr = alloca <3 x float>* 44 %src.addr = alloca <3 x float>* 45 %n.addr = alloca i32 46 %v = alloca <3 x float>, align 16 47 %i = alloca i32, align 4 48 store <3 x float>* %dst, <3 x float>** %dst.addr 49 store <3 x float>* %src, <3 x float>** %src.addr 50 store i32 %n, i32* %n.addr 51 store <3 x float> < float 1.000000e+00, float 2.000000e+00, float 3.000000e+00 >, <3 x float>* %v 52 store i32 0, i32* %i 53 br label %forcond 54 55forcond: 56 %tmp = load i32, i32* %i 57 %tmp1 = load i32, i32* %n.addr 58 %cmp = icmp slt i32 %tmp, %tmp1 59 br i1 %cmp, label %forbody, label %afterfor 60 61forbody: 62 %tmp2 = load i32, i32* %i 63 %tmp3 = load <3 x float>*, <3 x float>** %dst.addr 64 %arrayidx = getelementptr <3 x float>, <3 x float>* %tmp3, i32 %tmp2 65 %tmp4 = load i32, i32* %i 66 %tmp5 = load <3 x float>*, <3 x float>** %src.addr 67 %arrayidx6 = getelementptr <3 x float>, <3 x float>* %tmp5, i32 %tmp4 68 %tmp7 = load <3 x float>, <3 x float>* %arrayidx6 69 %tmp8 = load <3 x float>, <3 x float>* %v 70 %mul = fmul <3 x float> %tmp7, %tmp8 71 %add = fadd <3 x float> %mul, < float 0x409EE02900000000, float 0x409EE02900000000, float 0x409EE02900000000 > 72 store <3 x float> %add, <3 x float>* %arrayidx 73 br label %forinc 74 75forinc: 76 %tmp9 = load i32, i32* %i 77 %inc = add i32 %tmp9, 1 78 store i32 %inc, i32* %i 79 br label %forcond 80 81afterfor: 82 ret void 83} 84