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 --check-prefix=WIDE
4 ; FIXME: We shouldn't require both a movd and an insert in the wide version.
6 define void @update(ptr %dst_i, ptr %src_i, i32 %n) nounwind {
8 ; WIDE: # %bb.0: # %entry
9 ; WIDE-NEXT: subl $12, %esp
10 ; WIDE-NEXT: movl $0, (%esp)
11 ; WIDE-NEXT: pcmpeqd %xmm0, %xmm0
12 ; WIDE-NEXT: movdqa {{.*#+}} xmm1 = [63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63]
13 ; WIDE-NEXT: movdqa {{.*#+}} xmm2 = [32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32]
14 ; WIDE-NEXT: .p2align 4, 0x90
15 ; WIDE-NEXT: .LBB0_1: # %forcond
16 ; WIDE-NEXT: # =>This Inner Loop Header: Depth=1
17 ; WIDE-NEXT: movl (%esp), %eax
18 ; WIDE-NEXT: cmpl {{[0-9]+}}(%esp), %eax
19 ; WIDE-NEXT: jge .LBB0_3
20 ; WIDE-NEXT: # %bb.2: # %forbody
21 ; WIDE-NEXT: # in Loop: Header=BB0_1 Depth=1
22 ; WIDE-NEXT: movl (%esp), %eax
23 ; WIDE-NEXT: leal (,%eax,8), %edx
24 ; WIDE-NEXT: movl {{[0-9]+}}(%esp), %ecx
25 ; WIDE-NEXT: addl %edx, %ecx
26 ; WIDE-NEXT: movl %ecx, {{[0-9]+}}(%esp)
27 ; WIDE-NEXT: addl {{[0-9]+}}(%esp), %edx
28 ; WIDE-NEXT: movl %edx, {{[0-9]+}}(%esp)
29 ; WIDE-NEXT: movq {{.*#+}} xmm3 = mem[0],zero
30 ; WIDE-NEXT: psubb %xmm0, %xmm3
31 ; WIDE-NEXT: psrlw $2, %xmm3
32 ; WIDE-NEXT: pand %xmm1, %xmm3
33 ; WIDE-NEXT: pxor %xmm2, %xmm3
34 ; WIDE-NEXT: psubb %xmm2, %xmm3
35 ; WIDE-NEXT: movq %xmm3, (%ecx,%eax,8)
36 ; WIDE-NEXT: incl (%esp)
37 ; WIDE-NEXT: jmp .LBB0_1
38 ; WIDE-NEXT: .LBB0_3: # %afterfor
39 ; WIDE-NEXT: addl $12, %esp
42 %dst_i.addr = alloca ptr
43 %src_i.addr = alloca ptr
45 %i = alloca i32, align 4
46 %dst = alloca ptr, align 4
47 %src = alloca ptr, align 4
48 store ptr %dst_i, ptr %dst_i.addr
49 store ptr %src_i, ptr %src_i.addr
50 store i32 %n, ptr %n.addr
55 %tmp = load i32, ptr %i
56 %tmp1 = load i32, ptr %n.addr
57 %cmp = icmp slt i32 %tmp, %tmp1
58 br i1 %cmp, label %forbody, label %afterfor
61 %tmp2 = load i32, ptr %i
62 %tmp3 = load ptr, ptr %dst_i.addr
63 %arrayidx = getelementptr i64, ptr %tmp3, i32 %tmp2
64 store ptr %arrayidx, ptr %dst
65 %tmp4 = load i32, ptr %i
66 %tmp5 = load ptr, ptr %src_i.addr
67 %arrayidx6 = getelementptr i64, ptr %tmp5, i32 %tmp4
68 store ptr %arrayidx6, ptr %src
69 %tmp8 = load i32, ptr %i
70 %tmp9 = load ptr, ptr %dst
71 %arrayidx10 = getelementptr <8 x i8>, ptr %tmp9, i32 %tmp8
72 %tmp11 = load i32, ptr %i
73 %tmp12 = load ptr, ptr %src
74 %arrayidx13 = getelementptr <8 x i8>, ptr %tmp12, i32 %tmp11
75 %tmp14 = load <8 x i8>, ptr %arrayidx13
76 %add = add <8 x i8> %tmp14, < i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1 >
77 %shr = ashr <8 x i8> %add, < i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2 >
78 store <8 x i8> %shr, ptr %arrayidx10
82 %tmp15 = load i32, ptr %i
83 %inc = add i32 %tmp15, 1
84 store i32 %inc, ptr %i