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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [vect/] [vect-cond-7.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
double ad[64], bd[64], cd[64], dd[64], ed[64];
5
float af[64], bf[64], cf[64], df[64], ef[64];
6
signed char ac[64], bc[64], cc[64], dc[64], ec[64];
7
short as[64], bs[64], cs[64], ds[64], es[64];
8
int ai[64], bi[64], ci[64], di[64], ei[64];
9
long long all[64], bll[64], cll[64], dll[64], ell[64];
10
unsigned char auc[64], buc[64], cuc[64], duc[64], euc[64];
11
unsigned short aus[64], bus[64], cus[64], dus[64], eus[64];
12
unsigned int au[64], bu[64], cu[64], du[64], eu[64];
13
unsigned long long aull[64], bull[64], cull[64], dull[64], eull[64];
14
 
15
#define F(var) \
16
__attribute__((noinline, noclone)) void \
17
f##var (void) \
18
{ \
19
  int i; \
20
  for (i = 0; i < 64; i++) \
21
    { \
22
      __typeof (a##var[0]) d = d##var[i], e = e##var[i]; \
23
      a##var[i] = b##var[i] > c##var[i] ? d : e; \
24
    } \
25
}
26
 
27
#define TESTS \
28
F (d) F (f) F (c) F (s) F (i) F (ll) F (uc) F (us) F (u) F (ull)
29
 
30
TESTS
31
 
32
int
33
main ()
34
{
35
  int i;
36
 
37
  check_vect ();
38
  for (i = 0; i < 64; i++)
39
    {
40
#undef F
41
#define F(var) \
42
      b##var[i] = i + 64; \
43
      switch (i % 3) \
44
        { \
45
        case 0: c##var[i] = i + 64; break; \
46
        case 1: c##var[i] = 127 - i; break; \
47
        case 2: c##var[i] = i; break; \
48
        } \
49
      d##var[i] = i / 2; \
50
      e##var[i] = i * 2;
51
      TESTS
52
    }
53
#undef F
54
#define F(var) f##var ();
55
  TESTS
56
  for (i = 0; i < 64; i++)
57
    {
58
      asm volatile ("" : : : "memory");
59
#undef F
60
#define F(var) \
61
      if (a##var[i] != (b##var[i] > c##var[i] ? d##var[i] : e##var[i])) \
62
        abort ();
63
      TESTS
64
    }
65
  return 0;
66
}
67
 
68
/* { 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.