Index: uspace/lib/softfloat/generic/div.c
===================================================================
--- uspace/lib/softfloat/generic/div.c	(revision c67aff2b73c9636ea0c229cdbf3bfc48af966545)
+++ uspace/lib/softfloat/generic/div.c	(revision 90924df6f05e59a15f5187cb8b525c6bb8351392)
@@ -41,12 +41,13 @@
 #include <common.h>
 
-/**
- * Divide two single-precision floats.
- * 
+/** Divide two single-precision floats.
+ *
  * @param a Nominator.
  * @param b Denominator.
+ *
  * @return Result of division.
- */
-float32 divFloat32(float32 a, float32 b) 
+ *
+ */
+float32 div_float32(float32 a, float32 b)
 {
 	float32 result;
@@ -56,24 +57,24 @@
 	result.parts.sign = a.parts.sign ^ b.parts.sign;
 	
-	if (isFloat32NaN(a)) {
-		if (isFloat32SigNaN(a)) {
-			/*FIXME: SigNaN*/
-		}
-		/*NaN*/
+	if (is_float32_nan(a)) {
+		if (is_float32_signan(a)) {
+			// FIXME: SigNaN
+		}
+		/* NaN */
 		return a;
 	}
 	
-	if (isFloat32NaN(b)) {
-		if (isFloat32SigNaN(b)) {
-			/*FIXME: SigNaN*/
-		}
-		/*NaN*/
+	if (is_float32_nan(b)) {
+		if (is_float32_signan(b)) {
+			// FIXME: SigNaN
+		}
+		/* NaN */
 		return b;
 	}
 	
-	if (isFloat32Infinity(a)) {
-		if (isFloat32Infinity(b)) {
+	if (is_float32_infinity(a)) {
+		if (is_float32_infinity(b)) {
 			/*FIXME: inf / inf */
-			result.binary = FLOAT32_NAN;
+			result.bin = FLOAT32_NAN;
 			return result;
 		}
@@ -83,7 +84,7 @@
 		return result;
 	}
-
-	if (isFloat32Infinity(b)) {
-		if (isFloat32Zero(a)) {
+	
+	if (is_float32_infinity(b)) {
+		if (is_float32_zero(a)) {
 			/* FIXME 0 / inf */
 			result.parts.exp = 0;
@@ -97,8 +98,8 @@
 	}
 	
-	if (isFloat32Zero(b)) {
-		if (isFloat32Zero(a)) {
+	if (is_float32_zero(b)) {
+		if (is_float32_zero(a)) {
 			/*FIXME: 0 / 0*/
-			result.binary = FLOAT32_NAN;
+			result.bin = FLOAT32_NAN;
 			return result;
 		}
@@ -121,8 +122,8 @@
 			return result;
 		}
-
+		
 		/* normalize it*/
 		afrac <<= 1;
-		/* afrac is nonzero => it must stop */	
+		/* afrac is nonzero => it must stop */
 		while (!(afrac & FLOAT32_HIDDEN_BIT_MASK)) {
 			afrac <<= 1;
@@ -130,8 +131,8 @@
 		}
 	}
-
+	
 	if (bexp == 0) {
 		bfrac <<= 1;
-		/* bfrac is nonzero => it must stop */	
+		/* bfrac is nonzero => it must stop */
 		while (!(bfrac & FLOAT32_HIDDEN_BIT_MASK)) {
 			bfrac <<= 1;
@@ -139,8 +140,8 @@
 		}
 	}
-
-	afrac =	(afrac | FLOAT32_HIDDEN_BIT_MASK) << (32 - FLOAT32_FRACTION_SIZE - 1);
-	bfrac =	(bfrac | FLOAT32_HIDDEN_BIT_MASK) << (32 - FLOAT32_FRACTION_SIZE);
-
+	
+	afrac = (afrac | FLOAT32_HIDDEN_BIT_MASK) << (32 - FLOAT32_FRACTION_SIZE - 1);
+	bfrac = (bfrac | FLOAT32_HIDDEN_BIT_MASK) << (32 - FLOAT32_FRACTION_SIZE);
+	
 	if (bfrac <= (afrac << 1)) {
 		afrac >>= 1;
@@ -169,6 +170,6 @@
 		++cexp;
 		cfrac >>= 1;
-	}	
-
+	}
+	
 	/* check overflow */
 	if (cexp >= FLOAT32_MAX_EXPONENT) {
@@ -178,5 +179,5 @@
 		return result;
 	}
-
+	
 	if (cexp < 0) {
 		/* FIXME: underflow */
@@ -190,5 +191,5 @@
 			cexp++;
 			cfrac >>= 1;
-		}	
+		}
 	} else {
 		result.parts.exp = (uint32_t) cexp;
@@ -197,15 +198,16 @@
 	result.parts.fraction = ((cfrac >> 6) & (~FLOAT32_HIDDEN_BIT_MASK)); 
 	
-	return result;	
+	return result;
 }
 
-/**
- * Divide two double-precision floats.
+/** Divide two double-precision floats.
  *
  * @param a Nominator.
  * @param b Denominator.
+ *
  * @return Result of division.
- */
-float64 divFloat64(float64 a, float64 b) 
+ *
+ */
+float64 div_float64(float64 a, float64 b) 
 {
 	float64 result;
@@ -217,29 +219,29 @@
 	result.parts.sign = a.parts.sign ^ b.parts.sign;
 	
-	if (isFloat64NaN(a)) {
-		if (isFloat64SigNaN(b)) {
-			/*FIXME: SigNaN*/
+	if (is_float64_nan(a)) {
+		if (is_float64_signan(b)) {
+			// FIXME: SigNaN
 			return b;
 		}
 		
-		if (isFloat64SigNaN(a)) {
-			/*FIXME: SigNaN*/
-		}
-		/*NaN*/
+		if (is_float64_signan(a)) {
+			// FIXME: SigNaN
+		}
+		/* NaN */
 		return a;
 	}
 	
-	if (isFloat64NaN(b)) {
-		if (isFloat64SigNaN(b)) {
-			/*FIXME: SigNaN*/
-		}
-		/*NaN*/
+	if (is_float64_nan(b)) {
+		if (is_float64_signan(b)) {
+			// FIXME: SigNaN
+		}
+		/* NaN */
 		return b;
 	}
 	
-	if (isFloat64Infinity(a)) {
-		if (isFloat64Infinity(b) || isFloat64Zero(b)) {
-			/*FIXME: inf / inf */
-			result.binary = FLOAT64_NAN;
+	if (is_float64_infinity(a)) {
+		if (is_float64_infinity(b) || is_float64_zero(b)) {
+			// FIXME: inf / inf
+			result.bin = FLOAT64_NAN;
 			return result;
 		}
@@ -249,7 +251,7 @@
 		return result;
 	}
-
-	if (isFloat64Infinity(b)) {
-		if (isFloat64Zero(a)) {
+	
+	if (is_float64_infinity(b)) {
+		if (is_float64_zero(a)) {
 			/* FIXME 0 / inf */
 			result.parts.exp = 0;
@@ -263,8 +265,8 @@
 	}
 	
-	if (isFloat64Zero(b)) {
-		if (isFloat64Zero(a)) {
+	if (is_float64_zero(b)) {
+		if (is_float64_zero(a)) {
 			/*FIXME: 0 / 0*/
-			result.binary = FLOAT64_NAN;
+			result.bin = FLOAT64_NAN;
 			return result;
 		}
@@ -274,5 +276,5 @@
 		return result;
 	}
-
+	
 	afrac = a.parts.fraction;
 	aexp = a.parts.exp;
@@ -287,5 +289,5 @@
 			return result;
 		}
-
+		
 		/* normalize it*/
 		aexp++;
@@ -296,5 +298,5 @@
 		}
 	}
-
+	
 	if (bexp == 0) {
 		bexp++;
@@ -305,8 +307,8 @@
 		}
 	}
-
-	afrac =	(afrac | FLOAT64_HIDDEN_BIT_MASK) << (64 - FLOAT64_FRACTION_SIZE - 2);
-	bfrac =	(bfrac | FLOAT64_HIDDEN_BIT_MASK) << (64 - FLOAT64_FRACTION_SIZE - 1);
-
+	
+	afrac = (afrac | FLOAT64_HIDDEN_BIT_MASK) << (64 - FLOAT64_FRACTION_SIZE - 2);
+	bfrac = (bfrac | FLOAT64_HIDDEN_BIT_MASK) << (64 - FLOAT64_FRACTION_SIZE - 1);
+	
 	if (bfrac <= (afrac << 1)) {
 		afrac >>= 1;
@@ -330,16 +332,17 @@
 	
 	/* round and shift */
-	result = finishFloat64(cexp, cfrac, result.parts.sign);
+	result = finish_float64(cexp, cfrac, result.parts.sign);
 	return result;
 }
 
-/**
- * Divide two quadruple-precision floats.
+/** Divide two quadruple-precision floats.
  *
  * @param a Nominator.
  * @param b Denominator.
+ *
  * @return Result of division.
- */
-float128 divFloat128(float128 a, float128 b)
+ *
+ */
+float128 div_float128(float128 a, float128 b)
 {
 	float128 result;
@@ -349,33 +352,33 @@
 	uint64_t rem_hihi, rem_hilo, rem_lohi, rem_lolo;
 	uint64_t tmp_hihi, tmp_hilo, tmp_lohi, tmp_lolo;
-
+	
 	result.parts.sign = a.parts.sign ^ b.parts.sign;
-
-	if (isFloat128NaN(a)) {
-		if (isFloat128SigNaN(b)) {
-			/*FIXME: SigNaN*/
+	
+	if (is_float128_nan(a)) {
+		if (is_float128_signan(b)) {
+			// FIXME: SigNaN
 			return b;
 		}
-
-		if (isFloat128SigNaN(a)) {
-			/*FIXME: SigNaN*/
-		}
-		/*NaN*/
+		
+		if (is_float128_signan(a)) {
+			// FIXME: SigNaN
+		}
+		/* NaN */
 		return a;
 	}
-
-	if (isFloat128NaN(b)) {
-		if (isFloat128SigNaN(b)) {
-			/*FIXME: SigNaN*/
-		}
-		/*NaN*/
+	
+	if (is_float128_nan(b)) {
+		if (is_float128_signan(b)) {
+			// FIXME: SigNaN
+		}
+		/* NaN */
 		return b;
 	}
-
-	if (isFloat128Infinity(a)) {
-		if (isFloat128Infinity(b) || isFloat128Zero(b)) {
-			/*FIXME: inf / inf */
-			result.binary.hi = FLOAT128_NAN_HI;
-			result.binary.lo = FLOAT128_NAN_LO;
+	
+	if (is_float128_infinity(a)) {
+		if (is_float128_infinity(b) || is_float128_zero(b)) {
+			// FIXME: inf / inf
+			result.bin.hi = FLOAT128_NAN_HI;
+			result.bin.lo = FLOAT128_NAN_LO;
 			return result;
 		}
@@ -386,8 +389,8 @@
 		return result;
 	}
-
-	if (isFloat128Infinity(b)) {
-		if (isFloat128Zero(a)) {
-			/* FIXME 0 / inf */
+	
+	if (is_float128_infinity(b)) {
+		if (is_float128_zero(a)) {
+			// FIXME 0 / inf
 			result.parts.exp = 0;
 			result.parts.frac_hi = 0;
@@ -395,5 +398,5 @@
 			return result;
 		}
-		/* FIXME: num / inf*/
+		// FIXME: num / inf
 		result.parts.exp = 0;
 		result.parts.frac_hi = 0;
@@ -401,13 +404,13 @@
 		return result;
 	}
-
-	if (isFloat128Zero(b)) {
-		if (isFloat128Zero(a)) {
-			/*FIXME: 0 / 0*/
-			result.binary.hi = FLOAT128_NAN_HI;
-			result.binary.lo = FLOAT128_NAN_LO;
-			return result;
-		}
-		/* FIXME: division by zero */
+	
+	if (is_float128_zero(b)) {
+		if (is_float128_zero(a)) {
+			// FIXME: 0 / 0
+			result.bin.hi = FLOAT128_NAN_HI;
+			result.bin.lo = FLOAT128_NAN_LO;
+			return result;
+		}
+		// FIXME: division by zero
 		result.parts.exp = 0;
 		result.parts.frac_hi = 0;
@@ -415,5 +418,5 @@
 		return result;
 	}
-
+	
 	afrac_hi = a.parts.frac_hi;
 	afrac_lo = a.parts.frac_lo;
@@ -422,5 +425,5 @@
 	bfrac_lo = b.parts.frac_lo;
 	bexp = b.parts.exp;
-
+	
 	/* denormalized numbers */
 	if (aexp == 0) {
@@ -431,5 +434,5 @@
 			return result;
 		}
-
+		
 		/* normalize it*/
 		aexp++;
@@ -443,5 +446,5 @@
 		}
 	}
-
+	
 	if (bexp == 0) {
 		bexp++;
@@ -455,5 +458,5 @@
 		}
 	}
-
+	
 	or128(afrac_hi, afrac_lo,
 	    FLOAT128_HIDDEN_BIT_MASK_HI, FLOAT128_HIDDEN_BIT_MASK_LO,
@@ -466,18 +469,18 @@
 	lshift128(bfrac_hi, bfrac_lo,
 	    (128 - FLOAT128_FRACTION_SIZE - 1), &bfrac_hi, &bfrac_lo);
-
+	
 	if (le128(bfrac_hi, bfrac_lo, afrac_hi, afrac_lo)) {
 		rshift128(afrac_hi, afrac_lo, 1, &afrac_hi, &afrac_lo);
 		aexp++;
 	}
-
+	
 	cexp = aexp - bexp + FLOAT128_BIAS - 2;
-
+	
 	cfrac_hi = div128est(afrac_hi, afrac_lo, bfrac_hi);
-
+	
 	mul128(bfrac_hi, bfrac_lo, 0x0ll, cfrac_hi,
 	    &tmp_lolo /* dummy */, &tmp_hihi, &tmp_hilo, &tmp_lohi);
-
-	/* sub192(afrac_hi, afrac_lo, 0, 
+	
+	/* sub192(afrac_hi, afrac_lo, 0,
 	 *     tmp_hihi, tmp_hilo, tmp_lohi
 	 *     &rem_hihi, &rem_hilo, &rem_lohi); */
@@ -487,8 +490,8 @@
 	}
 	rem_lohi = -tmp_lohi;
-
+	
 	while ((int64_t) rem_hihi < 0) {
 		--cfrac_hi;
-		/* add192(rem_hihi, rem_hilo, rem_lohi, 
+		/* add192(rem_hihi, rem_hilo, rem_lohi,
 		 *     0, bfrac_hi, bfrac_lo,
 		 *     &rem_hihi, &rem_hilo, &rem_lohi); */
@@ -498,11 +501,11 @@
 		}
 	}
-
+	
 	cfrac_lo = div128est(rem_hilo, rem_lohi, bfrac_lo);
-
+	
 	if ((cfrac_lo & 0x3FFF) <= 4) {
 		mul128(bfrac_hi, bfrac_lo, 0x0ll, cfrac_lo,
-	        &tmp_hihi /* dummy */, &tmp_hilo, &tmp_lohi, &tmp_lolo);
-
+		    &tmp_hihi /* dummy */, &tmp_hilo, &tmp_lohi, &tmp_lolo);
+		
 		/* sub192(rem_hilo, rem_lohi, 0,
 		 *     tmp_hilo, tmp_lohi, tmp_lolo,
@@ -513,5 +516,5 @@
 		}
 		rem_lolo = -tmp_lolo;
-
+		
 		while ((int64_t) rem_hilo < 0) {
 			--cfrac_lo;
@@ -524,13 +527,13 @@
 			}
 		}
-
+		
 		cfrac_lo |= ((rem_hilo | rem_lohi | rem_lolo) != 0 );
 	}
-
+	
 	shift_out = cfrac_lo << (64 - (128 - FLOAT128_FRACTION_SIZE - 1));
 	rshift128(cfrac_hi, cfrac_lo, (128 - FLOAT128_FRACTION_SIZE - 1),
 	    &cfrac_hi, &cfrac_lo);
-
-	result = finishFloat128(cexp, cfrac_hi, cfrac_lo, result.parts.sign, shift_out);
+	
+	result = finish_float128(cexp, cfrac_hi, cfrac_lo, result.parts.sign, shift_out);
 	return result;
 }
