Add a triple to switch.ll test.
[oota-llvm.git] / test / CodeGen / X86 / widen_arith-5.ll
1 ; RUN: llc < %s -march=x86-64 -mattr=+sse4.2  | FileCheck %s
2 ; CHECK: movdqa
3 ; CHECK: pslld $2
4 ; CHECK: psubd
5
6 ; widen a v3i32 to v4i32 to do a vector multiple and a subtraction
7
8 define void @update(<3 x i32>* %dst, <3 x i32>* %src, i32 %n) nounwind {
9 entry:
10         %dst.addr = alloca <3 x i32>*           ; <<3 x i32>**> [#uses=2]
11         %src.addr = alloca <3 x i32>*           ; <<3 x i32>**> [#uses=2]
12         %n.addr = alloca i32            ; <i32*> [#uses=2]
13         %v = alloca <3 x i32>, align 16         ; <<3 x i32>*> [#uses=1]
14         %i = alloca i32, align 4                ; <i32*> [#uses=6]
15         store <3 x i32>* %dst, <3 x i32>** %dst.addr
16         store <3 x i32>* %src, <3 x i32>** %src.addr
17         store i32 %n, i32* %n.addr
18         store <3 x i32> < i32 1, i32 1, i32 1 >, <3 x i32>* %v
19         store i32 0, i32* %i
20         br label %forcond
21
22 forcond:                ; preds = %forinc, %entry
23         %tmp = load i32, i32* %i                ; <i32> [#uses=1]
24         %tmp1 = load i32, i32* %n.addr          ; <i32> [#uses=1]
25         %cmp = icmp slt i32 %tmp, %tmp1         ; <i1> [#uses=1]
26         br i1 %cmp, label %forbody, label %afterfor
27
28 forbody:                ; preds = %forcond
29         %tmp2 = load i32, i32* %i               ; <i32> [#uses=1]
30         %tmp3 = load <3 x i32>*, <3 x i32>** %dst.addr          ; <<3 x i32>*> [#uses=1]
31         %arrayidx = getelementptr <3 x i32>, <3 x i32>* %tmp3, i32 %tmp2                ; <<3 x i32>*> [#uses=1]
32         %tmp4 = load i32, i32* %i               ; <i32> [#uses=1]
33         %tmp5 = load <3 x i32>*, <3 x i32>** %src.addr          ; <<3 x i32>*> [#uses=1]
34         %arrayidx6 = getelementptr <3 x i32>, <3 x i32>* %tmp5, i32 %tmp4               ; <<3 x i32>*> [#uses=1]
35         %tmp7 = load <3 x i32>, <3 x i32>* %arrayidx6           ; <<3 x i32>> [#uses=1]
36         %mul = mul <3 x i32> %tmp7, < i32 4, i32 4, i32 4 >             ; <<3 x i32>> [#uses=1]
37         %sub = sub <3 x i32> %mul, < i32 3, i32 3, i32 3 >              ; <<3 x i32>> [#uses=1]
38         store <3 x i32> %sub, <3 x i32>* %arrayidx
39         br label %forinc
40
41 forinc:         ; preds = %forbody
42         %tmp8 = load i32, i32* %i               ; <i32> [#uses=1]
43         %inc = add i32 %tmp8, 1         ; <i32> [#uses=1]
44         store i32 %inc, i32* %i
45         br label %forcond
46
47 afterfor:               ; preds = %forcond
48         ret void
49 }
50