This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Another AltiVec problem
- From: Aldy Hernandez <aldyh at redhat dot com>
- To: Daniel Egger <degger at fhm dot edu>
- Cc: GCC Developer Mailinglist <gcc at gcc dot gnu dot org>
- Date: Thu, 14 Mar 2002 15:49:44 +1100
- Subject: 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