1 ; Test that vectors are scalarized/lowered correctly.
2 ; RUN: llvm-as < %s | llc &&
3 ; RUN: llvm-as < %s | llc -march=ppc32 -mcpu=g5 &&
4 ; RUN: llvm-as < %s | llc -march=ppc32 -mcpu=g3
13 ;;; TEST HANDLING OF VARIOUS VECTOR SIZES
15 void %test_f1(%f1 *%P, %f1* %Q, %f1 *%S) {
23 void %test_f2(%f2 *%P, %f2* %Q, %f2 *%S) {
31 void %test_f4(%f4 *%P, %f4* %Q, %f4 *%S) {
39 void %test_f8(%f8 *%P, %f8* %Q, %f8 *%S) {
47 ;;; TEST VECTOR CONSTRUCTS
49 void %test_cst(%f4 *%P, %f4 *%S) {
51 %R = add %f4 %p, <float 0.1, float 1.0, float 2.0, float 4.5>
56 void %test_zero(%f4 *%P, %f4 *%S) {
58 %R = add %f4 %p, zeroinitializer
63 void %test_undef(%f4 *%P, %f4 *%S) {
65 %R = add %f4 %p, undef
70 void %test_constant_insert(%f4 *%S) {
71 %R = insertelement %f4 zeroinitializer, float 10.0, uint 0
76 void %test_variable_buildvector(float %F, %f4 *%S) {
77 %R = insertelement %f4 zeroinitializer, float %F, uint 0
82 void %test_scalar_to_vector(float %F, %f4 *%S) {
83 %R = insertelement %f4 undef, float %F, uint 0 ;; R = scalar_to_vector F
88 ;;; TEST IMPORTANT IDIOMS
90 void %splat(%f4* %P, %f4* %Q, float %X) {
91 %tmp = insertelement %f4 undef, float %X, uint 0
92 %tmp2 = insertelement %f4 %tmp, float %X, uint 1
93 %tmp4 = insertelement %f4 %tmp2, float %X, uint 2
94 %tmp6 = insertelement %f4 %tmp4, float %X, uint 3
96 %R = add %f4 %q, %tmp6