Convert more tests to avoid llvm-as.
[oota-llvm.git] / test / CodeGen / X86 / widen_cast-2.ll
1 ; RUN: llc < %s -march=x86 -mattr=+sse42 -disable-mmx -o %t
2 ; RUN: grep pextrd  %t | count 5
3 ; RUN: grep movd  %t | count 3
4
5 ; bitcast v14i16 to v7i32
6
7 define void @convert(<7 x i32>* %dst, <14 x i16>* %src) nounwind {
8 entry:
9         %dst.addr = alloca <7 x i32>*           ; <<7 x i32>**> [#uses=2]
10         %src.addr = alloca <14 x i16>*          ; <<14 x i16>**> [#uses=2]
11         %i = alloca i32, align 4                ; <i32*> [#uses=6]
12         store <7 x i32>* %dst, <7 x i32>** %dst.addr
13         store <14 x i16>* %src, <14 x i16>** %src.addr
14         store i32 0, i32* %i
15         br label %forcond
16
17 forcond:                ; preds = %forinc, %entry
18         %tmp = load i32* %i             ; <i32> [#uses=1]
19         %cmp = icmp slt i32 %tmp, 4             ; <i1> [#uses=1]
20         br i1 %cmp, label %forbody, label %afterfor
21
22 forbody:                ; preds = %forcond
23         %tmp1 = load i32* %i            ; <i32> [#uses=1]
24         %tmp2 = load <7 x i32>** %dst.addr              ; <<2 x i32>*> [#uses=1]
25         %arrayidx = getelementptr <7 x i32>* %tmp2, i32 %tmp1           ; <<7 x i32>*> [#uses=1]
26         %tmp3 = load i32* %i            ; <i32> [#uses=1]
27         %tmp4 = load <14 x i16>** %src.addr             ; <<4 x i16>*> [#uses=1]
28         %arrayidx5 = getelementptr <14 x i16>* %tmp4, i32 %tmp3         ; <<4 x i16>*> [#uses=1]
29         %tmp6 = load <14 x i16>* %arrayidx5             ; <<4 x i16>> [#uses=1]
30         %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 >               ; <<4 x i16>> [#uses=1]
31         %conv = bitcast <14 x i16> %add to <7 x i32>            ; <<7 x i32>> [#uses=1]
32         store <7 x i32> %conv, <7 x i32>* %arrayidx
33         br label %forinc
34
35 forinc:         ; preds = %forbody
36         %tmp7 = load i32* %i            ; <i32> [#uses=1]
37         %inc = add i32 %tmp7, 1         ; <i32> [#uses=1]
38         store i32 %inc, i32* %i
39         br label %forcond
40
41 afterfor:               ; preds = %forcond
42         ret void
43 }