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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [vect/] [vect-over-widen-3.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 <stdlib.h>
5
#include <stdarg.h>
6
#include "tree-vect.h"
7
 
8
#define N 64
9
 
10
/* Modified rgb to rgb conversion from FFmpeg.  */
11
__attribute__ ((noinline)) void
12
foo (unsigned char *src, unsigned char *dst)
13
{
14
  unsigned char *s = src;
15
  unsigned short *d = (unsigned short *)dst;
16
  int i;
17
 
18
  for (i = 0; i < N/4; i++)
19
    {
20
      const int b = *s++;
21
      const int g = *s++;
22
      const int r = *s++;
23
      const int a = *s++;
24
      *d = ((b>>3) | ((g&0xFFC)<<3) | ((r+0xF8)>>8) | (a<<9));
25
      d++;
26
    }
27
 
28
  s = src;
29
  d = (unsigned short *)dst;
30
  for (i = 0; i < N/4; i++)
31
    {
32
      const int b = *s++;
33
      const int g = *s++;
34
      const int r = *s++;
35
      const int a = *s++;
36
      if (*d != ((b>>3) | ((g&0xFFC)<<3) | ((r+0xF8)>>8) | (a<<9)))
37
        abort ();
38
      d++;
39
    }
40
}
41
 
42
int main (void)
43
{
44
  int i;
45
  unsigned char in[N], out[N];
46
 
47
  check_vect ();
48
 
49
  for (i = 0; i < N; i++)
50
    {
51
      in[i] = i;
52
      out[i] = 255;
53
      __asm__ volatile ("");
54
    }
55
 
56
  foo (in, out);
57
 
58
  return 0;
59
}
60
 
61
/* { dg-final { scan-tree-dump "vect_recog_over_widening_pattern: detected" "vect" } } */
62
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
63
/* { dg-final { cleanup-tree-dump "vect" } } */
64
 

powered by: WebSVN 2.1.0

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