Subversion Repositories HelenOS-historic

Compare Revisions

Regard whitespace Rev 731 → Rev 732

/uspace/trunk/softfloat/include/sftypes.h
81,8 → 81,11
#define FLOAT64_MANTISA_SIZE 52
 
#define FLOAT32_HIDDEN_BIT_MASK 0x800000
#define FLOAT64_HIDDEN_BIT_MASK 0x10000000000000l
#define FLOAT64_HIDDEN_BIT_MASK 0x10000000000000ll
 
#define FLOAT32_MAX_EXPONENT 0xFF
#define FLOAT64_MAX_EXPONENT 0x8FF
 
#define FLOAT32_BIAS 0x7F
#define FLOAT64_BIAS 0x3FF
#define FLOAT80_BIAS 0x3FFF
/uspace/trunk/softfloat/generic/add.c
47,7 → 47,7
return b;
};
if (b.parts.exp==0xFF) {
if (b.parts.exp == FLOAT32_MAX_EXPONENT) {
return b;
}
59,12 → 59,12
} else {
if (isFloat32NaN(a)) {
//TODO: fix SigNaN
if ((isFloat32SigNaN(a))||(isFloat32SigNaN(b))) {
if (isFloat32SigNaN(a) || isFloat32SigNaN(b)) {
};
return a;
};
if (a.parts.exp==0xFF) {
if (a.parts.exp == FLOAT32_MAX_EXPONENT) {
return a;
}
99,7 → 99,7
mant1 <<= 6;
mant2 <<= 6;
if (expdiff > 24) {
if (expdiff > (FLOAT32_MANTISA_SIZE + 1) ) {
goto done;
};
106,7 → 106,7
mant2>>=expdiff;
mant1+=mant2;
done:
if (mant1 & (FLOAT32_HIDDEN_BIT_MASK << 6) ) {
if (mant1 & (FLOAT32_HIDDEN_BIT_MASK << 7) ) {
++exp1;
mant1 >>= 1;
};
114,7 → 114,7
/* rounding - if first bit after mantisa is set then round up */
mant1 += (0x1 << 5);
if (mant1 & (FLOAT32_HIDDEN_BIT_MASK << 6)) {
if (mant1 & (FLOAT32_HIDDEN_BIT_MASK << 7)) {
++exp1;
mant1 >> =1;
};
145,7 → 145,7
};
/* b is infinity and a not */
if (b.parts.exp==0x8FF) {
if (b.parts.exp == FLOAT64_MAX_EXPONENT ) {
return b;
}
157,13 → 157,13
} else {
if (isFloat64NaN(a)) {
//TODO: fix SigNaN
if ((isFloat64SigNaN(a))||(isFloat64SigNaN(b))) {
if (isFloat64SigNaN(a) || isFloat64SigNaN(b)) {
};
return a;
};
/* a is infinity and b not */
if (a.parts.exp == 0x8FF) {
if (a.parts.exp == FLOAT64_MAX_EXPONENT ) {
return a;
}
200,7 → 200,7
mant1 <<= 6;
mant2 <<= 6;
if (expdiff > 53) {
if (expdiff > (FLOAT64_MANTISA_SIZE + 1) ) {
goto done;
};
207,7 → 207,7
mant2 >>= expdiff;
mant1 += mant2;
done:
if (mant1 & (FLOAT64_HIDDEN_BIT_MASK << 6) ) {
if (mant1 & (FLOAT64_HIDDEN_BIT_MASK << 7) ) {
++exp1;
mant1 >>= 1;
};
215,7 → 215,7
/* rounding - if first bit after mantisa is set then round up */
mant1 += (0x1 << 5);
if (mant1 & (FLOAT64_HIDDEN_BIT_MASK << 6)) {
if (mant1 & (FLOAT64_HIDDEN_BIT_MASK << 7)) {
++exp1;
mant1 >> =1;
};
222,7 → 222,7
a.parts.exp = exp1;
/*Clear hidden bit and shift */
a.parts.mantisa = ( (mant1 >>6 ) & (~ (FLOAT64_HIDDEN_BIT_MASK)));
a.parts.mantisa = ( (mant1 >> 6 ) & (~FLOAT64_HIDDEN_BIT_MASK));
return a;
}