This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[TESTCASE] New testcase for altivec
- From: Daniel Egger <degger at fhm dot edu>
- To: Aldy Hernandez <aldyh at redhat dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>,GCC Developer Mailinglist <gcc at gcc dot gnu dot org>
- Date: 17 Mar 2002 15:45:14 +0100
- Subject: [TESTCASE] New testcase for altivec
Hija,
since Aldy agreed this testcase should yield 7.0f's instead of 5.0f's
would it be okay to add the following test (which fails right
now on powerpc-linux-gnu) to the testsuite?
2002-03-17 Daniel Egger <degger@fhm.edu>
* gcc.dg/altivec-5.c: New test.
--
Servus,
Daniel
/* { dg-do run { target powerpc-*-*altivec powerpc-*-*-*altivec } } */
/* { dg-options "-maltivec" } */
/* Program to test PowerPC AltiVec multiply-add instruction. */
#include <altivec.h>
extern void abort (void);
int main ()
{
static float storage[4] __attribute__ ((aligned(16)));
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);
if (storage[0] > 7.1f || storage[0] < 6.9f)
abort ();
return 0;
}