blob: 2d3e87ea46199ae0bf153b2959369f03dea4ddf0 [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 -o %t -f
2; RUN: grep movss %t | wc -l | grep 3
3; RUN: grep movhlps %t | wc -l | grep 1
4; RUN: grep pshufd %t | wc -l | grep 1
5; RUN: grep unpckhpd %t | wc -l | grep 1
6
7void %test1(<4 x float>* %F, float* %f) {
8 %tmp = load <4 x float>* %F
9 %tmp7 = add <4 x float> %tmp, %tmp
10 %tmp2 = extractelement <4 x float> %tmp7, uint 0
11 store float %tmp2, float* %f
12 ret void
13}
14
15float %test2(<4 x float>* %F, float* %f) {
16 %tmp = load <4 x float>* %F
17 %tmp7 = add <4 x float> %tmp, %tmp
18 %tmp2 = extractelement <4 x float> %tmp7, uint 2
19 ret float %tmp2
20}
21
22void %test3(float* %R, <4 x float>* %P1) {
23 %X = load <4 x float>* %P1
24 %tmp = extractelement <4 x float> %X, uint 3
25 store float %tmp, float* %R
26 ret void
27}
28
29double %test4(double %A) {
30 %tmp1 = call <2 x double> %foo()
31 %tmp2 = extractelement <2 x double> %tmp1, uint 1
32 %tmp3 = add double %tmp2, %A
33 ret double %tmp3
34}
35
36declare <2 x double> %foo()