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 define void @update(ptr %dst, ptr %src, i32 %n) nounwind {
6 ; CHECK: # %bb.0: # %entry
7 ; CHECK-NEXT: pushl %eax
8 ; CHECK-NEXT: movl $0, (%esp)
9 ; CHECK-NEXT: pcmpeqd %xmm0, %xmm0
10 ; CHECK-NEXT: .p2align 4
11 ; CHECK-NEXT: .LBB0_1: # %forcond
12 ; CHECK-NEXT: # =>This Inner Loop Header: Depth=1
13 ; CHECK-NEXT: movl (%esp), %eax
14 ; CHECK-NEXT: cmpl {{[0-9]+}}(%esp), %eax
15 ; CHECK-NEXT: jge .LBB0_3
16 ; CHECK-NEXT: # %bb.2: # %forbody
17 ; CHECK-NEXT: # in Loop: Header=BB0_1 Depth=1
18 ; CHECK-NEXT: movl (%esp), %eax
19 ; CHECK-NEXT: movl {{[0-9]+}}(%esp), %ecx
20 ; CHECK-NEXT: movl {{[0-9]+}}(%esp), %edx
21 ; CHECK-NEXT: movd {{.*#+}} xmm1 = mem[0],zero,zero,zero
22 ; CHECK-NEXT: psubb %xmm0, %xmm1
23 ; CHECK-NEXT: pextrb $2, %xmm1, 2(%ecx,%eax,4)
24 ; CHECK-NEXT: pextrw $0, %xmm1, (%ecx,%eax,4)
25 ; CHECK-NEXT: incl (%esp)
26 ; CHECK-NEXT: jmp .LBB0_1
27 ; CHECK-NEXT: .LBB0_3: # %afterfor
28 ; CHECK-NEXT: popl %eax
31 %dst.addr = alloca ptr
32 %src.addr = alloca ptr
34 %i = alloca i32, align 4
35 store ptr %dst, ptr %dst.addr
36 store ptr %src, ptr %src.addr
37 store i32 %n, ptr %n.addr
42 %tmp = load i32, ptr %i
43 %tmp1 = load i32, ptr %n.addr
44 %cmp = icmp slt i32 %tmp, %tmp1
45 br i1 %cmp, label %forbody, label %afterfor
48 %tmp2 = load i32, ptr %i
49 %tmp3 = load ptr, ptr %dst.addr
50 %arrayidx = getelementptr <3 x i8>, ptr %tmp3, i32 %tmp2
51 %tmp4 = load i32, ptr %i
52 %tmp5 = load ptr, ptr %src.addr
53 %arrayidx6 = getelementptr <3 x i8>, ptr %tmp5, i32 %tmp4
54 %tmp7 = load <3 x i8>, ptr %arrayidx6
55 %add = add <3 x i8> %tmp7, < i8 1, i8 1, i8 1 >
56 store <3 x i8> %add, ptr %arrayidx
60 %tmp8 = load i32, ptr %i
61 %inc = add i32 %tmp8, 1
62 store i32 %inc, ptr %i