OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [vect/] [vect-22.c] - Rev 149

Go to most recent revision | Compare with Previous | Blame | View Log

/* { dg-require-effective-target vect_int } */
/* { dg-require-effective-target vect_float } */
 
#include <stdarg.h>
#include "tree-vect.h"
 
#define N 64
 
int
main1 ()
{
  int i;
  int ia[N];
  int ib[N]= 
    {1,1,0,0,1,0,1,0,
     1,1,0,0,1,0,1,0,
     1,1,0,0,1,0,1,0,
     1,1,0,0,1,0,1,0,
     1,1,0,0,1,0,1,0,
     1,1,0,0,1,0,1,0,
     1,1,0,0,1,0,1,0,
     1,1,0,0,1,0,1,0};
 
  signed char ca[N];
  signed char cb[N] =
    {1,1,0,0,1,0,1,0,
     1,1,0,0,1,0,1,0,
     1,1,0,0,1,0,1,0,
     1,1,0,0,1,0,1,0,
     1,1,0,0,1,0,1,0,
     1,1,0,0,1,0,1,0,
     1,1,0,0,1,0,1,0,
     1,1,0,0,1,0,1,0};
 
  short sa[N];
  short sb[N] =
    {1,1,0,0,1,0,1,0,
     1,1,0,0,1,0,1,0,
     1,1,0,0,1,0,1,0,
     1,1,0,0,1,0,1,0,
     1,1,0,0,1,0,1,0,
     1,1,0,0,1,0,1,0,
     1,1,0,0,1,0,1,0,
     1,1,0,0,1,0,1,0};
 
  float fa[N];
  float fb[N] =
    {1,1,0,0,1,0,1,0,
     1,1,0,0,1,0,1,0,
     1,1,0,0,1,0,1,0,
     1,1,0,0,1,0,1,0,
     1,1,0,0,1,0,1,0,
     1,1,0,0,1,0,1,0,
     1,1,0,0,1,0,1,0,
     1,1,0,0,1,0,1,0};
 
  /* Check ints.  */
 
  for (i = 0; i < N; i++)
    {
      ia[i] = -ib[i];
    }
 
  /* check results:  */
  for (i = 0; i <N; i++)
    {
      if (ia[i] != -ib[i])
        abort ();
    }
 
  /* Check chars.  */
 
  for (i = 0; i < N; i++)
    {
      ca[i] = -cb[i];
    }
 
  /* check results:  */
  for (i = 0; i <N; i++)
    {
      if (ca[i] != -cb[i])
        abort ();
    }
 
  /* Check shorts.  */
 
  for (i = 0; i < N; i++)
    {
      sa[i] = -sb[i];
    }
 
  /* check results:  */
  for (i = 0; i <N; i++)
    {
      if (sa[i] != -sb[i])
        abort ();
    }
 
  /* Check floats.  */
 
  for (i = 0; i < N; i++)
    {
      fa[i] = -fb[i];
    }
 
  /* check results:  */
  for (i = 0; i <N; i++)
    {
      if (fa[i] != -fb[i])
        abort ();
    }
 
  return 0;
}
 
int main (void)
{
  check_vect ();
 
  return main1 ();
}
 
/* { dg-final { scan-tree-dump-times "vectorized 4 loops" 1 "vect" } } */
/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
 
/* { dg-final { cleanup-tree-dump "vect" } } */
 

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.