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(ptr %dst, ptr %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
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, %xmm2
23 ; CHECK-NEXT: psubw %xmm0, %xmm1
24 ; CHECK-NEXT: movdqa %xmm1, (%ecx,%eax)
25 ; CHECK-NEXT: movd %xmm2, 16(%ecx,%eax)
26 ; CHECK-NEXT: pextrd $1, %xmm2, 20(%ecx,%eax)
27 ; CHECK-NEXT: pextrd $2, %xmm2, 24(%ecx,%eax)
28 ; CHECK-NEXT: incl (%esp)
29 ; CHECK-NEXT: cmpl $3, (%esp)
30 ; CHECK-NEXT: jle .LBB0_2
31 ; CHECK-NEXT: .LBB0_3: # %afterfor
32 ; CHECK-NEXT: popl %eax
35 %dst.addr = alloca ptr
36 %src.addr = alloca ptr
37 %i = alloca i32, align 4
38 store ptr %dst, ptr %dst.addr
39 store ptr %src, ptr %src.addr
44 %tmp = load i32, ptr %i
45 %cmp = icmp slt i32 %tmp, 4
46 br i1 %cmp, label %forbody, label %afterfor
49 %tmp1 = load i32, ptr %i
50 %tmp2 = load ptr, ptr %dst.addr
51 %arrayidx = getelementptr <7 x i32>, ptr %tmp2, i32 %tmp1
52 %tmp3 = load i32, ptr %i
53 %tmp4 = load ptr, ptr %src.addr
54 %arrayidx5 = getelementptr <14 x i16>, ptr %tmp4, i32 %tmp3
55 %tmp6 = load <14 x i16>, ptr %arrayidx5
56 %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 >
57 %conv = bitcast <14 x i16> %add to <7 x i32>
58 store <7 x i32> %conv, ptr %arrayidx
62 %tmp7 = load i32, ptr %i
63 %inc = add i32 %tmp7, 1
64 store i32 %inc, ptr %i