Use the llvm-upgrade program to upgrade llvm assembly.
[oota-llvm.git] / test / CodeGen / X86 / vec_extract.ll
1 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep movss    | wc -l | grep 3 &&
2 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep movhlps  | wc -l | grep 1 &&
3 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep pshufd   | wc -l | grep 1 &&
4 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep unpckhpd | wc -l | grep 1
5
6 void %test1(<4 x float>* %F, float* %f) {
7         %tmp = load <4 x float>* %F
8         %tmp7 = add <4 x float> %tmp, %tmp
9         %tmp2 = extractelement <4 x float> %tmp7, uint 0
10         store float %tmp2, float* %f
11         ret void
12 }
13
14 float %test2(<4 x float>* %F, float* %f) {
15         %tmp = load <4 x float>* %F
16         %tmp7 = add <4 x float> %tmp, %tmp
17         %tmp2 = extractelement <4 x float> %tmp7, uint 2
18         ret float %tmp2
19 }
20
21 void %test3(float* %R, <4 x float>* %P1) {
22         %X = load <4 x float>* %P1
23         %tmp = extractelement <4 x float> %X, uint 3
24         store float %tmp, float* %R
25         ret void
26 }
27
28 double %test4(double %A) {
29         %tmp1 = call <2 x double> %foo()
30         %tmp2 = extractelement <2 x double> %tmp1, uint 1
31         %tmp3 = add double %tmp2, %A
32         ret double %tmp3
33 }
34
35 declare <2 x double> %foo()