blob: 59ca5666a4baa7ef82d2d99f165029389757d9bd [file] [log] [blame]
Evan Cheng22591412006-04-21 04:58:23 +00001; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep movss | wc -l | grep 3 &&
Evan Chengcb309062006-05-31 00:48:09 +00002; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep movhlps | wc -l | grep 1 &&
Evan Cheng8d51a322006-10-27 21:05:18 +00003; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep pshufd | wc -l | grep 1 &&
4; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep unpckhpd | wc -l | grep 1
Evan Chengcb095c12006-04-20 17:59:30 +00005
6void %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
14float %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
Evan Cheng8d51a322006-10-27 21:05:18 +000021void %test3(float* %R, <4 x float>* %P1) {
Evan Chengcb095c12006-04-20 17:59:30 +000022 %X = load <4 x float>* %P1
Evan Chengcb309062006-05-31 00:48:09 +000023 %tmp = extractelement <4 x float> %X, uint 3
Evan Chengcb095c12006-04-20 17:59:30 +000024 store float %tmp, float* %R
25 ret void
26}
Evan Cheng8d51a322006-10-27 21:05:18 +000027
28double %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
35declare <2 x double> %foo()