This is the mail archive of the gcc-patches@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]

[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;
}

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