Convert tests using "| wc -l | grep ..." to use the count script.
[oota-llvm.git] / test / CodeGen / X86 / vec_ss_load_fold.ll
1 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse,+sse2 -o %t -f
2 ; RUN: grep minss %t | grep CPI | count 2
3 ; RUN: grep CPI   %t | not grep movss
4
5 target endian = little
6 target pointersize = 32
7 target triple = "i686-apple-darwin8.7.2"
8
9 implementation   ; Functions:
10
11 ushort %test1(float %f) {
12         %tmp = insertelement <4 x float> undef, float %f, uint 0                ; <<4 x float>> [#uses=1]
13         %tmp10 = insertelement <4 x float> %tmp, float 0.000000e+00, uint 1             ; <<4 x float>> [#uses=1]
14         %tmp11 = insertelement <4 x float> %tmp10, float 0.000000e+00, uint 2           ; <<4 x float>> [#uses=1]
15         %tmp12 = insertelement <4 x float> %tmp11, float 0.000000e+00, uint 3           ; <<4 x float>> [#uses=1]
16         %tmp28 = tail call <4 x float> %llvm.x86.sse.sub.ss( <4 x float> %tmp12, <4 x float> < float 1.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00 > )               ; <<4 x float>> [#uses=1]
17         %tmp37 = tail call <4 x float> %llvm.x86.sse.mul.ss( <4 x float> %tmp28, <4 x float> < float 5.000000e-01, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00 > )               ; <<4 x float>> [#uses=1]
18         %tmp48 = tail call <4 x float> %llvm.x86.sse.min.ss( <4 x float> %tmp37, <4 x float> < float 6.553500e+04, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00 > )               ; <<4 x float>> [#uses=1]
19         %tmp59 = tail call <4 x float> %llvm.x86.sse.max.ss( <4 x float> %tmp48, <4 x float> zeroinitializer )          ; <<4 x float>> [#uses=1]
20         %tmp = tail call int %llvm.x86.sse.cvttss2si( <4 x float> %tmp59 )              ; <int> [#uses=1]
21         %tmp69 = cast int %tmp to ushort                ; <ushort> [#uses=1]
22         ret ushort %tmp69
23 }
24
25 ushort %test2(float %f) {
26         %tmp28 = sub float %f, 1.000000e+00             ; <float> [#uses=1]
27         %tmp37 = mul float %tmp28, 5.000000e-01         ; <float> [#uses=1]
28         %tmp375 = insertelement <4 x float> undef, float %tmp37, uint 0         ; <<4 x float>> [#uses=1]
29         %tmp48 = tail call <4 x float> %llvm.x86.sse.min.ss( <4 x float> %tmp375, <4 x float> < float 6.553500e+04, float undef, float undef, float undef > )           ; <<4 x float>> [#uses=1]
30         %tmp59 = tail call <4 x float> %llvm.x86.sse.max.ss( <4 x float> %tmp48, <4 x float> < float 0.000000e+00, float undef, float undef, float undef > )            ; <<4 x float>> [#uses=1]
31         %tmp = tail call int %llvm.x86.sse.cvttss2si( <4 x float> %tmp59 )              ; <int> [#uses=1]
32         %tmp69 = cast int %tmp to ushort                ; <ushort> [#uses=1]
33         ret ushort %tmp69
34 }
35
36
37 declare <4 x float> %llvm.x86.sse.sub.ss(<4 x float>, <4 x float>)
38
39 declare <4 x float> %llvm.x86.sse.mul.ss(<4 x float>, <4 x float>)
40
41 declare <4 x float> %llvm.x86.sse.min.ss(<4 x float>, <4 x float>)
42
43 declare <4 x float> %llvm.x86.sse.max.ss(<4 x float>, <4 x float>)
44
45 declare int %llvm.x86.sse.cvttss2si(<4 x float>)
46
47