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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [vect/] [vect-widen-shift-s8.c] - Rev 689

Compare with Previous | Blame | View Log

/* { dg-require-effective-target vect_int } */
/* { dg-require-effective-target vect_shift } */
 
#include <stdarg.h>
#include "tree-vect.h"
 
#define N 64
#define C 12
 
__attribute__ ((noinline)) void
foo (char *src, int *dst)
{
  int i;
  char b, *s = src;
  int *d = dst;
 
  for (i = 0; i < N; i++)
    {
      b = *s++;
      *d = b << C;
      d++;
    }
 
  s = src;
  d = dst;
  for (i = 0; i < N; i++)
    {
      b = *s++;
      if (*d != b << C)
        abort ();
      d++;
    }
}
 
int main (void)
{
  int i;
  char in[N];
  int out[N];
 
  check_vect ();
 
  for (i = 0; i < N; i++)
    {
      in[i] = i;
      out[i] = 255;
      __asm__ volatile ("");
    }
 
  foo (in, out);
 
  return 0;
}
 
/* { dg-final { scan-tree-dump-times "vect_recog_widen_shift_pattern: detected" 1 "vect" { target vect_widen_shift } } } */
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
 
 

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.