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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [vect/] [vect-shift-3.c] - Blame information for rev 689

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 689 jeremybenn
/* { dg-require-effective-target vect_shift } */
2
/* { dg-require-effective-target vect_int } */
3
 
4
#include "tree-vect.h"
5
 
6
#define N 32
7
 
8
unsigned short dst[N] __attribute__((aligned(N)));
9
unsigned short src[N] __attribute__((aligned(N)));
10
 
11
__attribute__ ((noinline))
12
void array_shift(void)
13
{
14
  int i;
15
  for (i = 0; i < N; i++)
16
    dst[i] = src[i] >> 3;
17
}
18
 
19
int main()
20
{
21
  volatile int i;
22
  check_vect ();
23
 
24
  for (i = 0; i < N; i++)
25
    src[i] = i << 3;
26
 
27
  array_shift ();
28
 
29
  for (i = 0; i < N; i++)
30
    if (dst[i] != i)
31
      abort ();
32
 
33
  return 0;
34
}
35
 
36
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
37
/* { dg-final { cleanup-tree-dump "vect" } } */

powered by: WebSVN 2.1.0

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