URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 693 |
Rev 783 |
/* { dg-do compile } */
|
/* { dg-do compile } */
|
|
|
#include
|
#include
|
#include
|
#include
|
|
|
inline int
|
inline int
|
bci (const float &source)
|
bci (const float &source)
|
{
|
{
|
int dest;
|
int dest;
|
memcpy (&dest, &source, sizeof (dest));
|
memcpy (&dest, &source, sizeof (dest));
|
return dest;
|
return dest;
|
}
|
}
|
|
|
inline float
|
inline float
|
bcf (const int &source)
|
bcf (const int &source)
|
{
|
{
|
float dest;
|
float dest;
|
memcpy (&dest, &source, sizeof (dest));
|
memcpy (&dest, &source, sizeof (dest));
|
return dest;
|
return dest;
|
}
|
}
|
|
|
float
|
float
|
Foo ()
|
Foo ()
|
{
|
{
|
const int foo = bci (0.0f);
|
const int foo = bci (0.0f);
|
int bar = foo;
|
int bar = foo;
|
const int baz = foo & 1;
|
const int baz = foo & 1;
|
if (!baz && (foo & 2))
|
if (!baz && (foo & 2))
|
bar = 0;
|
bar = 0;
|
return bcf (bar);
|
return bcf (bar);
|
}
|
}
|
|
|
int
|
int
|
main ()
|
main ()
|
{
|
{
|
printf ("Foo() = %f\n", Foo());
|
printf ("Foo() = %f\n", Foo());
|
return 0;
|
return 0;
|
}
|
}
|
|
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.