1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=+sse4.2 -post-RA-scheduler=true | FileCheck %s
4 ; Widen a v3i16 to v8i16 to do a vector add
6 @.str = internal constant [4 x i8] c"%d \00"
7 @.str1 = internal constant [2 x i8] c"\0A\00"
9 define void @update(<3 x i16>* %dst, <3 x i16>* %src, i32 %n) nounwind {
10 ; CHECK-LABEL: update:
11 ; CHECK: # %bb.0: # %entry
12 ; CHECK-NEXT: pushl %ebp
13 ; CHECK-NEXT: movl %esp, %ebp
14 ; CHECK-NEXT: andl $-8, %esp
15 ; CHECK-NEXT: subl $32, %esp
16 ; CHECK-NEXT: movdqa {{.*#+}} xmm1 = [0,1,4,5,8,9,12,13,8,9,12,13,12,13,14,15]
17 ; CHECK-NEXT: pcmpeqd %xmm0, %xmm0
18 ; CHECK-NEXT: movw $1, {{[0-9]+}}(%esp)
19 ; CHECK-NEXT: movl $65537, {{[0-9]+}}(%esp) # imm = 0x10001
20 ; CHECK-NEXT: movl $0, {{[0-9]+}}(%esp)
21 ; CHECK-NEXT: .p2align 4, 0x90
22 ; CHECK-NEXT: .LBB0_1: # %forcond
23 ; CHECK-NEXT: # =>This Inner Loop Header: Depth=1
24 ; CHECK-NEXT: movl {{[0-9]+}}(%esp), %eax
25 ; CHECK-NEXT: cmpl 16(%ebp), %eax
26 ; CHECK-NEXT: jge .LBB0_3
27 ; CHECK-NEXT: # %bb.2: # %forbody
28 ; CHECK-NEXT: # in Loop: Header=BB0_1 Depth=1
29 ; CHECK-NEXT: movl {{[0-9]+}}(%esp), %eax
30 ; CHECK-NEXT: movl 12(%ebp), %edx
31 ; CHECK-NEXT: movl 8(%ebp), %ecx
32 ; CHECK-NEXT: pmovzxwd {{.*#+}} xmm2 = mem[0],zero,mem[1],zero,mem[2],zero,mem[3],zero
33 ; CHECK-NEXT: psubd %xmm0, %xmm2
34 ; CHECK-NEXT: pextrw $4, %xmm2, 4(%ecx,%eax,8)
35 ; CHECK-NEXT: pshufb %xmm1, %xmm2
36 ; CHECK-NEXT: movd %xmm2, (%ecx,%eax,8)
37 ; CHECK-NEXT: incl {{[0-9]+}}(%esp)
38 ; CHECK-NEXT: jmp .LBB0_1
39 ; CHECK-NEXT: .LBB0_3: # %afterfor
40 ; CHECK-NEXT: movl %ebp, %esp
41 ; CHECK-NEXT: popl %ebp
44 %dst.addr = alloca <3 x i16>*
45 %src.addr = alloca <3 x i16>*
47 %v = alloca <3 x i16>, align 8
48 %i = alloca i32, align 4
49 store <3 x i16>* %dst, <3 x i16>** %dst.addr
50 store <3 x i16>* %src, <3 x i16>** %src.addr
51 store i32 %n, i32* %n.addr
52 store <3 x i16> < i16 1, i16 1, i16 1 >, <3 x i16>* %v
57 %tmp = load i32, i32* %i
58 %tmp1 = load i32, i32* %n.addr
59 %cmp = icmp slt i32 %tmp, %tmp1
60 br i1 %cmp, label %forbody, label %afterfor
63 %tmp2 = load i32, i32* %i
64 %tmp3 = load <3 x i16>*, <3 x i16>** %dst.addr
65 %arrayidx = getelementptr <3 x i16>, <3 x i16>* %tmp3, i32 %tmp2
66 %tmp4 = load i32, i32* %i
67 %tmp5 = load <3 x i16>*, <3 x i16>** %src.addr
68 %arrayidx6 = getelementptr <3 x i16>, <3 x i16>* %tmp5, i32 %tmp4
69 %tmp7 = load <3 x i16>, <3 x i16>* %arrayidx6
70 %add = add <3 x i16> %tmp7, < i16 1, i16 1, i16 1 >
71 store <3 x i16> %add, <3 x i16>* %arrayidx
75 %tmp8 = load i32, i32* %i
76 %inc = add i32 %tmp8, 1
77 store i32 %inc, i32* %i