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(<3 x i8>* %dst, <3 x i8>* %src, i32 %n) nounwind {
6 ; CHECK: # %bb.0: # %entry
7 ; CHECK-NEXT: subl $12, %esp
8 ; CHECK-NEXT: movl $0, (%esp)
9 ; CHECK-NEXT: pcmpeqd %xmm0, %xmm0
10 ; CHECK-NEXT: movdqa {{.*#+}} xmm1 = <0,4,8,12,u,u,u,u,u,u,u,u,u,u,u,u>
11 ; CHECK-NEXT: .p2align 4, 0x90
12 ; CHECK-NEXT: .LBB0_1: # %forcond
13 ; CHECK-NEXT: # =>This Inner Loop Header: Depth=1
14 ; CHECK-NEXT: movl (%esp), %eax
15 ; CHECK-NEXT: cmpl {{[0-9]+}}(%esp), %eax
16 ; CHECK-NEXT: jge .LBB0_3
17 ; CHECK-NEXT: # %bb.2: # %forbody
18 ; CHECK-NEXT: # in Loop: Header=BB0_1 Depth=1
19 ; CHECK-NEXT: movl (%esp), %eax
20 ; CHECK-NEXT: movl {{[0-9]+}}(%esp), %ecx
21 ; CHECK-NEXT: movl {{[0-9]+}}(%esp), %edx
22 ; CHECK-NEXT: pmovzxbd {{.*#+}} xmm2 = mem[0],zero,zero,zero,mem[1],zero,zero,zero,mem[2],zero,zero,zero,mem[3],zero,zero,zero
23 ; CHECK-NEXT: psubd %xmm0, %xmm2
24 ; CHECK-NEXT: pextrb $8, %xmm2, 2(%ecx,%eax,4)
25 ; CHECK-NEXT: pshufb %xmm1, %xmm2
26 ; CHECK-NEXT: pextrw $0, %xmm2, (%ecx,%eax,4)
27 ; CHECK-NEXT: incl (%esp)
28 ; CHECK-NEXT: jmp .LBB0_1
29 ; CHECK-NEXT: .LBB0_3: # %afterfor
30 ; CHECK-NEXT: addl $12, %esp
33 %dst.addr = alloca <3 x i8>*
34 %src.addr = alloca <3 x i8>*
36 %i = alloca i32, align 4
37 store <3 x i8>* %dst, <3 x i8>** %dst.addr
38 store <3 x i8>* %src, <3 x i8>** %src.addr
39 store i32 %n, i32* %n.addr
44 %tmp = load i32, i32* %i
45 %tmp1 = load i32, i32* %n.addr
46 %cmp = icmp slt i32 %tmp, %tmp1
47 br i1 %cmp, label %forbody, label %afterfor
50 %tmp2 = load i32, i32* %i
51 %tmp3 = load <3 x i8>*, <3 x i8>** %dst.addr
52 %arrayidx = getelementptr <3 x i8>, <3 x i8>* %tmp3, i32 %tmp2
53 %tmp4 = load i32, i32* %i
54 %tmp5 = load <3 x i8>*, <3 x i8>** %src.addr
55 %arrayidx6 = getelementptr <3 x i8>, <3 x i8>* %tmp5, i32 %tmp4
56 %tmp7 = load <3 x i8>, <3 x i8>* %arrayidx6
57 %add = add <3 x i8> %tmp7, < i8 1, i8 1, i8 1 >
58 store <3 x i8> %add, <3 x i8>* %arrayidx
62 %tmp8 = load i32, i32* %i
63 %inc = add i32 %tmp8, 1
64 store i32 %inc, i32* %i