URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 297 |
Rev 338 |
union U
|
union U
|
{
|
{
|
__complex__ int ci;
|
__complex__ int ci;
|
__complex__ float cf;
|
__complex__ float cf;
|
};
|
};
|
|
|
float gd;
|
float gd;
|
extern float bar (union U);
|
extern float bar (union U);
|
|
|
float foo (int b, double f1, double f2, int c1, int c2)
|
float foo (int b, double f1, double f2, int c1, int c2)
|
{
|
{
|
union U u;
|
union U u;
|
double r;
|
double r;
|
|
|
if (b)
|
if (b)
|
{
|
{
|
__real__ u.cf = f1;
|
__real__ u.cf = f1;
|
__imag__ u.cf = f2;
|
__imag__ u.cf = f2;
|
}
|
}
|
else
|
else
|
{
|
{
|
__real__ u.ci = c1;
|
__real__ u.ci = c1;
|
__imag__ u.ci = c2;
|
__imag__ u.ci = c2;
|
}
|
}
|
|
|
r = bar (u);
|
r = bar (u);
|
return r;
|
return r;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.