URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 318 |
Rev 338 |
/* { dg-do run } */
|
/* { dg-do run } */
|
/* { dg-options "-O2" } */
|
/* { dg-options "-O2" } */
|
|
|
extern void abort (void);
|
extern void abort (void);
|
extern void exit (int);
|
extern void exit (int);
|
|
|
static inline __attribute__((always_inline))
|
static inline __attribute__((always_inline))
|
void
|
void
|
prefetch (void *x)
|
prefetch (void *x)
|
{
|
{
|
asm volatile("prefetcht0 %0" : : "m" (*(unsigned long *)x));
|
asm volatile("prefetcht0 %0" : : "m" (*(unsigned long *)x));
|
}
|
}
|
|
|
struct hlist_head
|
struct hlist_head
|
{
|
{
|
struct hlist_node *first;
|
struct hlist_node *first;
|
};
|
};
|
|
|
struct hlist_node
|
struct hlist_node
|
{
|
{
|
struct hlist_node *next;
|
struct hlist_node *next;
|
unsigned long i_ino;
|
unsigned long i_ino;
|
};
|
};
|
|
|
struct hlist_node * find_inode_fast(struct hlist_head *head, unsigned long ino)
|
struct hlist_node * find_inode_fast(struct hlist_head *head, unsigned long ino)
|
{
|
{
|
struct hlist_node *node;
|
struct hlist_node *node;
|
|
|
for (node = head->first;
|
for (node = head->first;
|
node && (prefetch (node->next), 1);
|
node && (prefetch (node->next), 1);
|
node = node->next)
|
node = node->next)
|
{
|
{
|
if (node->i_ino == ino)
|
if (node->i_ino == ino)
|
break;
|
break;
|
}
|
}
|
return node ? node : 0;
|
return node ? node : 0;
|
}
|
}
|
|
|
struct hlist_node g2;
|
struct hlist_node g2;
|
struct hlist_node g1 = { &g2 };
|
struct hlist_node g1 = { &g2 };
|
struct hlist_head h = { &g1 };
|
struct hlist_head h = { &g1 };
|
|
|
int
|
int
|
main()
|
main()
|
{
|
{
|
if (find_inode_fast (&h, 1) != 0)
|
if (find_inode_fast (&h, 1) != 0)
|
abort ();
|
abort ();
|
exit (0);
|
exit (0);
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.