--- old/usr/src/lib/libm/common/m9x/fmal.c	2019-06-06 20:40:14.358530283 +0000
+++ new/usr/src/lib/libm/common/m9x/fmal.c	2019-06-06 20:40:14.383380777 +0000
@@ -22,6 +22,7 @@
 /*
  * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
  */
+
 /*
  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
@@ -34,7 +35,6 @@
 #include "fenv_inlines.h"
 
 #if defined(__sparc)
-
 static const union {
 	unsigned i[2];
 	double d;
@@ -57,22 +57,22 @@
 	{ 0x7ff00001u, 0 }
 };
 
-#define	half	C[0].d
-#define	two	C[1].d
-#define	twom16	C[2].d
-#define	twom24	C[3].d
-#define	two20	C[4].d
-#define	twom28	C[5].d
-#define	twom76	C[6].d
-#define	twom124	C[7].d
-#define	two36	C[8].d
-#define	twom32	C[9].d
-#define	huge	C[10].d
-#define	tiny	C[11].d
-#define	tiny2	C[12].d
-#define	zero	C[13].d
-#define	inf	C[14].d
-#define	snan	C[15].d
+#define	half		C[0].d
+#define	two		C[1].d
+#define	twom16		C[2].d
+#define	twom24		C[3].d
+#define	two20		C[4].d
+#define	twom28		C[5].d
+#define	twom76		C[6].d
+#define	twom124		C[7].d
+#define	two36		C[8].d
+#define	twom32		C[9].d
+#define	huge		C[10].d
+#define	tiny		C[11].d
+#define	tiny2		C[12].d
+#define	zero		C[13].d
+#define	inf		C[14].d
+#define	snan		C[15].d
 
 static const unsigned int fsr_rm = 0xc0000000u;
 
@@ -80,7 +80,8 @@
  * fmal for SPARC: 128-bit quad precision, big-endian
  */
 long double
-__fmal(long double x, long double y, long double z) {
+__fmal(long double x, long double y, long double z)
+{
 	union {
 		unsigned int i[4];
 		long double q;
@@ -89,6 +90,7 @@
 		unsigned int i[2];
 		double d;
 	} u;
+
 	double dx[5], dy[5], dxy[9], c, s;
 	unsigned int xy0, xy1, xy2, xy3, xy4, xy5, xy6, xy7;
 	unsigned int z0, z1, z2, z3, z4, z5, z6, z7;
@@ -96,7 +98,7 @@
 	unsigned int fsr;
 	int hx, hy, hz, ex, ey, ez, exy, sxy, sz, e, ibit;
 	int cx, cy, cz;
-	volatile double	dummy;
+	volatile double dummy;
 
 	/* extract the high order words of the arguments */
 	xx.q = x;
@@ -119,14 +121,17 @@
 				xx.i[0] |= 0x8000;
 				return (xx.q);
 			}
-			cx = 3;	/* quiet nan */
-		} else
-			cx = 2;	/* inf */
+
+			cx = 3;		/* quiet nan */
+		} else {
+			cx = 2;		/* inf */
+		}
 	} else if (hx == 0) {
 		cx = (xx.i[1] | xx.i[2] | xx.i[3]) ? 1 : 0;
-				/* subnormal or zero */
-	} else
-		cx = 1;		/* finite nonzero */
+		/* subnormal or zero */
+	} else {
+		cx = 1;			/* finite nonzero */
+	}
 
 	if (hy >= 0x7fff0000) {
 		if ((hy & 0xffff) | yy.i[1] | yy.i[2] | yy.i[3]) {
@@ -136,13 +141,16 @@
 				yy.i[0] |= 0x8000;
 				return (yy.q);
 			}
+
 			cy = 3;
-		} else
+		} else {
 			cy = 2;
+		}
 	} else if (hy == 0) {
 		cy = (yy.i[1] | yy.i[2] | yy.i[3]) ? 1 : 0;
-	} else
+	} else {
 		cy = 1;
+	}
 
 	if (hz >= 0x7fff0000) {
 		if ((hz & 0xffff) | zz.i[1] | zz.i[2] | zz.i[3]) {
@@ -152,13 +160,16 @@
 				zz.i[0] |= 0x8000;
 				return (zz.q);
 			}
+
 			cz = 3;
-		} else
+		} else {
 			cz = 2;
+		}
 	} else if (hz == 0) {
 		cz = (zz.i[1] | zz.i[2] | zz.i[3]) ? 1 : 0;
-	} else
+	} else {
 		cz = 1;
+	}
 
 	/* get the fsr and clear current exceptions */
 	__fenv_getfsr32(&fsr);
@@ -171,6 +182,7 @@
 			__fenv_setfsr32(&fsr);
 			return (x);
 		}
+
 		if (cy == 3) {
 			__fenv_setfsr32(&fsr);
 			return (y);
@@ -201,21 +213,22 @@
 			 * the result is the same as z depending on signs
 			 */
 			if (cz == 2) {
-				if ((int) ((xx.i[0] ^ yy.i[0]) ^ zz.i[0]) < 0) {
+				if ((int)((xx.i[0] ^ yy.i[0]) ^ zz.i[0]) < 0) {
 					dummy = inf;
 					dummy -= inf;
 					zz.i[0] = 0x7fffffff;
 					zz.i[1] = zz.i[2] = zz.i[3] =
-						0xffffffff;
+					    0xffffffff;
 					return (zz.q);
 				}
+
 				__fenv_setfsr32(&fsr);
 				return (z);
 			}
 
 			/* otherwise the result is inf with appropriate sign */
 			zz.i[0] = ((xx.i[0] ^ yy.i[0]) & 0x80000000) |
-				0x7fff0000;
+			    0x7fff0000;
 			zz.i[1] = zz.i[2] = zz.i[3] = 0;
 			__fenv_setfsr32(&fsr);
 			return (zz.q);
@@ -233,13 +246,14 @@
 		 */
 		if (cx == 0 || cy == 0) {
 			/* either we have 0-0 or the result is the same as z */
-			if (cz == 0 && (int) ((xx.i[0] ^ yy.i[0]) ^ zz.i[0]) <
-				0) {
+			if (cz == 0 && (int)((xx.i[0] ^ yy.i[0]) ^ zz.i[0]) <
+			    0) {
 				zz.i[0] = (fsr >> 30) == FSR_RM ? 0x80000000 :
-					0;
+				    0;
 				__fenv_setfsr32(&fsr);
 				return (zz.q);
 			}
+
 			__fenv_setfsr32(&fsr);
 			return (z);
 		}
@@ -261,6 +275,7 @@
 	sxy = (xx.i[0] ^ yy.i[0]) & 0x80000000;
 	ex = hx >> 16;
 	hx &= 0xffff;
+
 	if (!ex) {
 		if (hx | (xx.i[1] & 0xfffe0000)) {
 			ex = 1;
@@ -280,6 +295,7 @@
 			xx.i[1] = xx.i[2] = xx.i[3] = 0;
 			ex = -95;
 		}
+
 		while ((hx & 0x10000) == 0) {
 			hx = (hx << 1) | (xx.i[1] >> 31);
 			xx.i[1] = (xx.i[1] << 1) | (xx.i[2] >> 31);
@@ -287,10 +303,13 @@
 			xx.i[3] <<= 1;
 			ex--;
 		}
-	} else
+	} else {
 		hx |= 0x10000;
+	}
+
 	ey = hy >> 16;
 	hy &= 0xffff;
+
 	if (!ey) {
 		if (hy | (yy.i[1] & 0xfffe0000)) {
 			ey = 1;
@@ -310,6 +329,7 @@
 			yy.i[1] = yy.i[2] = yy.i[3] = 0;
 			ey = -95;
 		}
+
 		while ((hy & 0x10000) == 0) {
 			hy = (hy << 1) | (yy.i[1] >> 31);
 			yy.i[1] = (yy.i[1] << 1) | (yy.i[2] >> 31);
@@ -317,45 +337,45 @@
 			yy.i[3] <<= 1;
 			ey--;
 		}
-	} else
+	} else {
 		hy |= 0x10000;
+	}
+
 	exy = ex + ey - 0x3fff;
 
 	/* convert the significands of x and y to doubles */
 	c = twom16;
-	dx[0] = (double) ((int) hx) * c;
-	dy[0] = (double) ((int) hy) * c;
+	dx[0] = (double)((int)hx) * c;
+	dy[0] = (double)((int)hy) * c;
 
 	c *= twom24;
-	dx[1] = (double) ((int) (xx.i[1] >> 8)) * c;
-	dy[1] = (double) ((int) (yy.i[1] >> 8)) * c;
+	dx[1] = (double)((int)(xx.i[1] >> 8)) * c;
+	dy[1] = (double)((int)(yy.i[1] >> 8)) * c;
 
 	c *= twom24;
-	dx[2] = (double) ((int) (((xx.i[1] << 16) | (xx.i[2] >> 16)) &
+	dx[2] = (double)((int)(((xx.i[1] << 16) | (xx.i[2] >> 16)) &
 	    0xffffff)) * c;
-	dy[2] = (double) ((int) (((yy.i[1] << 16) | (yy.i[2] >> 16)) &
+	dy[2] = (double)((int)(((yy.i[1] << 16) | (yy.i[2] >> 16)) &
 	    0xffffff)) * c;
 
 	c *= twom24;
-	dx[3] = (double) ((int) (((xx.i[2] << 8) | (xx.i[3] >> 24)) &
-	    0xffffff)) * c;
-	dy[3] = (double) ((int) (((yy.i[2] << 8) | (yy.i[3] >> 24)) &
-	    0xffffff)) * c;
+	dx[3] = (double)((int)(((xx.i[2] << 8) | (xx.i[3] >> 24)) & 0xffffff)) *
+	    c;
+	dy[3] = (double)((int)(((yy.i[2] << 8) | (yy.i[3] >> 24)) & 0xffffff)) *
+	    c;
 
 	c *= twom24;
-	dx[4] = (double) ((int) (xx.i[3] & 0xffffff)) * c;
-	dy[4] = (double) ((int) (yy.i[3] & 0xffffff)) * c;
+	dx[4] = (double)((int)(xx.i[3] & 0xffffff)) * c;
+	dy[4] = (double)((int)(yy.i[3] & 0xffffff)) * c;
 
 	/* form the "digits" of the product */
 	dxy[0] = dx[0] * dy[0];
 	dxy[1] = dx[0] * dy[1] + dx[1] * dy[0];
 	dxy[2] = dx[0] * dy[2] + dx[1] * dy[1] + dx[2] * dy[0];
-	dxy[3] = dx[0] * dy[3] + dx[1] * dy[2] + dx[2] * dy[1] +
-	    dx[3] * dy[0];
-	dxy[4] = dx[0] * dy[4] + dx[1] * dy[3] + dx[2] * dy[2] +
-	    dx[3] * dy[1] + dx[4] * dy[0];
-	dxy[5] = dx[1] * dy[4] + dx[2] * dy[3] + dx[3] * dy[2] +
-	    dx[4] * dy[1];
+	dxy[3] = dx[0] * dy[3] + dx[1] * dy[2] + dx[2] * dy[1] + dx[3] * dy[0];
+	dxy[4] = dx[0] * dy[4] + dx[1] * dy[3] + dx[2] * dy[2] + dx[3] * dy[1] +
+	    dx[4] * dy[0];
+	dxy[5] = dx[1] * dy[4] + dx[2] * dy[3] + dx[3] * dy[2] + dx[4] * dy[1];
 	dxy[6] = dx[2] * dy[4] + dx[3] * dy[3] + dx[4] * dy[2];
 	dxy[7] = dx[3] * dy[4] + dx[4] * dy[3];
 	dxy[8] = dx[4] * dy[4];
@@ -379,6 +399,7 @@
 	dxy[5] = dxy[4] + dxy[7];
 	dxy[3] = dxy[2] + dxy[5];
 	dxy[1] = dxy[0] + dxy[3];
+
 	if (dxy[1] >= two) {
 		dxy[0] *= half;
 		dxy[1] *= half;
@@ -448,6 +469,7 @@
 	sz = zz.i[0] & 0x80000000;
 	ez = hz >> 16;
 	z0 = hz & 0xffff;
+
 	if (!ez) {
 		if (z0 | (zz.i[1] & 0xfffe0000)) {
 			z1 = zz.i[1];
@@ -470,6 +492,7 @@
 			z1 = z2 = z3 = 0;
 			ez = -95;
 		}
+
 		while ((z0 & 0x10000) == 0) {
 			z0 = (z0 << 1) | (z1 >> 31);
 			z1 = (z1 << 1) | (z2 >> 31);
@@ -483,6 +506,7 @@
 		z2 = zz.i[2];
 		z3 = zz.i[3];
 	}
+
 	z4 = z5 = z6 = z7 = 0;
 
 	/*
@@ -490,54 +514,79 @@
 	 * represented likewise; swap if need be so |xy| <= |z|
 	 */
 	if (exy > ez || (exy == ez && (xy0 > z0 || (xy0 == z0 && (xy1 > z1 ||
-		(xy1 == z1 && (xy2 > z2 || (xy2 == z2 && (xy3 > z3 ||
-		(xy3 == z3 && (xy4 | xy5 | xy6 | xy7) != 0)))))))))) {
-		e = sxy; sxy = sz; sz = e;
-		e = exy; exy = ez; ez = e;
-		e = xy0; xy0 = z0; z0 = e;
-		e = xy1; xy1 = z1; z1 = e;
-		e = xy2; xy2 = z2; z2 = e;
-		e = xy3; xy3 = z3; z3 = e;
-		z4 = xy4; xy4 = 0;
-		z5 = xy5; xy5 = 0;
-		z6 = xy6; xy6 = 0;
-		z7 = xy7; xy7 = 0;
+	    (xy1 == z1 && (xy2 > z2 || (xy2 == z2 && (xy3 > z3 || (xy3 == z3 &&
+	    (xy4 | xy5 | xy6 | xy7) != 0)))))))))) {
+		e = sxy;
+		sxy = sz;
+		sz = e;
+		e = exy;
+		exy = ez;
+		ez = e;
+		e = xy0;
+		xy0 = z0;
+		z0 = e;
+		e = xy1;
+		xy1 = z1;
+		z1 = e;
+		e = xy2;
+		xy2 = z2;
+		z2 = e;
+		e = xy3;
+		xy3 = z3;
+		z3 = e;
+		z4 = xy4;
+		xy4 = 0;
+		z5 = xy5;
+		xy5 = 0;
+		z6 = xy6;
+		xy6 = 0;
+		z7 = xy7;
+		xy7 = 0;
 	}
 
 	/* shift the significand of xy keeping a sticky bit */
 	e = ez - exy;
+
 	if (e > 236) {
 		xy0 = xy1 = xy2 = xy3 = xy4 = xy5 = xy6 = 0;
 		xy7 = 1;
 	} else if (e >= 224) {
-		sticky = xy7 | xy6 | xy5 | xy4 | xy3 | xy2 | xy1 |
-			((xy0 << 1) << (255 - e));
+		sticky = xy7 | xy6 | xy5 | xy4 | xy3 | xy2 | xy1 | ((xy0 <<
+		    1) << (255 - e));
 		xy7 = xy0 >> (e - 224);
+
 		if (sticky)
 			xy7 |= 1;
+
 		xy0 = xy1 = xy2 = xy3 = xy4 = xy5 = xy6 = 0;
 	} else if (e >= 192) {
-		sticky = xy7 | xy6 | xy5 | xy4 | xy3 | xy2 |
-			((xy1 << 1) << (223 - e));
+		sticky = xy7 | xy6 | xy5 | xy4 | xy3 | xy2 | ((xy1 << 1) <<
+		    (223 - e));
 		xy7 = (xy1 >> (e - 192)) | ((xy0 << 1) << (223 - e));
+
 		if (sticky)
 			xy7 |= 1;
+
 		xy6 = xy0 >> (e - 192);
 		xy0 = xy1 = xy2 = xy3 = xy4 = xy5 = 0;
 	} else if (e >= 160) {
-		sticky = xy7 | xy6 | xy5 | xy4 | xy3 |
-			((xy2 << 1) << (191 - e));
+		sticky = xy7 | xy6 | xy5 | xy4 | xy3 | ((xy2 << 1) << (191 -
+		    e));
 		xy7 = (xy2 >> (e - 160)) | ((xy1 << 1) << (191 - e));
+
 		if (sticky)
 			xy7 |= 1;
+
 		xy6 = (xy1 >> (e - 160)) | ((xy0 << 1) << (191 - e));
 		xy5 = xy0 >> (e - 160);
 		xy0 = xy1 = xy2 = xy3 = xy4 = 0;
 	} else if (e >= 128) {
 		sticky = xy7 | xy6 | xy5 | xy4 | ((xy3 << 1) << (159 - e));
 		xy7 = (xy3 >> (e - 128)) | ((xy2 << 1) << (159 - e));
+
 		if (sticky)
 			xy7 |= 1;
+
 		xy6 = (xy2 >> (e - 128)) | ((xy1 << 1) << (159 - e));
 		xy5 = (xy1 >> (e - 128)) | ((xy0 << 1) << (159 - e));
 		xy4 = xy0 >> (e - 128);
@@ -545,8 +594,10 @@
 	} else if (e >= 96) {
 		sticky = xy7 | xy6 | xy5 | ((xy4 << 1) << (127 - e));
 		xy7 = (xy4 >> (e - 96)) | ((xy3 << 1) << (127 - e));
+
 		if (sticky)
 			xy7 |= 1;
+
 		xy6 = (xy3 >> (e - 96)) | ((xy2 << 1) << (127 - e));
 		xy5 = (xy2 >> (e - 96)) | ((xy1 << 1) << (127 - e));
 		xy4 = (xy1 >> (e - 96)) | ((xy0 << 1) << (127 - e));
@@ -555,8 +606,10 @@
 	} else if (e >= 64) {
 		sticky = xy7 | xy6 | ((xy5 << 1) << (95 - e));
 		xy7 = (xy5 >> (e - 64)) | ((xy4 << 1) << (95 - e));
+
 		if (sticky)
 			xy7 |= 1;
+
 		xy6 = (xy4 >> (e - 64)) | ((xy3 << 1) << (95 - e));
 		xy5 = (xy3 >> (e - 64)) | ((xy2 << 1) << (95 - e));
 		xy4 = (xy2 >> (e - 64)) | ((xy1 << 1) << (95 - e));
@@ -566,8 +619,10 @@
 	} else if (e >= 32) {
 		sticky = xy7 | ((xy6 << 1) << (63 - e));
 		xy7 = (xy6 >> (e - 32)) | ((xy5 << 1) << (63 - e));
+
 		if (sticky)
 			xy7 |= 1;
+
 		xy6 = (xy5 >> (e - 32)) | ((xy4 << 1) << (63 - e));
 		xy5 = (xy4 >> (e - 32)) | ((xy3 << 1) << (63 - e));
 		xy4 = (xy3 >> (e - 32)) | ((xy2 << 1) << (63 - e));
@@ -578,8 +633,10 @@
 	} else if (e) {
 		sticky = (xy7 << 1) << (31 - e);
 		xy7 = (xy7 >> e) | ((xy6 << 1) << (31 - e));
+
 		if (sticky)
 			xy7 |= 1;
+
 		xy6 = (xy6 >> e) | ((xy5 << 1) << (31 - e));
 		xy5 = (xy5 >> e) | ((xy4 << 1) << (31 - e));
 		xy4 = (xy4 >> e) | ((xy3 << 1) << (31 - e));
@@ -599,6 +656,7 @@
 		xy5 = ~xy5;
 		xy6 = ~xy6;
 		xy7 = -xy7;
+
 		if (xy7 == 0)
 			if (++xy6 == 0)
 				if (++xy5 == 0)
@@ -613,42 +671,61 @@
 	z7 += xy7;
 	e = (z7 < xy7);
 	z6 += xy6;
+
 	if (e) {
 		z6++;
 		e = (z6 <= xy6);
-	} else
+	} else {
 		e = (z6 < xy6);
+	}
+
 	z5 += xy5;
+
 	if (e) {
 		z5++;
 		e = (z5 <= xy5);
-	} else
+	} else {
 		e = (z5 < xy5);
+	}
+
 	z4 += xy4;
+
 	if (e) {
 		z4++;
 		e = (z4 <= xy4);
-	} else
+	} else {
 		e = (z4 < xy4);
+	}
+
 	z3 += xy3;
+
 	if (e) {
 		z3++;
 		e = (z3 <= xy3);
-	} else
+	} else {
 		e = (z3 < xy3);
+	}
+
 	z2 += xy2;
+
 	if (e) {
 		z2++;
 		e = (z2 <= xy2);
-	} else
+	} else {
 		e = (z2 < xy2);
+	}
+
 	z1 += xy1;
+
 	if (e) {
 		z1++;
 		e = (z1 <= xy1);
-	} else
+	} else {
 		e = (z1 < xy1);
+	}
+
 	z0 += xy0;
+
 	if (e)
 		z0++;
 
@@ -656,31 +733,38 @@
 	if (ez < 1) {
 		/* result is tiny; shift right until exponent is within range */
 		e = 1 - ez;
+
 		if (e > 116) {
-			z4 = 1; /* result can't be exactly zero */
+			z4 = 1;		/* result can't be exactly zero */
 			z0 = z1 = z2 = z3 = 0;
 		} else if (e >= 96) {
-			sticky = z7 | z6 | z5 | z4 | z3 | z2 |
-				((z1 << 1) << (127 - e));
+			sticky = z7 | z6 | z5 | z4 | z3 | z2 | ((z1 << 1) <<
+			    (127 - e));
 			z4 = (z1 >> (e - 96)) | ((z0 << 1) << (127 - e));
+
 			if (sticky)
 				z4 |= 1;
+
 			z3 = z0 >> (e - 96);
 			z0 = z1 = z2 = 0;
 		} else if (e >= 64) {
-			sticky = z7 | z6 | z5 | z4 | z3 |
-				((z2 << 1) << (95 - e));
+			sticky = z7 | z6 | z5 | z4 | z3 | ((z2 << 1) << (95 -
+			    e));
 			z4 = (z2 >> (e - 64)) | ((z1 << 1) << (95 - e));
+
 			if (sticky)
 				z4 |= 1;
+
 			z3 = (z1 >> (e - 64)) | ((z0 << 1) << (95 - e));
 			z2 = z0 >> (e - 64);
 			z0 = z1 = 0;
 		} else if (e >= 32) {
 			sticky = z7 | z6 | z5 | z4 | ((z3 << 1) << (63 - e));
 			z4 = (z3 >> (e - 32)) | ((z2 << 1) << (63 - e));
+
 			if (sticky)
 				z4 |= 1;
+
 			z3 = (z2 >> (e - 32)) | ((z1 << 1) << (63 - e));
 			z2 = (z1 >> (e - 32)) | ((z0 << 1) << (63 - e));
 			z1 = z0 >> (e - 32);
@@ -688,28 +772,33 @@
 		} else {
 			sticky = z7 | z6 | z5 | (z4 << 1) << (31 - e);
 			z4 = (z4 >> e) | ((z3 << 1) << (31 - e));
+
 			if (sticky)
 				z4 |= 1;
+
 			z3 = (z3 >> e) | ((z2 << 1) << (31 - e));
 			z2 = (z2 >> e) | ((z1 << 1) << (31 - e));
 			z1 = (z1 >> e) | ((z0 << 1) << (31 - e));
 			z0 >>= e;
 		}
+
 		ez = 1;
 	} else if (z0 >= 0x20000) {
 		/* carry out; shift right by one */
 		sticky = (z4 & 1) | z5 | z6 | z7;
 		z4 = (z4 >> 1) | (z3 << 31);
+
 		if (sticky)
 			z4 |= 1;
+
 		z3 = (z3 >> 1) | (z2 << 31);
 		z2 = (z2 >> 1) | (z1 << 31);
 		z1 = (z1 >> 1) | (z0 << 31);
 		z0 >>= 1;
 		ez++;
 	} else {
-		if (z0 < 0x10000 && (z0 | z1 | z2 | z3 | z4 | z5 | z6 | z7)
-			!= 0) {
+		if (z0 < 0x10000 && (z0 | z1 | z2 | z3 | z4 | z5 | z6 | z7) !=
+		    0) {
 			/*
 			 * borrow/cancellation; shift left as much as
 			 * exponent allows
@@ -725,6 +814,7 @@
 				z7 = 0;
 				ez -= 32;
 			}
+
 			while (z0 < 0x10000 && ez > 1) {
 				z0 = (z0 << 1) | (z1 >> 31);
 				z1 = (z1 << 1) | (z2 >> 31);
@@ -737,6 +827,7 @@
 				ez--;
 			}
 		}
+
 		if (z5 | z6 | z7)
 			z4 |= 1;
 	}
@@ -746,11 +837,13 @@
 
 	/* strip off the integer bit, if there is one */
 	ibit = z0 & 0x10000;
-	if (ibit)
+
+	if (ibit) {
 		z0 -= 0x10000;
-	else {
+	} else {
 		ez = 0;
-		if (!(z0 | z1 | z2 | z3 | z4)) { /* exact zero */
+
+		if (!(z0 | z1 | z2 | z3 | z4)) {	/* exact zero */
 			zz.i[0] = rm == FSR_RM ? 0x80000000 : 0;
 			zz.i[1] = zz.i[2] = zz.i[3] = 0;
 			__fenv_setfsr32(&fsr);
@@ -770,8 +863,8 @@
 		fsr |= FSR_NXC;
 
 		/* decide whether to round the fraction up */
-		if (rm == FSR_RP || (rm == FSR_RN && (z4 > 0x80000000u ||
-			(z4 == 0x80000000u && (z3 & 1))))) {
+		if (rm == FSR_RP || (rm == FSR_RN && (z4 > 0x80000000u || (z4 ==
+		    0x80000000u && (z3 & 1))))) {
 			/* round up and renormalize if necessary */
 			if (++z3 == 0)
 				if (++z2 == 0)
@@ -792,6 +885,7 @@
 			zz.i[0] = sz | 0x7ffeffff;
 			zz.i[1] = zz.i[2] = zz.i[3] = 0xffffffff;
 		}
+
 		fsr |= FSR_OFC | FSR_NXC;
 	} else {
 		zz.i[0] = sz | (ez << 16) | z0;
@@ -814,11 +908,13 @@
 	/* restore the fsr and emulate exceptions as needed */
 	if ((fsr & FSR_CEXC) & (fsr >> 23)) {
 		__fenv_setfsr32(&fsr);
+
 		if (fsr & FSR_OFC) {
 			dummy = huge;
 			dummy *= huge;
 		} else if (fsr & FSR_UFC) {
 			dummy = tiny;
+
 			if (fsr & FSR_NXC)
 				dummy *= tiny;
 			else
@@ -831,11 +927,10 @@
 		fsr |= (fsr & 0x1f) << 5;
 		__fenv_setfsr32(&fsr);
 	}
+
 	return (zz.q);
 }
-
 #elif defined(__x86)
-
 static const union {
 	unsigned i[2];
 	double d;
@@ -851,36 +946,38 @@
 	{ 0, 0x00100001u }
 };
 
-#define	half	C[0].d
-#define	two	C[1].d
-#define	twom32	C[2].d
-#define	twom64	C[3].d
-#define	two32	C[4].d
-#define	two63	C[5].d
-#define	huge	C[6].d
-#define	tiny	C[7].d
-#define	tiny2	C[8].d
+#define	half		C[0].d
+#define	two		C[1].d
+#define	twom32		C[2].d
+#define	twom64		C[3].d
+#define	two32		C[4].d
+#define	two63		C[5].d
+#define	huge		C[6].d
+#define	tiny		C[7].d
+#define	tiny2		C[8].d
 
 #if defined(__amd64)
-#define	NI	4
+#define	NI		4
 #else
-#define	NI	3
+#define	NI		3
 #endif
 
 /*
  * fmal for x86: 80-bit extended double precision, little-endian
  */
 long double
-__fmal(long double x, long double y, long double z) {
+__fmal(long double x, long double y, long double z)
+{
 	union {
 		unsigned i[NI];
 		long double e;
 	} xx, yy, zz;
+
 	long double xhi, yhi, xlo, ylo, t;
 	unsigned xy0, xy1, xy2, xy3, xy4, z0, z1, z2, z3, z4;
 	unsigned oldcwsw, cwsw, rm, sticky, carry;
 	int ex, ey, ez, exy, sxy, sz, e, tinyafter;
-	volatile double	dummy;
+	volatile double dummy;
 
 	/* extract the exponents of the arguments */
 	xx.e = x;
@@ -892,10 +989,10 @@
 
 	/* dispense with inf, nan, and zero cases */
 	if (ex == 0x7fff || ey == 0x7fff || (ex | xx.i[1] | xx.i[0]) == 0 ||
-		(ey | yy.i[1] | yy.i[0]) == 0)	/* x or y is inf, nan, or 0 */
+	    (ey | yy.i[1] | yy.i[0]) == 0)	/* x or y is inf, nan, or 0 */
 		return (x * y + z);
 
-	if (ez == 0x7fff)			/* z is inf or nan */
+	if (ez == 0x7fff)	/* z is inf or nan */
 		return (x + z);	/* avoid spurious under/overflow in x * y */
 
 	if ((ez | zz.i[1] | zz.i[0]) == 0)	/* z is zero */
@@ -912,14 +1009,17 @@
 	 */
 	sxy = (xx.i[2] ^ yy.i[2]) & 0x8000;
 	sz = zz.i[2] & 0x8000;
+
 	if (!ex) {
 		xx.e = x * two63;
 		ex = (xx.i[2] & 0x7fff) - 63;
 	}
+
 	if (!ey) {
 		yy.e = y * two63;
 		ey = (yy.i[2] & 0x7fff) - 63;
 	}
+
 	if (!ez) {
 		zz.e = z * two63;
 		ez = (zz.i[2] & 0x7fff) - 63;
@@ -945,6 +1045,7 @@
 	ylo = y - yhi;
 	x *= y;
 	y = ((xhi * yhi - x) + xhi * ylo + xlo * yhi) + xlo * ylo;
+
 	if (x >= two) {
 		x *= half;
 		y *= half;
@@ -968,47 +1069,66 @@
 	 * now x*y is represented by sxy, exy, and xy[0-4], and z is
 	 * represented likewise; swap if need be so |xy| <= |z|
 	 */
-	if (exy > ez || (exy == ez && (xy0 > z0 || (xy0 == z0 &&
-		(xy1 > z1 || (xy1 == z1 && (xy2 | xy3) != 0)))))) {
-		e = sxy; sxy = sz; sz = e;
-		e = exy; exy = ez; ez = e;
-		e = xy0; xy0 = z0; z0 = e;
-		e = xy1; xy1 = z1; z1 = e;
-		z2 = xy2; xy2 = 0;
-		z3 = xy3; xy3 = 0;
+	if (exy > ez || (exy == ez && (xy0 > z0 || (xy0 == z0 && (xy1 > z1 ||
+	    (xy1 == z1 && (xy2 | xy3) != 0)))))) {
+		e = sxy;
+		sxy = sz;
+		sz = e;
+		e = exy;
+		exy = ez;
+		ez = e;
+		e = xy0;
+		xy0 = z0;
+		z0 = e;
+		e = xy1;
+		xy1 = z1;
+		z1 = e;
+		z2 = xy2;
+		xy2 = 0;
+		z3 = xy3;
+		xy3 = 0;
 	}
 
 	/* shift the significand of xy keeping a sticky bit */
 	e = ez - exy;
+
 	if (e > 130) {
 		xy0 = xy1 = xy2 = xy3 = 0;
 		xy4 = 1;
 	} else if (e >= 128) {
 		sticky = xy3 | xy2 | xy1 | ((xy0 << 1) << (159 - e));
 		xy4 = xy0 >> (e - 128);
+
 		if (sticky)
 			xy4 |= 1;
+
 		xy0 = xy1 = xy2 = xy3 = 0;
 	} else if (e >= 96) {
 		sticky = xy3 | xy2 | ((xy1 << 1) << (127 - e));
 		xy4 = (xy1 >> (e - 96)) | ((xy0 << 1) << (127 - e));
+
 		if (sticky)
 			xy4 |= 1;
+
 		xy3 = xy0 >> (e - 96);
 		xy0 = xy1 = xy2 = 0;
 	} else if (e >= 64) {
 		sticky = xy3 | ((xy2 << 1) << (95 - e));
 		xy4 = (xy2 >> (e - 64)) | ((xy1 << 1) << (95 - e));
+
 		if (sticky)
 			xy4 |= 1;
+
 		xy3 = (xy1 >> (e - 64)) | ((xy0 << 1) << (95 - e));
 		xy2 = xy0 >> (e - 64);
 		xy0 = xy1 = 0;
 	} else if (e >= 32) {
 		sticky = (xy3 << 1) << (63 - e);
 		xy4 = (xy3 >> (e - 32)) | ((xy2 << 1) << (63 - e));
+
 		if (sticky)
 			xy4 |= 1;
+
 		xy3 = (xy2 >> (e - 32)) | ((xy1 << 1) << (63 - e));
 		xy2 = (xy1 >> (e - 32)) | ((xy0 << 1) << (63 - e));
 		xy1 = xy0 >> (e - 32);
@@ -1028,6 +1148,7 @@
 		xy2 = ~xy2;
 		xy3 = ~xy3;
 		xy4 = -xy4;
+
 		if (xy4 == 0)
 			if (++xy3 == 0)
 				if (++xy2 == 0)
@@ -1039,29 +1160,40 @@
 	z4 += xy4;
 	carry = (z4 < xy4);
 	z3 += xy3;
+
 	if (carry) {
 		z3++;
 		carry = (z3 <= xy3);
-	} else
+	} else {
 		carry = (z3 < xy3);
+	}
+
 	z2 += xy2;
+
 	if (carry) {
 		z2++;
 		carry = (z2 <= xy2);
-	} else
+	} else {
 		carry = (z2 < xy2);
+	}
+
 	z1 += xy1;
+
 	if (carry) {
 		z1++;
 		carry = (z1 <= xy1);
-	} else
+	} else {
 		carry = (z1 < xy1);
+	}
+
 	z0 += xy0;
+
 	if (carry) {
 		z0++;
 		carry = (z0 <= xy0);
-	} else
+	} else {
 		carry = (z0 < xy0);
+	}
 
 	/* for a magnitude subtract, ignore the last carry out */
 	if (sxy ^ sz)
@@ -1071,38 +1203,48 @@
 	if (ez < 1) {
 		/* result is tiny; shift right until exponent is within range */
 		e = 1 - ez;
+
 		if (e > 67) {
-			z2 = 1;	/* result can't be exactly zero */
+			z2 = 1;		/* result can't be exactly zero */
 			z0 = z1 = 0;
 		} else if (e >= 64) {
 			sticky = z4 | z3 | z2 | z1 | ((z0 << 1) << (95 - e));
 			z2 = (z0 >> (e - 64)) | ((carry << 1) << (95 - e));
+
 			if (sticky)
 				z2 |= 1;
+
 			z1 = carry >> (e - 64);
 			z0 = 0;
 		} else if (e >= 32) {
 			sticky = z4 | z3 | z2 | ((z1 << 1) << (63 - e));
 			z2 = (z1 >> (e - 32)) | ((z0 << 1) << (63 - e));
+
 			if (sticky)
 				z2 |= 1;
+
 			z1 = (z0 >> (e - 32)) | ((carry << 1) << (63 - e));
 			z0 = carry >> (e - 32);
 		} else {
 			sticky = z4 | z3 | (z2 << 1) << (31 - e);
 			z2 = (z2 >> e) | ((z1 << 1) << (31 - e));
+
 			if (sticky)
 				z2 |= 1;
+
 			z1 = (z1 >> e) | ((z0 << 1) << (31 - e));
 			z0 = (z0 >> e) | ((carry << 1) << (31 - e));
 		}
+
 		ez = 1;
 	} else if (carry) {
 		/* carry out; shift right by one */
 		sticky = (z2 & 1) | z3 | z4;
 		z2 = (z2 >> 1) | (z1 << 31);
+
 		if (sticky)
 			z2 |= 1;
+
 		z1 = (z1 >> 1) | (z0 << 31);
 		z0 = (z0 >> 1) | 0x80000000;
 		ez++;
@@ -1120,6 +1262,7 @@
 				z4 = 0;
 				ez -= 32;
 			}
+
 			while (z0 < 0x80000000u && ez > 1) {
 				z0 = (z0 << 1) | (z1 >> 31);
 				z1 = (z1 << 1) | (z2 >> 31);
@@ -1129,6 +1272,7 @@
 				ez--;
 			}
 		}
+
 		if (z3 | z4)
 			z2 |= 1;
 	}
@@ -1138,10 +1282,12 @@
 
 	/* adjust exponent if result is subnormal */
 	tinyafter = 0;
+
 	if (!(z0 & 0x80000000)) {
 		ez = 0;
 		tinyafter = 1;
-		if (!(z0 | z1 | z2)) { /* exact zero */
+
+		if (!(z0 | z1 | z2)) {	/* exact zero */
 			zz.i[2] = rm == FCW_RM ? 0x8000 : 0;
 			zz.i[1] = zz.i[0] = 0;
 			__fenv_setcwsw(&oldcwsw);
@@ -1158,8 +1304,8 @@
 
 	/* round */
 	if (z2) {
-		if (rm == FCW_RP || (rm == FCW_RN && (z2 > 0x80000000u ||
-			(z2 == 0x80000000u && (z1 & 1))))) {
+		if (rm == FCW_RP || (rm == FCW_RN && (z2 > 0x80000000u || (z2 ==
+		    0x80000000u && (z1 & 1))))) {
 			/* round up and renormalize if necessary */
 			if (++z1 == 0) {
 				if (++z0 == 0) {
@@ -1168,9 +1314,10 @@
 				} else if (z0 == 0x80000000) {
 					/* rounded up to smallest normal */
 					ez = 1;
+
 					if ((rm == FCW_RP && z2 >
-						0x80000000u) || (rm == FCW_RN &&
-						z2 >= 0xc0000000u))
+					    0x80000000u) || (rm == FCW_RN &&
+					    z2 >= 0xc0000000u))
 						/*
 						 * would have rounded up to
 						 * smallest normal even with
@@ -1184,6 +1331,7 @@
 
 	/* restore the control and status words, check for over/underflow */
 	__fenv_setcwsw(&oldcwsw);
+
 	if (ez >= 0x7fff) {
 		if (rm == FCW_RN || rm == FCW_RP) {
 			zz.i[2] = sz | 0x7fff;
@@ -1194,6 +1342,7 @@
 			zz.i[1] = 0xffffffff;
 			zz.i[0] = 0xffffffff;
 		}
+
 		dummy = huge;
 		dummy *= huge;
 	} else {
@@ -1207,6 +1356,7 @@
 		 */
 		if (tinyafter) {
 			dummy = tiny;
+
 			if (z2)
 				dummy *= tiny;
 			else
@@ -1219,7 +1369,6 @@
 
 	return (zz.e);
 }
-
 #else
 #error Unknown architecture
 #endif
