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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [vect/] [pr37539.c] - Blame information for rev 826

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* { dg-require-effective-target vect_int } */
2
 
3
#include <stdarg.h>
4
#include "tree-vect.h"
5
 
6
__attribute__ ((noinline)) void
7
ayuv2yuyv_ref (int *d, int *src, int n)
8
{
9
  char *dest = (char *)d;
10
  int i;
11
 
12
  for(i=0;i<n/2;i++){
13
    dest[i*4 + 0] = (src[i*2 + 0])>>16;
14
    dest[i*4 + 1] = (src[i*2 + 1])>>8;
15
    dest[i*4 + 2] = (src[i*2 + 0])>>16;
16
    dest[i*4 + 3] = (src[i*2 + 0])>>0;
17
  }
18
 
19
  /* Check results.  */
20
  for(i=0;i<n/2;i++){
21
   if (dest[i*4 + 0] != (src[i*2 + 0])>>16
22
       || dest[i*4 + 1] != (src[i*2 + 1])>>8
23
       || dest[i*4 + 2] != (src[i*2 + 0])>>16
24
       || dest[i*4 + 3] != (src[i*2 + 0])>>0)
25
     abort();
26
  }
27
}
28
 
29
int main ()
30
{
31
  int d[256], src[128], i;
32
 
33
  check_vect ();
34
 
35
  for (i = 0; i < 128; i++)
36
    src[i] = i;
37
 
38
  ayuv2yuyv_ref(d, src, 128);
39
 
40
  return 0;
41
}
42
 
43
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target vect_strided_wide } } } */
44
/* { dg-final { cleanup-tree-dump "vect" } } */
45
 
46
 
47
 

powered by: WebSVN 2.1.0

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