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
3 ; bitcast v14i16 to v7i32
5 define void @convert(<7 x i32>* %dst, <14 x i16>* %src) nounwind {
6 ; CHECK-LABEL: convert:
7 ; CHECK: # %bb.0: # %entry
8 ; CHECK-NEXT: pushl %eax
9 ; CHECK-NEXT: movl $0, (%esp)
10 ; CHECK-NEXT: pcmpeqd %xmm0, %xmm0
11 ; CHECK-NEXT: cmpl $3, (%esp)
12 ; CHECK-NEXT: jg .LBB0_3
13 ; CHECK-NEXT: .p2align 4, 0x90
14 ; CHECK-NEXT: .LBB0_2: # %forbody
15 ; CHECK-NEXT: # =>This Inner Loop Header: Depth=1
16 ; CHECK-NEXT: movl (%esp), %eax
17 ; CHECK-NEXT: movl {{[0-9]+}}(%esp), %ecx
18 ; CHECK-NEXT: shll $5, %eax
19 ; CHECK-NEXT: movl {{[0-9]+}}(%esp), %edx
20 ; CHECK-NEXT: movdqa (%edx,%eax), %xmm1
21 ; CHECK-NEXT: movdqa 16(%edx,%eax), %xmm2
22 ; CHECK-NEXT: psubw %xmm0, %xmm1
23 ; CHECK-NEXT: psubw %xmm0, %xmm2
24 ; CHECK-NEXT: pextrd $2, %xmm2, 24(%ecx,%eax)
25 ; CHECK-NEXT: movq %xmm2, 16(%ecx,%eax)
26 ; CHECK-NEXT: movdqa %xmm1, (%ecx,%eax)
27 ; CHECK-NEXT: incl (%esp)
28 ; CHECK-NEXT: cmpl $3, (%esp)
29 ; CHECK-NEXT: jle .LBB0_2
30 ; CHECK-NEXT: .LBB0_3: # %afterfor
31 ; CHECK-NEXT: popl %eax
34 %dst.addr = alloca <7 x i32>*
35 %src.addr = alloca <14 x i16>*
36 %i = alloca i32, align 4
37 store <7 x i32>* %dst, <7 x i32>** %dst.addr
38 store <14 x i16>* %src, <14 x i16>** %src.addr
43 %tmp = load i32, i32* %i
44 %cmp = icmp slt i32 %tmp, 4
45 br i1 %cmp, label %forbody, label %afterfor
48 %tmp1 = load i32, i32* %i
49 %tmp2 = load <7 x i32>*, <7 x i32>** %dst.addr
50 %arrayidx = getelementptr <7 x i32>, <7 x i32>* %tmp2, i32 %tmp1
51 %tmp3 = load i32, i32* %i
52 %tmp4 = load <14 x i16>*, <14 x i16>** %src.addr
53 %arrayidx5 = getelementptr <14 x i16>, <14 x i16>* %tmp4, i32 %tmp3
54 %tmp6 = load <14 x i16>, <14 x i16>* %arrayidx5
55 %add = add <14 x i16> %tmp6, < i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1 >
56 %conv = bitcast <14 x i16> %add to <7 x i32>
57 store <7 x i32> %conv, <7 x i32>* %arrayidx
61 %tmp7 = load i32, i32* %i
62 %inc = add i32 %tmp7, 1
63 store i32 %inc, i32* %i