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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.target/] [i386/] [avx-reduc-1.c] - Blame information for rev 848

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 691 jeremybenn
/* { dg-do run } */
2
/* { dg-options "-O3 -mavx" } */
3
/* { dg-require-effective-target avx_runtime } */
4
 
5
extern void abort (void);
6
double ad[1024];
7
float af[1024];
8
short as[1024];
9
int ai[1024];
10
long long all[1024];
11
unsigned short aus[1024];
12
unsigned int au[1024];
13
unsigned long long aull[1024];
14
 
15
#define F(var) \
16
__attribute__((noinline, noclone)) __typeof (var[0]) \
17
f##var (void) \
18
{ \
19
  int i; \
20
  __typeof (var[0]) r = 0; \
21
  for (i = 0; i < 1024; i++) \
22
    r = r > var[i] ? r : var[i]; \
23
  return r; \
24
}
25
 
26
#define TESTS \
27
F (ad) F (af) F (as) F (ai) F (all) F (aus) F (au) F (aull)
28
 
29
TESTS
30
 
31
int
32
main ()
33
{
34
  int i;
35
  for (i = 0; i < 1024; i++)
36
    {
37
#undef F
38
#define F(var) var[i] = i;
39
      TESTS
40
    }
41
  for (i = 1023; i < 32 * 1024; i += 1024 + 271)
42
    {
43
#undef F
44
#define F(var) var[i & 1023] = i; if (f##var () != i) abort ();
45
      TESTS
46
    }
47
  return 0;
48
}

powered by: WebSVN 2.1.0

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