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-dv-2.c] - Rev 867

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

/* { dg-require-effective-target vect_int } */
 
#include <stdarg.h>
#include <signal.h>
#include "tree-vect.h"
 
#define N 64
#define MAX 42
 
extern void abort(void); 
 
int main ()
{  
  int A[N];
  int B[N];
  int C[N];
  int D[N];
 
  int i, j;
 
  check_vect ();
 
  for (i = 0; i < N; i++)
    {
      A[i] = i;
      B[i] = i;
      C[i] = i;
      D[i] = i;
    }
 
  /* Vectorizable */
  for (i = 0; i < N-20; i++)
    {
      A[i] = A[i+20];
    }
 
  /* check results:  */
  for (i = 0; i < N-20; i++)
    {
      if (A[i] != D[i+20])
	abort ();
    }
 
  /* Vectorizable */
  for (i = 0; i < 16; i++)
    {
      B[i] = B[i] + 5;
    }
 
  /* check results:  */
  for (i = 0; i < 16; i++)
    {
      if (B[i] != C[i] + 5)
	abort ();
    }
 
  /* Not vectorizable */
  for (i = 0; i < 4; i++)
    {
      C[i] = C[i+3];
    }
 
  /* check results:  */
  for (i = 0; i < 4; i++)
    {
      if (C[i] != D[i+3])
	abort ();
    }
 
  return 0;
}
 
 
 
/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
/* { dg-final { scan-tree-dump-times "accesses have the same alignment." 2 "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.