URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 297 |
Rev 384 |
static const double internalEndianMagic = 7.949928895127363e-275;
|
static const double internalEndianMagic = 7.949928895127363e-275;
|
static const unsigned char ieee_754_mantissa_mask[] = { 0x00, 0x0F, 0xFF, 0xFF,
|
static const unsigned char ieee_754_mantissa_mask[] = { 0x00, 0x0F, 0xFF, 0xFF,
|
0xFF, 0xFF, 0xFF, 0xFF };
|
0xFF, 0xFF, 0xFF, 0xFF };
|
static inline int
|
static inline int
|
trio_isnan (double number)
|
trio_isnan (double number)
|
{
|
{
|
int has_mantissa = 0;
|
int has_mantissa = 0;
|
unsigned int i;
|
unsigned int i;
|
unsigned char current;
|
unsigned char current;
|
for (i = 0; i < (unsigned int)sizeof(double); i++)
|
for (i = 0; i < (unsigned int)sizeof(double); i++)
|
{
|
{
|
current = ((unsigned char *)&number)[(((unsigned char
|
current = ((unsigned char *)&number)[(((unsigned char
|
*)&internalEndianMagic)[7-(i)])];
|
*)&internalEndianMagic)[7-(i)])];
|
has_mantissa |= (current & ieee_754_mantissa_mask[i]);
|
has_mantissa |= (current & ieee_754_mantissa_mask[i]);
|
}
|
}
|
return has_mantissa;
|
return has_mantissa;
|
}
|
}
|
void
|
void
|
xmlXPathEqualNodeSetFloat(int nodeNr, double v)
|
xmlXPathEqualNodeSetFloat(int nodeNr, double v)
|
{
|
{
|
int i;
|
int i;
|
for (i=0; i<nodeNr; i++)
|
for (i=0; i<nodeNr; i++)
|
if (!trio_isnan(v))
|
if (!trio_isnan(v))
|
break;
|
break;
|
}
|
}
|
|
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.