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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [vect/] [vect-strided-u8-i2.c] - Blame information for rev 298

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
#define N 64
7
 
8
typedef struct {
9
   unsigned char a;
10
   unsigned char b;
11
} s;
12
 
13
__attribute__ ((noinline)) int
14
main1 (s *arr)
15
{
16
  s *ptr = arr;
17
  s res[N];
18
  int i;
19
 
20
  for (i = 0; i < N; i++)
21
    {
22
      res[i].a = ptr->b - ptr->a;
23
      res[i].b = ptr->b + ptr->a;
24
      ptr++;
25
    }
26
  /* check results:  */
27
  for (i = 0; i < N; i++)
28
    {
29
      if (res[i].a != arr[i].b - arr[i].a
30
          || res[i].b != arr[i].a + arr[i].b)
31
        abort ();
32
    }
33
 
34
  return 0;
35
}
36
 
37
int main (void)
38
{
39
  int i;
40
  s arr[N];
41
 
42
  check_vect ();
43
 
44
  for (i = 0; i < N; i++)
45
    {
46
      arr[i].a = i;
47
      arr[i].b = i * 2;
48
      if (arr[i].a == 178)
49
         abort();
50
    }
51
 
52
  main1 (arr);
53
 
54
  return 0;
55
}
56
 
57
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect"  { target { vect_interleave && vect_extract_even_odd } } } } */
58
/* { dg-final { cleanup-tree-dump "vect" } } */
59
 

powered by: WebSVN 2.1.0

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