This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Another AltiVec problem


>   vector float one = (vector float) {1.0, 1.0, 1.0, 1.0};
>   vector float two = (vector float) {2.0, 2.0, 2.0, 2.0};
>   vector float three = (vector float) {3.0, 3.0, 3.0, 3.0};
>   vector float result;
>
>   result = vec_madd (three, two, one);
>   vec_st (result, 0, storage);
>
>   printf ("%f %f %f %f\n", storage[0], storage[1], storage[2],
> storage[3]);
> }
>
> given that d = vec_madd (a, b, c) is specified to yield
>
> d = {a0 * b0 + c0, a1 * b1 + c1, a2 * b2 + c2, a3 * b3 + c3}
>

the answer should be 3*2 + 1 = 7, etc etc

[7 7 7] which is the answer i get from a fresh build from
the gcc 3.1 tree.  i also tried it with the apple compiler,
and it agrees as well :).

aldy


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]