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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [vect/] [vect-sdivmod-1.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
#include "tree-vect.h"
2
 
3
extern void abort (void);
4
int a[4096];
5
 
6
__attribute__((noinline, noclone)) void
7
f1 (int x)
8
{
9
  int i, j;
10
  for (i = 1; i <= x; i++)
11
    {
12
      j = a[i] >> 8;
13
      j = 1 + (j / 2);
14
      a[i] = j << 8;
15
    }
16
}
17
 
18
__attribute__((noinline, noclone)) void
19
f2 (int x)
20
{
21
  int i, j;
22
  for (i = 1; i <= x; i++)
23
    {
24
      j = a[i] >> 8;
25
      j = 1 + (j / 16);
26
      a[i] = j << 8;
27
    }
28
}
29
 
30
__attribute__((noinline, noclone)) void
31
f3 (int x)
32
{
33
  int i, j;
34
  for (i = 1; i <= x; i++)
35
    {
36
      j = a[i] >> 8;
37
      j = 1 + (j % 2);
38
      a[i] = j << 8;
39
    }
40
}
41
 
42
__attribute__((noinline, noclone)) void
43
f4 (int x)
44
{
45
  int i, j;
46
  for (i = 1; i <= x; i++)
47
    {
48
      j = a[i] >> 8;
49
      j = 1 + (j % 16);
50
      a[i] = j << 8;
51
    }
52
}
53
 
54
int
55
main ()
56
{
57
  int i;
58
  check_vect ();
59
  for (i = 0; i < 4096; i++)
60
    {
61
      asm ("");
62
      a[i] = (i - 2048) << 8;
63
    }
64
  f1 (4095);
65
  if (a[0] != (-2048 << 8))
66
    abort ();
67
  for (i = 1; i < 4096; i++)
68
    if (a[i] != ((1 + ((i - 2048) / 2)) << 8))
69
      abort ();
70
    else
71
      a[i] = (i - 2048) << 8;
72
  f2 (4095);
73
  if (a[0] != (-2048 << 8))
74
    abort ();
75
  for (i = 1; i < 4096; i++)
76
    if (a[i] != ((1 + ((i - 2048) / 16)) << 8))
77
      abort ();
78
    else
79
      a[i] = (i - 2048) << 8;
80
  f3 (4095);
81
  if (a[0] != (-2048 << 8))
82
    abort ();
83
  for (i = 1; i < 4096; i++)
84
    if (a[i] != ((1 + ((i - 2048) % 2)) << 8))
85
      abort ();
86
    else
87
      a[i] = (i - 2048) << 8;
88
  f4 (4095);
89
  if (a[0] != (-2048 << 8))
90
    abort ();
91
  for (i = 1; i < 4096; i++)
92
    if (a[i] != ((1 + ((i - 2048) % 16)) << 8))
93
      abort ();
94
  return 0;
95
}
96
 
97
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 4 "vect" { target vect_condition } } } */
98
/* { 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.