URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Go to most recent revision |
Only display areas with differences |
Details |
Blame |
View Log
Rev 318 |
Rev 338 |
/* { dg-do compile } */
|
/* { dg-do compile } */
|
/* { dg-require-effective-target ilp32 } */
|
/* { dg-require-effective-target ilp32 } */
|
/* { dg-options "-O2 -march=k6" } */
|
/* { dg-options "-O2 -march=k6" } */
|
|
|
static inline void *
|
static inline void *
|
baz (void *s, unsigned long c, unsigned int count)
|
baz (void *s, unsigned long c, unsigned int count)
|
{
|
{
|
int d0, d1;
|
int d0, d1;
|
__asm__ __volatile__ (""
|
__asm__ __volatile__ (""
|
: "=&c" (d0), "=&D" (d1)
|
: "=&c" (d0), "=&D" (d1)
|
:"a" (c), "q" (count), "0" (count / 4), "1" ((long) s)
|
:"a" (c), "q" (count), "0" (count / 4), "1" ((long) s)
|
:"memory");
|
:"memory");
|
return s;
|
return s;
|
}
|
}
|
|
|
struct A
|
struct A
|
{
|
{
|
unsigned long *a;
|
unsigned long *a;
|
};
|
};
|
|
|
inline static void *
|
inline static void *
|
bar (struct A *x, int y)
|
bar (struct A *x, int y)
|
{
|
{
|
char *ptr;
|
char *ptr;
|
|
|
ptr = (void *) x->a[y >> 12];
|
ptr = (void *) x->a[y >> 12];
|
ptr += y % (1UL << 12);
|
ptr += y % (1UL << 12);
|
return (void *) ptr;
|
return (void *) ptr;
|
}
|
}
|
|
|
int
|
int
|
foo (struct A *x, unsigned int *y, int z, int u)
|
foo (struct A *x, unsigned int *y, int z, int u)
|
{
|
{
|
int a, b, c, d, e;
|
int a, b, c, d, e;
|
|
|
z += *y;
|
z += *y;
|
c = z + u;
|
c = z + u;
|
a = (z >> 12) + 1;
|
a = (z >> 12) + 1;
|
do
|
do
|
{
|
{
|
b = (a << 12);
|
b = (a << 12);
|
d = b - z;
|
d = b - z;
|
e = c - z;
|
e = c - z;
|
if (e < d)
|
if (e < d)
|
d = e;
|
d = e;
|
baz (bar (x, z), 0, d);
|
baz (bar (x, z), 0, d);
|
z = b;
|
z = b;
|
a++;
|
a++;
|
}
|
}
|
while (z < c);
|
while (z < c);
|
return 0;
|
return 0;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.