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

powered by: WebSVN 2.1.0

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