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
4 ; widen a v3f32 to vfi32 to do a vector multiple and an add
6 define void @update(ptr %dst, ptr %src, i32 %n) nounwind {
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 = [1.97604004E+3,1.97604004E+3,1.97604004E+3,u]
18 ; CHECK-NEXT: .p2align 4, 0x90
19 ; CHECK-NEXT: .LBB0_1: # %forcond
20 ; CHECK-NEXT: # =>This Inner Loop Header: Depth=1
21 ; CHECK-NEXT: movl {{[0-9]+}}(%esp), %eax
22 ; CHECK-NEXT: cmpl 16(%ebp), %eax
23 ; CHECK-NEXT: jge .LBB0_3
24 ; CHECK-NEXT: # %bb.2: # %forbody
25 ; CHECK-NEXT: # in Loop: Header=BB0_1 Depth=1
26 ; CHECK-NEXT: movl {{[0-9]+}}(%esp), %eax
27 ; CHECK-NEXT: movl 8(%ebp), %ecx
28 ; CHECK-NEXT: shll $4, %eax
29 ; CHECK-NEXT: movl 12(%ebp), %edx
30 ; CHECK-NEXT: movaps (%edx,%eax), %xmm1
31 ; CHECK-NEXT: mulps {{[0-9]+}}(%esp), %xmm1
32 ; CHECK-NEXT: addps %xmm0, %xmm1
33 ; CHECK-NEXT: extractps $2, %xmm1, 8(%ecx,%eax)
34 ; CHECK-NEXT: extractps $1, %xmm1, 4(%ecx,%eax)
35 ; CHECK-NEXT: movss %xmm1, (%ecx,%eax)
36 ; CHECK-NEXT: incl {{[0-9]+}}(%esp)
37 ; CHECK-NEXT: jmp .LBB0_1
38 ; CHECK-NEXT: .LBB0_3: # %afterfor
39 ; CHECK-NEXT: movl %ebp, %esp
40 ; CHECK-NEXT: popl %ebp
43 %dst.addr = alloca ptr
44 %src.addr = alloca ptr
46 %v = alloca <3 x float>, align 16
47 %i = alloca i32, align 4
48 store ptr %dst, ptr %dst.addr
49 store ptr %src, ptr %src.addr
50 store i32 %n, ptr %n.addr
51 store <3 x float> < float 1.000000e+00, float 2.000000e+00, float 3.000000e+00 >, ptr %v
56 %tmp = load i32, ptr %i
57 %tmp1 = load i32, ptr %n.addr
58 %cmp = icmp slt i32 %tmp, %tmp1
59 br i1 %cmp, label %forbody, label %afterfor
62 %tmp2 = load i32, ptr %i
63 %tmp3 = load ptr, ptr %dst.addr
64 %arrayidx = getelementptr <3 x float>, ptr %tmp3, i32 %tmp2
65 %tmp4 = load i32, ptr %i
66 %tmp5 = load ptr, ptr %src.addr
67 %arrayidx6 = getelementptr <3 x float>, ptr %tmp5, i32 %tmp4
68 %tmp7 = load <3 x float>, ptr %arrayidx6
69 %tmp8 = load <3 x float>, ptr %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, ptr %arrayidx
76 %tmp9 = load i32, ptr %i
77 %inc = add i32 %tmp9, 1
78 store i32 %inc, ptr %i