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.target/] [ia64/] [20030811-1.c] - Blame information for rev 324

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

Line No. Rev Author Line
1 319 jeremybenn
/* Origin: PR target/11693 from Andreas Schwab <schwab@suse.de> */
2
/* { dg-do compile } */
3
/* { dg-options "-O2 -frename-registers" } */
4
 
5
static inline unsigned long long
6
foo (void)
7
{
8
  unsigned long long x;
9
  __asm__ __volatile__ ("" : "=r" (x) :: "memory");
10
  return x;
11
}
12
 
13
static inline void
14
bar (unsigned long long x, unsigned long long y)
15
{
16
  __asm__ __volatile__ ("" :: "r"(x), "r"(y) : "memory");
17
}
18
 
19
static inline void
20
baz (unsigned long long x, unsigned long long y, unsigned long long z,
21
     unsigned long long p, unsigned long long q)
22
{
23
  __asm__ __volatile__ ("" :: "r" (q << 2) : "memory");
24
  __asm__ __volatile__ ("" :: "r" (z) : "memory");
25
  if (x & 0x1)
26
    __asm__ __volatile__ ("" :: "r" (y), "r" (p) : "memory");
27
  if (x & 0x2)
28
    __asm__ __volatile__ ("" :: "r" (y), "r" (p) : "memory");
29
}
30
 
31
static inline unsigned long long
32
ffz (unsigned long long x)
33
{
34
  unsigned long long r;
35
  __asm__ ("" : "=r" (r) : "r" (x & (~x - 1)));
36
  return r;
37
}
38
 
39
void die (const char *, ...) __attribute__ ((noreturn));
40
 
41
void
42
test (void *x)
43
{
44
  unsigned long long a, c;
45
 
46
  a = foo ();
47
  bar (0xc000000000000000LL, 0x660);
48
  bar (0xa00000000000c000LL, 0x539);
49
  baz (2, 1, 0xa000000000008000LL,
50
       ({ unsigned long long b;
51
          b = ({ unsigned long long d; __asm__ ("" : "=r" (d) : "r" (x)); d; })
52
              + 0x10000000000661LL;
53
          b;
54
        }),
55
       14);
56
  c = ffz (0x1fffffffffffffffLL);
57
  if (c < 51 || c > 61)
58
    die ("die", c - 1);
59
}

powered by: WebSVN 2.1.0

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