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-u8.c] - Blame information for rev 801

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

Line No. Rev Author Line
1 689 jeremybenn
/* { dg-require-effective-target vect_int } */
2
/* { dg-require-effective-target vect_shift } */
3
 
4
#include <stdarg.h>
5
#include "tree-vect.h"
6
 
7
#define N 64
8
#define C1 10
9
#define C2 5
10
 
11
__attribute__ ((noinline)) void
12
foo (unsigned char *src, unsigned int *dst1, unsigned int *dst2)
13
{
14
  int i;
15
  unsigned char b, *s = src;
16
  unsigned int *d1 = dst1, *d2 = dst2;
17
 
18
  for (i = 0; i < N; i++)
19
    {
20
      b = *s++;
21
      *d1 = b << C1;
22
      d1++;
23
      *d2 = b << C2;
24
      d2++;
25
    }
26
 
27
  s = src;
28
  d1 = dst1;
29
  d2 = dst2;
30
  for (i = 0; i < N; i++)
31
    {
32
      b = *s++;
33
      if (*d1 != b << C1 || *d2 != b << C2)
34
        abort ();
35
      d1++;
36
      d2++;
37
    }
38
}
39
 
40
int main (void)
41
{
42
  int i;
43
  unsigned char in[N];
44
  unsigned int out1[N];
45
  unsigned int out2[N];
46
 
47
  check_vect ();
48
 
49
  for (i = 0; i < N; i++)
50
    {
51
      in[i] = i;
52
      out1[i] = 255;
53
      out2[i] = 255;
54
      __asm__ volatile ("");
55
    }
56
 
57
  foo (in, out1, out2);
58
 
59
  return 0;
60
}
61
 
62
/* { dg-final { scan-tree-dump-times "vect_recog_widen_shift_pattern: detected" 2 "vect" { target vect_widen_shift } } } */
63
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
64
/* { 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.