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-u16.c] - Rev 749

Go to most recent revision | 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 7
 
__attribute__ ((noinline)) void
foo (unsigned short *src, unsigned int *dst)
{
  int i;
  unsigned short b, *s = src;
  unsigned 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;
  unsigned short in[N];
  unsigned 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" } } */
 
 

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.