--- old/usr/src/Targetdirs	2014-05-04 03:04:40.913253574 +0200
+++ new/usr/src/Targetdirs	2014-05-04 03:04:40.985918774 +0200
@@ -22,6 +22,7 @@
 # Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
 # Copyright 2011, Richard Lowe
 # Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, Igor Kozhukhov <ikozhukhov@gmail.com>
 # Copyright 2012 OmniTI Computer Consulting, Inc.  All rights reserved.
 # Copyright (c) 2013 RackTop Systems.
 # Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
@@ -361,10 +362,12 @@
 	/usr/share/man/man3ldap \
 	/usr/share/man/man3lgrp \
 	/usr/share/man/man3lib \
+	/usr/share/man/man3m \
 	/usr/share/man/man3mail \
 	/usr/share/man/man3malloc \
 	/usr/share/man/man3mp \
 	/usr/share/man/man3mpapi \
+	/usr/share/man/man3mvec \
 	/usr/share/man/man3nsl \
 	/usr/share/man/man3nvpair \
 	/usr/share/man/man3pam \
--- old/usr/src/lib/Makefile	2014-05-04 03:04:43.473222243 +0200
+++ new/usr/src/lib/Makefile	2014-05-04 03:04:43.504265445 +0200
@@ -154,7 +154,11 @@
 	librdc		\
 	libinstzones	\
 	libpkg		\
-	libpcidb
+	libpcidb	\
+	libm1		\
+	libm		\
+	libmvec
+
 
 SUBDIRS += \
 	passwdutil	\
@@ -640,7 +644,7 @@
 print:		libldap5
 udapl/udapl_tavor:	udapl/libdat
 libzfs:		libdevid libgen libnvpair libuutil \
-		libadm libavl libefi libidmap libmd libzfs_core libm
+		libadm libavl libefi libidmap libmd libm libzfs_core
 libzfs_core:	libnvpair
 libzfs_jni:	libdiskmgt libnvpair libzfs
 libzpool:	libavl libumem libnvpair libcmdutils
--- old/usr/src/lib/libm/Makefile.com	2014-05-04 03:04:45.191907677 +0200
+++ new/usr/src/lib/libm/Makefile.com	2014-05-04 03:04:45.222294169 +0200
@@ -511,6 +511,10 @@
 LINTFLAGS64	+= $(LINTERROFF)
 LINTFLAGS64	+= -errchk=longptr64
 
+CERRWARN	+= -_gcc=-Wno-switch
+CERRWARN	+= -_gcc=-Wno-parentheses
+CERRWARN	+= -_gcc=-Wno-unused-variable
+
 CPPFLAGS	+= -DLIBM_BUILD
 
 CFLAGS 		+= $(C_BIGPICFLAGS)
--- old/usr/src/lib/libm/Makefile.libm.com	2014-05-04 03:04:46.997806072 +0200
+++ new/usr/src/lib/libm/Makefile.libm.com	2014-05-04 03:04:47.029373589 +0200
@@ -43,10 +43,8 @@
 CFLAGS64	+= $(C_PICFLAGS) -D__INLINE $(XSTRCONST) $(LM_IL)
 sparc_CFLAGS	+= -Wa,-xarch=v8plus
 
-CDEF_i386	= -DCOMPARISON_MACRO_BUG
 CPPFLAGS	+= -DELFOBJ \
 		-DLIBM_MT_FEX_SYNC \
-		$(CDEF_$(TARGET_ARCH)) \
 		-I$(LIBMSRC)/C \
 		-I$(LIBMSRC)/$(LDBLDIR) -I$(LIBMDIR)/$(TARGET_ARCH)/src
 
--- old/usr/src/lib/libm/Makefile.com	2014-05-04 03:04:48.960324737 +0200
+++ new/usr/src/lib/libm/Makefile.com	2014-05-04 03:04:48.988580570 +0200
@@ -511,6 +511,10 @@
 LINTFLAGS64	+= $(LINTERROFF)
 LINTFLAGS64	+= -errchk=longptr64
 
+CERRWARN	+= -_gcc=-Wno-switch
+CERRWARN	+= -_gcc=-Wno-parentheses
+CERRWARN	+= -_gcc=-Wno-unused-variable
+
 CPPFLAGS	+= -DLIBM_BUILD
 
 CFLAGS 		+= $(C_BIGPICFLAGS)
--- old/usr/src/lib/libm/Makefile.libm.com	2014-05-04 03:04:50.305625023 +0200
+++ new/usr/src/lib/libm/Makefile.libm.com	2014-05-04 03:04:50.336488674 +0200
@@ -43,10 +43,8 @@
 CFLAGS64	+= $(C_PICFLAGS) -D__INLINE $(XSTRCONST) $(LM_IL)
 sparc_CFLAGS	+= -Wa,-xarch=v8plus
 
-CDEF_i386	= -DCOMPARISON_MACRO_BUG
 CPPFLAGS	+= -DELFOBJ \
 		-DLIBM_MT_FEX_SYNC \
-		$(CDEF_$(TARGET_ARCH)) \
 		-I$(LIBMSRC)/C \
 		-I$(LIBMSRC)/$(LDBLDIR) -I$(LIBMDIR)/$(TARGET_ARCH)/src
 
--- old/usr/src/lib/libm/amd64/src/ieee_funcl.s	2014-05-04 03:04:51.715825955 +0200
+++ new/usr/src/lib/libm/amd64/src/ieee_funcl.s	2014-05-04 03:04:51.745227595 +0200
@@ -61,8 +61,7 @@
 					/      iff (msb(sgnfcnd(x) /= 0 
 					/	    &  0 < bexp(x) < 0x7fff)
 	movl	12(%rsp),%eax		/ eax <-- hi_32(sgnfcnd(x))
-	movq	$0x80000000,%r8
-	andq	%r8,%rax		/ eax[31]  <-- msb(sgnfcnd(x)),
+	andl	$-0x80000000,%eax	/ eax[31]  <-- msb(sgnfcnd(x)),
 					/ rest_of(eax) <-- 0
 	jz	.L8			/ jump iff msb(sgnfcnd(x)) = 0
 	movl	16(%rsp),%eax		/ ax <-- sign and bexp of x
@@ -82,7 +81,7 @@
 					/ msb(sgnfcnd(x)) = 0 & frac(x) /= 0)
 	movl	12(%rsp),%eax		/ eax <-- hi_32(sgnfcnd(x))
 	testl	$0x80000000,%eax	/ eax[31] = msb(sgnfcnd(x));
-					/ set ZF if it is 0.
+					/ set ZF if it's 0.
 	jz	.may_be_subnorm		/ jump iff msb(sgnfcnd(x)) = 0
 .not_subnorm:
 	movq	$0,%rax
--- old/usr/src/lib/libm/amd64/src/libm_inlines.h	2014-05-04 03:04:53.233984216 +0200
+++ new/usr/src/lib/libm/amd64/src/libm_inlines.h	2014-05-04 03:04:53.263587766 +0200
@@ -31,7 +31,7 @@
  * Copyright 2011, Richard Lowe.
  */
 
-/* Functions in this file are duplicated in libm.m4.  Keep them in sync */
+/* Functions in this file are duplicated in locallibm.il.  Keep them in sync */
 
 #ifndef _LIBM_INLINES_H
 #define	_LIBM_INLINES_H
@@ -45,15 +45,6 @@
 #include <sys/types.h>
 #include <sys/ieeefp.h>
 
-extern __inline__ double
-__ieee754_sqrt(double a)
-{
-	double ret;
-
-	__asm__ __volatile__("sqrtsd %1, %0\n\t" : "=x" (ret) : "x" (a));
-	return (ret);
-}
-
 extern __inline__ float
 __inline_sqrtf(float a)
 {
@@ -72,14 +63,10 @@
 	return (ret);
 }
 
-/* XXX: Not actually called */
-extern __inline__ short
-__inline_fstsw(void)
+extern __inline__ double
+__ieee754_sqrt(double a)
 {
-	short ret;
-
-	__asm__ __volatile__("fstsw %0\n\t" : "=r" (ret));
-	return (ret);
+	return (__inline_sqrt(a));
 }
 
 /*
@@ -131,150 +118,98 @@
 {
 	int ret;
 	__asm__ __volatile__(
-	    "movl    %1,%0\n\t"
+	    "movl    %1, %0\n\t"
 	    "negl    %1\n\t"
-	    "cmovnsl %1,%0\n\t"
-	    : "=r" (ret), "+r" (i));
+	    "cmovnsl %1, %0\n\t"
+	    : "=r" (ret), "+r" (i)
+	    :
+	    : "cc");
 	return (ret);
 }
 
 extern __inline__ double
 copysign(double d1, double d2)
 {
-	double ret;
+	double tmpd;
 
 	__asm__ __volatile__(
-	    "movq   $0x7fffffffffffffff,%%rax\n\t"
-	    "movd   %%rax,%%xmm2\n\t"
-	    "andpd  %%xmm2,%0\n\t"
-	    "andnpd %1,%%xmm2\n\t"
-	    "orpd   %%xmm2,%0\n\t"
-	    : "=x" (ret)
-	    : "x" (d2), "0" (d1)
-	    : "xmm2", "rax");
+	    "movd %3, %1\n\t"
+	    "andpd %1, %0\n\t"
+	    "andnpd %2, %1\n\t"
+	    "orpd %1, %0\n\t"
+	    : "+x" (d1), "=x" (tmpd)
+	    : "x" (d2), "r" (0x7fffffffffffffff));
 
-	return (ret);
-}
-
-extern __inline__ double
-d_sqrt_(double *d)
-{
-	double ret;
-	__asm__ __volatile__(
-	    "movlpd %1,%0\n\t"
-	    "sqrtsd %0,%0"
-	    : "=x" (ret)
-	    : "m" (*d));
-	return (ret);
+	return (d1);
 }
 
 extern __inline__ double
 fabs(double d)
 {
-	double ret;
+	double tmp;
 
 	__asm__ __volatile__(
-	    "movq  $0x7fffffffffffffff,%%rax\n\t"
-	    "movd  %%rax,%%xmm1\n\t"
-	    "andpd %%xmm1,%0"
-	    : "=x" (ret)
-	    : "0" (d)
-	    : "rax", "xmm1");
+	    "movd  %2, %1\n\t"
+	    "andpd %1, %0"
+	    : "+x" (d), "=x" (tmp)
+	    : "r" (0x7fffffffffffffff));
 
-	return (ret);
+	return (d);
 }
 
 extern __inline__ float
 fabsf(float d)
 {
-	float ret;
-
 	__asm__ __volatile__(
-	    "andpd %2,%0"
-	    : "=x" (ret)
-	    : "0" (d), "x" (0x7fffffff));
+	    "andpd %1, %0"
+	    : "+x" (d)
+	    : "x" (0x7fffffff));
 
-	return (ret);
+	return (d);
 }
 
 extern __inline__ int
 finite(double d)
 {
-	long ret;		    /* A long, so gcc chooses an %r* for %0 */
+    long ret = 0x7fffffffffffffff;
+	uint64_t tmp;
 
 	__asm__ __volatile__(
-	    "movq %1,%%rcx\n\t"
-	    "movq $0x7fffffffffffffff,%0\n\t"
-	    "andq %%rcx,%0\n\t"
-	    "movq $0x7ff0000000000000,%%rcx\n\t"
-	    "subq %%rcx,%0\n\t"
-	    "shrq $63,%0\n\t"
-	    : "=r" (ret)
+	    "movq %2, %1\n\t"
+	    "andq %1, %0\n\t"
+	    "movq $0x7ff0000000000000, %1\n\t"
+	    "subq %1, %0\n\t"
+	    "shrq $63, %0\n\t"
+	    : "+r" (ret), "=r" (tmp)
 	    : "x" (d)
-	    : "rcx");
+	    : "cc");
 
 	return (ret);
 }
 
-extern __inline__ float
-r_sqrt_(float *f)
-{
-	float ret;
-
-	__asm__ __volatile__(
-	    "movss  %1,%0\n\t"
-	    "sqrtss %0,%0\n\t"
-	    : "+x" (ret)
-	    : "m" (*f));
-	return (ret);
-}
-
 extern __inline__ int
 signbit(double d)
 {
 	long ret;
 	__asm__ __volatile__(
-	    "movmskpd %1,%0\n\t"
+	    "movmskpd %1, %0\n\t"
 	    "andq     $1, %0\n\t"
 	    : "=r" (ret)
-	    : "x" (d));
-	return (ret);
-}
-
-extern __inline__ int
-signbitf(float f)
-{
-	int ret;
-	__asm__ __volatile__(
-	    "movskps %1,%0\n\t"
-	    "andq    $1, %0\n\t"
-	    : "=r" (ret)
-	    : "x" (f));
+	    : "x" (d)
+	    : "cc");
 	return (ret);
 }
 
 extern __inline__ double
 sqrt(double d)
 {
-	double ret;
-
-	__asm__ __volatile__(
-	    "sqrtsd %0, %0"
-	    : "=x" (ret)
-	    : "0" (d));
-	return (ret);
+	return (__inline_sqrt(d));
 }
 
 extern __inline__ float
 sqrtf(float f)
 {
-	float ret;
-
-	__asm__ __volatile__(
-	    "sqrtss %0, %0"
-	    : "=x" (ret)
-	    : "0" (f));
-	return (ret);
+	return (__inline_sqrtf(f));
 }
 
 #ifdef __cplusplus
--- old/usr/src/lib/libm/amd64/src/locallibm.il	2014-05-04 03:04:54.975409335 +0200
+++ new/usr/src/lib/libm/amd64/src/locallibm.il	2014-05-04 03:04:55.004141867 +0200
@@ -40,10 +40,6 @@
 	sqrtsd	%xmm0,%xmm0
 	.end
 
-	.inline	__inline_fstsw,0
-	fstsw	%ax
-	.end
-
 /
 / 00 - 24 bits
 / 01 - reserved
@@ -103,11 +99,6 @@
 	orpd	%xmm2,%xmm0
 	.end
 
-	.inline	__d_sqrt_,0
-	movlpd	(%rdi),%xmm0
-	sqrtsd	%xmm0,%xmm0
-	.end
-
 	.inline	__fabs,0
 	movq	$0x7fffffffffffffff,%rax
 	movdq	%rax,%xmm1
@@ -132,21 +123,11 @@
 	addq	$16,%rsp
 	.end
 
-	.inline	__r_sqrt_,0
-	movss	(%rdi),%xmm0
-	sqrtss	%xmm0,%xmm0
-	.end
-
 	.inline	__signbit,0
 	movmskpd %xmm0,%eax
 	andq	$1,%rax
 	.end
 
-	.inline	__signbitf,0
-	movmskps %xmm0,%eax
-	andq	$1,%rax
-	.end
-
 	.inline	__sqrt,0
 	sqrtsd	%xmm0,%xmm0
 	.end
--- old/usr/src/lib/libm/common/C/_SVID_error.c	2014-05-04 03:04:56.538293806 +0200
+++ new/usr/src/lib/libm/common/C/_SVID_error.c	2014-05-04 03:04:56.568154016 +0200
@@ -122,7 +122,7 @@
 double
 _SVID_libm_err(double x, double y, int type) {
 	struct exception	exc;
-	double			t, w, ieee_retval;
+	double			t, w, ieee_retval = 0;
 	enum version		lib_version = _lib_version;
 	int			iy;
 
@@ -856,11 +856,8 @@
 		if (lib_version == strict_ansi) {
 			exc.retval = 1.0;
 		} else if (!matherr(&exc)) {
-			switch (lib_version) {
-			case c_issue_4:
-			case ansi_1:
+			if ((lib_version == c_issue_4) || (lib_version == ansi_1))
 				errno = EDOM;
-			}
 		}
 		break;
 	case 43:
--- old/usr/src/lib/libm/common/C/__tan.c	2014-05-04 03:04:58.875277137 +0200
+++ new/usr/src/lib/libm/common/C/__tan.c	2014-05-04 03:04:58.897898162 +0200
@@ -121,14 +121,14 @@
 
 double
 __k_tan(double x, double y, int k) {
-	double a, t, z, w, s, c, r, rh, xh, xl;
+	double a, t, z, w = 0.0L, s, c, r, rh, xh, xl;
 	int i, j, hx, ix;
 
 	t = one;
 	hx = ((int *) &x)[HIWORD];
 	ix = hx & 0x7fffffff;
-	if (ix < 0x3fc40000) {
-		if (ix < 0x3e400000) {
+	if (ix < 0x3fc40000) {		/* 0.15625 */
+		if (ix < 0x3e400000) {	/* 2^-27 */
 			if ((i = (int) x) == 0)		/* generate inexact */
 				w = x;
 			t = y;
--- old/usr/src/lib/libm/common/C/asin.c	2014-05-04 03:05:00.172312075 +0200
+++ new/usr/src/lib/libm/common/C/asin.c	2014-05-04 03:05:00.202234953 +0200
@@ -105,7 +105,7 @@
 double
 asin(double x) {
 	double t, w, p, q, c, r, s;
-	int hx, ix;
+	int hx, ix, i;
 
 	hx = ((int *) &x)[HIWORD];
 	ix = hx & 0x7fffffff;
@@ -125,12 +125,11 @@
 	}
 	else if (ix < 0x3fe00000) {	/* |x| < 0.5 */
 		if (ix < 0x3e400000) {	/* if |x| < 2**-27 */
-			if (huge + x > one)
+			if ((i = (int) x) == 0)
 				return x;	/* return x with inexact if
 						 * x != 0 */
 		}
-		else
-			t = x * x;
+		t = x * x;
 		p = t * (pS0 + t * (pS1 + t * (pS2 + t * (pS3 +
 			t * (pS4 + t * pS5)))));
 		q = one + t * (qS1 + t * (qS2 + t * (qS3 + t * qS4)));
--- old/usr/src/lib/libm/common/C/expm1.c	2014-05-04 03:05:02.531093433 +0200
+++ new/usr/src/lib/libm/common/C/expm1.c	2014-05-04 03:05:02.346727765 +0200
@@ -160,7 +160,7 @@
 
 double
 expm1(double x) {
-	double y, hi, lo, c, t, e, hxs, hfx, r1;
+	double y, hi, lo, c = 0.0L, t, e, hxs, hfx, r1;
 	int k, xsb;
 	unsigned hx;
 
@@ -172,9 +172,10 @@
 		y = -x;				/* y = |x| */
 	hx &= 0x7fffffff;			/* high word of |x| */
 
-	/* filter out huge and non-finite arugment */
-	if (hx >= 0x4043687A) {			/* if |x|>=56*ln2 */
-		if (hx >= 0x40862E42) {		/* if |x|>=709.78... */
+	/* filter out huge and non-finite argument */
+	/* for example exp(38)-1 is approximately 3.1855932e+16 */
+	if (hx >= 0x4043687A) {			/* if |x|>=56*ln2  (~38.8162...)*/
+		if (hx >= 0x40862E42) {		/* if |x|>=709.78... -> inf */
 			if (hx >= 0x7ff00000) {
 				if (((hx & 0xfffff) | ((int *) &x)[LOWORD])
 					!= 0)
@@ -194,31 +195,31 @@
 	/* argument reduction */
 	if (hx > 0x3fd62e42) {			/* if  |x| > 0.5 ln2 */
 		if (hx < 0x3FF0A2B2) {		/* and |x| < 1.5 ln2 */
-			if (xsb == 0) {
+			if (xsb == 0) {		/* positive number */
 				hi = x - ln2_hi;
 				lo = ln2_lo;
 				k = 1;
 			}
-			else {
+			else { /* negative number */
 				hi = x + ln2_hi;
 				lo = -ln2_lo;
 				k = -1;
 			}
 		}
-		else {
+		else {	/* |x| > 1.5 ln2 */
 			k = (int) (invln2 * x + (xsb == 0 ? 0.5 : -0.5));
 			t = k;
 			hi = x - t * ln2_hi;	/* t*ln2_hi is exact here */
 			lo = t * ln2_lo;
 		}
 		x = hi - lo;
-		c = (hi - x) - lo;
+		c = (hi - x) - lo; /* still at |x| > 0.5 ln2 */
 	}
 	else if (hx < 0x3c900000) {		/* when |x|<2**-54, return x */
 		t = huge + x;		/* return x w/inexact when x != 0 */
 		return x - (t - (huge + x));
 	}
-	else
+	else	/* |x| <= 0.5 ln2 */
 		k = 0;
 
 	/* x is now in primary range */
@@ -227,18 +228,19 @@
 	r1 = one + hxs * (Q1 + hxs * (Q2 + hxs * (Q3 + hxs * (Q4 + hxs * Q5))));
 	t = 3.0 - r1 * hfx;
 	e = hxs * ((r1 - t) / (6.0 - x * t));
-	if (k == 0)
-		return x - (x * e - hxs);	/* c is 0 */
-	else {
+	if (k == 0) /* |x| <= 0.5 ln2 */
+		return x - (x * e - hxs);
+	else {      /* |x| > 0.5 ln2 */
 		e = (x * (e - c) - c);
 		e -= hxs;
 		if (k == -1)
 			return 0.5 * (x - e) - 0.5;
-		if (k == 1)
+		if (k == 1) {
 			if (x < -0.25)
 				return -2.0 * (e - (x + 0.5));
 			else
 				return one + 2.0 * (x - e);
+		}
 		if (k <= -2 || k > 56) {	/* suffice to return exp(x)-1 */
 			y = one - (e - x);
 			((int *) &y)[HIWORD] += k << 20;
--- old/usr/src/lib/libm/common/C/jn.c	2014-05-04 03:05:04.062282644 +0200
+++ new/usr/src/lib/libm/common/C/jn.c	2014-05-04 03:05:04.092027863 +0200
@@ -71,7 +71,7 @@
 GENERIC
 jn(int n, GENERIC x) {
 	int i, sgn;
-	GENERIC a, b, temp;
+	GENERIC a, b, temp = 0;
 	GENERIC z, w, ox, on;
 
     /* J(-n,x) = (-1)^n * J(n, x), J(n, -x) = (-1)^n * J(n, x)
@@ -217,17 +217,19 @@
 yn(int n, GENERIC x) {
 	int i;
 	int sign;
-	GENERIC a, b, temp, ox, on;
+	GENERIC a, b, temp = 0, ox, on;
 
 	ox = x; on = (GENERIC)n;
 	if(isnan(x)) return x*x;	/* + -> * for Cheetah */
-	if (x <= zero)
-		if(x==zero)
+	if (x <= zero) {
+		if(x==zero) {
 			/* return -one/zero; */
 			return _SVID_libm_err((GENERIC)n,x,12);
-		else
+		} else {
 			/* return zero/zero; */
 			return _SVID_libm_err((GENERIC)n,x,13);
+		}
+	}
 	if (!((int) _lib_version == libm_ieee ||
 		(__xpg6 & _C99SUSv3_math_errexcept) != 0)) {
 	    if(x > X_TLOSS) return _SVID_libm_err(on,ox,39);
--- old/usr/src/lib/libm/common/C/log1p.c	2014-05-04 03:05:06.009967960 +0200
+++ new/usr/src/lib/libm/common/C/log1p.c	2014-05-04 03:05:06.246615699 +0200
@@ -123,7 +123,7 @@
 
 double
 log1p(double x) {
-	double	hfsq, f, c, s, z, R, u;
+	double	hfsq, f, c = 0.0, s, z, R, u;
 	int	k, hx, hu, ax;
 
 	hx = ((int *)&x)[HIWORD];		/* high word of x */
@@ -152,6 +152,7 @@
 			hu = 1;
 		}
 	}
+	/* We will initialize 'c' here. */
 	if (k != 0) {
 		if (hx < 0x43400000) {
 			u = 1.0 + x;
@@ -183,6 +184,7 @@
 		if (f == zero) {
 			if (k == 0)
 				return (zero);
+			/* We already initialized 'c' before, when (k != 0) */
 			c += k * ln2_lo;
 			return (k * ln2_hi + c);
 		}
--- old/usr/src/lib/libm/common/C/nextafter.c	2014-05-04 03:05:07.378100063 +0200
+++ new/usr/src/lib/libm/common/C/nextafter.c	2014-05-04 03:05:07.404742713 +0200
@@ -37,6 +37,7 @@
 	int		hx, hy, k;
 	double		ans;
 	unsigned	lx;
+	volatile double dummy;
 
 	hx = ((int *)&x)[HIWORD];
 	lx = ((int *)&x)[LOWORD];
@@ -79,7 +80,7 @@
 #if !defined(__lint)
 	} else if (k == 0) {
 		/* underflow */
-		volatile double dummy = DBL_MIN * copysign(DBL_MIN, x);
+		dummy = DBL_MIN * copysign(DBL_MIN, x);
 #endif
 	}
 	return (ans);
--- old/usr/src/lib/libm/common/C/pow.c	2014-05-04 03:05:08.683384811 +0200
+++ new/usr/src/lib/libm/common/C/pow.c	2014-05-04 03:05:08.712766793 +0200
@@ -248,8 +248,8 @@
 			if (ahx >= 0x5ff00000 && ahx < 0x7ff00000)
 				return (_SVID_libm_err(x, y, 21));
 							/* x*x overflow */
-			else if (ahx < 0x1e56a09e && (ahx | lx) != 0 ||
-				ahx == 0x1e56a09e && lx < 0x667f3bcd)
+			else if ((ahx < 0x1e56a09e && (ahx | lx) != 0) ||
+				(ahx == 0x1e56a09e && lx < 0x667f3bcd))
 				return (_SVID_libm_err(x, y, 22));
 							/* x*x underflow */
 			else
--- old/usr/src/lib/libm/common/LD/__cosl.c	2014-05-04 03:05:10.604051546 +0200
+++ new/usr/src/lib/libm/common/LD/__cosl.c	2014-05-04 03:05:10.847762698 +0200
@@ -106,10 +106,10 @@
 	int i, j, hx, ix;
 
 	t = 1.0;
-#if defined(_BIG_ENDIAN)
-	hx = px[0];
-#else
+#if defined(__i386) || defined(__amd64)
 	XTOI(px, hx);
+#else
+	hx = px[0];
 #endif
 	ix = hx & 0x7fffffff;
 	if (ix < 0x3ffc4000) {
@@ -127,10 +127,10 @@
 	}
 	j = (ix + 0x400) & 0x7ffff800;
 	i = (j - 0x3ffc4000) >> 11;
-#if defined(_BIG_ENDIAN)
-	pt[0] = j;
-#else
+#if defined(__i386) || defined(__amd64)
 	ITOX(j, pt);
+#else
+	pt[0] = j;
 #endif
 	if (hx > 0)
 		x = y - (t - x);
--- old/usr/src/lib/libm/common/LD/__rem_pio2l.c	2014-05-04 03:05:12.579770612 +0200
+++ new/usr/src/lib/libm/common/LD/__rem_pio2l.c	2014-05-04 03:05:12.609295362 +0200
@@ -34,6 +34,7 @@
  */
 
 #include "libm.h"
+#include "longdouble.h"
 
 extern const int _TBL_ipio2l_inf[];
 
--- old/usr/src/lib/libm/common/LD/__sincosl.c	2014-05-04 03:05:14.305532492 +0200
+++ new/usr/src/lib/libm/common/LD/__sincosl.c	2014-05-04 03:05:14.337053144 +0200
@@ -97,10 +97,10 @@
 	int i, j, hx, ix;
 
 	t = 1.0;
-#if defined(_BIG_ENDIAN)
-	hx = px[0];
-#else
+#if defined(__i386) || defined(__amd64)
 	XTOI(px, hx);
+#else
+	hx = px[0];
 #endif
 	ix = hx & 0x7fffffff;
 	if (ix < 0x3ffc4000) {
@@ -128,10 +128,10 @@
 	}
 	j = (ix + 0x400) & 0x7ffff800;
 	i = (j - 0x3ffc4000) >> 11;
-#if defined(_BIG_ENDIAN)
-	pt[0] = j;
-#else
+#if defined(__i386) || defined(__amd64)
 	ITOX(j, pt);
+#else
+	pt[0] = j;
 #endif
 	if (hx > 0)
 		x = y - (t - x);
--- old/usr/src/lib/libm/common/LD/__sinl.c	2014-05-04 03:05:15.828418817 +0200
+++ new/usr/src/lib/libm/common/LD/__sinl.c	2014-05-04 03:05:15.858994406 +0200
@@ -107,10 +107,10 @@
 	int i, j, hx, ix;
 
 	t = 1.0L;
-#if defined(_BIG_ENDIAN)
-	hx = px[0];
-#else
+#if defined(__i386) || defined(__amd64)
 	XTOI(px, hx);
+#else
+	hx = px[0];
 #endif
 	ix = hx & 0x7fffffff;
 	if (ix < 0x3ffc9000) {
@@ -125,10 +125,10 @@
 	}
 	j = (ix + 0x400) & 0x7ffff800;
 	i = (j - 0x3ffc4000) >> 11;
-#if defined(_BIG_ENDIAN)
-	pt[0] = j;
-#else
+#if defined(__i386) || defined(__amd64)
 	ITOX(j, pt);
+#else
+	pt[0] = j;
 #endif
 	if (hx > 0)
 		x = y - (t - x);
--- old/usr/src/lib/libm/common/LD/__tanl.c	2014-05-04 03:05:16.932573892 +0200
+++ new/usr/src/lib/libm/common/LD/__tanl.c	2014-05-04 03:05:17.176255223 +0200
@@ -111,15 +111,15 @@
 /* INDENT ON */
 long double
 __k_tanl(long double x, long double y, int k) {
-	long double a, t, z, w, s, c;
+	long double a, t, z, w = 0.0, s, c;
 	int *pt = (int *) &t, *px = (int *) &x;
 	int i, j, hx, ix;
 
 	t = 1.0;
-#if defined(_BIG_ENDIAN)
-	hx = px[0];
-#else
+#if defined(__i386) || defined(__amd64)
 	XTOI(px, hx);
+#else
+	hx = px[0];
 #endif
 	ix = hx & 0x7fffffff;
 	if (ix < 0x3ffc4000) {
@@ -142,10 +142,10 @@
 	}
 	j = (ix + 0x400) & 0x7ffff800;
 	i = (j - 0x3ffc4000) >> 11;
-#if defined(_BIG_ENDIAN)
-	pt[0] = j;
-#else
+#if defined(__i386) || defined(__amd64)
 	ITOX(j, pt);
+#else
+	pt[0] = j;
 #endif
 	if (hx > 0)
 		x = y - (t - x);
--- old/usr/src/lib/libm/common/LD/asinhl.c	2014-05-04 03:05:18.657959429 +0200
+++ new/usr/src/lib/libm/common/LD/asinhl.c	2014-05-04 03:05:18.685017586 +0200
@@ -42,13 +42,14 @@
 long double
 asinhl(long double x) {
 	long double t, w;
+	volatile long double dummy;
 
 	w = fabsl(x);
 	if (isnanl(x))
 		return (x + x);	/* x is NaN */
 	if (w < tiny) {
 #ifndef lint
-		volatile long double dummy = x + big;	/* inexact if x != 0 */
+		dummy = x + big;	/* inexact if x != 0 */
 #endif
 		return (x);	/* tiny x */
 	} else if (w < big) {
--- old/usr/src/lib/libm/common/LD/cbrtl.c	2014-05-04 03:05:20.590001890 +0200
+++ new/usr/src/lib/libm/common/LD/cbrtl.c	2014-05-04 03:05:20.625255436 +0200
@@ -32,6 +32,7 @@
 #endif
 
 #include "libm.h"
+#include "longdouble.h"
 
 static const double d_one = 1.0;
 
--- old/usr/src/lib/libm/common/LD/coshl.c	2014-05-04 03:05:22.152826129 +0200
+++ new/usr/src/lib/libm/common/LD/coshl.c	2014-05-04 03:05:22.183031406 +0200
@@ -32,6 +32,7 @@
 #endif
 
 #include "libm.h"
+#include "longdouble.h"
 
 /*
  * COSH(X)
--- old/usr/src/lib/libm/common/LD/cosl.c	2014-05-04 03:05:24.316300765 +0200
+++ new/usr/src/lib/libm/common/LD/cosl.c	2014-05-04 03:05:24.346624215 +0200
@@ -79,10 +79,10 @@
 		return x - x;
 
 	/* High word of x. */
-#if defined(_BIG_ENDIAN)
-	ix = px[0];
-#else
+#if defined(__i386) || defined(__amd64)
 	XTOI(px, ix);
+#else
+	ix = px[0];
 #endif
 
 	/* |x| ~< pi/4 */
--- old/usr/src/lib/libm/common/LD/isnanl.c	2014-05-04 03:05:25.458078191 +0200
+++ new/usr/src/lib/libm/common/LD/isnanl.c	2014-05-04 03:05:25.473885751 +0200
@@ -45,8 +45,8 @@
 isnanl(long double x) {
 	int *px = (int *) &x, t = px[2] & 0x7fff;
 #if defined(HANDLE_UNSUPPORTED)
-	return (t == 0x7fff && ((px[1] & ~0x80000000) | px[0]) != 0 ||
-		t != 0 && (px[1] & 0x80000000) == 0);
+	return ((t == 0x7fff && ((px[1] & ~0x80000000) | px[0]) != 0) ||
+		(t != 0 && (px[1] & 0x80000000) == 0));
 #else
 	return (t == 0x7fff && ((px[1] & ~0x80000000) | px[0]) != 0);
 #endif
--- old/usr/src/lib/libm/common/LD/j0l.c	2014-05-04 03:05:26.761068863 +0200
+++ new/usr/src/lib/libm/common/LD/j0l.c	2014-05-04 03:05:27.005059295 +0200
@@ -41,6 +41,9 @@
 
 #include "libm.h"
 #include "libm_synonyms.h"
+
+#include "longdouble.h"
+
 #include <math.h>
 #if defined(__SUNPRO_C)
 #include <sunmath.h>
--- old/usr/src/lib/libm/common/LD/j1l.c	2014-05-04 03:05:28.325281508 +0200
+++ new/usr/src/lib/libm/common/LD/j1l.c	2014-05-04 03:05:28.354209628 +0200
@@ -41,6 +41,7 @@
 
 #include "libm.h"
 #include "libm_synonyms.h"
+#include "longdouble.h"
 #include <math.h>
 #if defined(__SUNPRO_C)
 #include <sunmath.h>
--- old/usr/src/lib/libm/common/LD/jnl.c	2014-05-04 03:05:29.863215255 +0200
+++ new/usr/src/lib/libm/common/LD/jnl.c	2014-05-04 03:05:29.892904056 +0200
@@ -58,6 +58,7 @@
  */
 
 #include "libm.h"
+#include "longdouble.h"
 #include <float.h>	/* LDBL_MAX */
 
 #define GENERIC long double
@@ -71,7 +72,7 @@
 GENERIC
 jnl(n,x) int n; GENERIC x;{
 	int i, sgn;
-	GENERIC a, b, temp, z, w;
+	GENERIC a, b, temp = 0, z, w;
 
     /* J(-n,x) = (-1)^n * J(n, x), J(n, -x) = (-1)^n * J(n, x)
      * Thus, J(-n,x) = J(n,-x)
@@ -211,14 +212,16 @@
 int n; GENERIC x;{
 	int i;
 	int sign;
-	GENERIC a, b, temp;
+	GENERIC a, b, temp = 0;
 
-	if(x!=x) return x+x;
-	if (x <= zero) 
+	if(x!=x)
+		return x+x;
+	if (x <= zero) {
 		if(x==zero) 
 			return -one/zero;
 		else 
 			return zero/zero;
+	}
 	sign = 1;
 	if(n<0){
 		n = -n;
--- old/usr/src/lib/libm/common/LD/log1pl.c	2014-05-04 03:05:31.801047449 +0200
+++ new/usr/src/lib/libm/common/LD/log1pl.c	2014-05-04 03:05:31.618517331 +0200
@@ -54,11 +54,12 @@
 		return (logl(x));
 	rd = __swapRD(fp_nearest);
 	y = 1.L + x;
-	if (y != 1.L)
+	if (y != 1.L) {
 		if (y == x)
 			x = logl(x);
 		else
 			x *= logl(y) / (y - 1.L);
+	}
 	if (rd != fp_nearest)
 		(void) __swapRD(rd);
 	return (x);
--- old/usr/src/lib/libm/common/LD/scalbl.c	2014-05-04 03:05:33.350064276 +0200
+++ new/usr/src/lib/libm/common/LD/scalbl.c	2014-05-04 03:05:33.381190898 +0200
@@ -48,16 +48,16 @@
 
 	/* fn is +/-Inf */
 #if defined(_BIG_ENDIAN)
-	if ((py[0] & 0x7fff0000) == 0x7fff0000)
+	if ((py[0] & 0x7fff0000) == 0x7fff0000) {
 		if ((py[0] & 0x80000000) != 0)
 #else
-	if ((py[2] & 0x7fff) == 0x7fff)
+	if ((py[2] & 0x7fff) == 0x7fff) {
 		if ((py[2] & 0x8000) != 0)
 #endif
 			return x / (-fn);
 		else
 			return x * fn;
-
+	}
 	if (rintl(fn) != fn)
 		return (fn - fn) / (fn - fn);
 	if (fn > 65000.0L)
--- old/usr/src/lib/libm/common/LD/sincosl.c	2014-05-04 03:05:34.659120537 +0200
+++ new/usr/src/lib/libm/common/LD/sincosl.c	2014-05-04 03:05:34.689969082 +0200
@@ -71,7 +71,7 @@
 sincosl(long double x, long double *s, long double *c) {
 	long double y[2], z = 0.0L;
 	int n, ix;
-#if defined(_LITTLE_ENDIAN)
+#if defined(__i386) || defined(__amd64)
 	int *px = (int *) &x;
 #endif
 
@@ -82,10 +82,10 @@
 	}
 
 	/* High word of x. */
-#if defined(_BIG_ENDIAN)
-	ix = *(int *) &x;
-#else
+#if defined(__i386) || defined(__amd64)
 	XTOI(px, ix);
+#else
+	ix = *(int *) &x;
 #endif
 
 	/* |x| ~< pi/4 */
--- old/usr/src/lib/libm/common/LD/sincospil.c	2014-05-04 03:05:36.157111133 +0200
+++ new/usr/src/lib/libm/common/LD/sincospil.c	2014-05-04 03:05:36.180806176 +0200
@@ -78,7 +78,7 @@
 
 #define I(q, m)	((int *) &(q))[m]
 #define U(q, m)	((unsigned *) &(q))[m]
-#if defined(_LITTLE_ENDIAN)
+#if defined(__i386) || defined(__amd64)
 #define LDBL_MOST_SIGNIF_I(ld)	((I(ld, 2) << 16) | (0xffff & (I(ld, 1) >> 15)))
 #define LDBL_LEAST_SIGNIF_U(ld)	U(ld, 0)
 #define PREC	64
--- old/usr/src/lib/libm/common/LD/sinhl.c	2014-05-04 03:05:37.517341221 +0200
+++ new/usr/src/lib/libm/common/LD/sinhl.c	2014-05-04 03:05:37.761477082 +0200
@@ -30,6 +30,7 @@
 #pragma weak sinhl = __sinhl
 
 #include "libm.h"
+#include "longdouble.h"
 
 /* SINH(X)
  * RETURN THE HYPERBOLIC SINE OF X
--- old/usr/src/lib/libm/common/LD/sinl.c	2014-05-04 03:05:38.821572304 +0200
+++ new/usr/src/lib/libm/common/LD/sinl.c	2014-05-04 03:05:38.851339792 +0200
@@ -72,7 +72,7 @@
 sinl(long double x) {
 	long double y[2], z = 0.0L;
 	int n, ix;
-#if defined(_LITTLE_ENDIAN)
+#if defined(__i386) || defined(__amd64)
 	int *px = (int *) &x;
 #endif
 
@@ -81,16 +81,15 @@
 		return x - x;
 
 	/* High word of x. */
-#if defined(_BIG_ENDIAN)
-	ix = *(int *) &x;
-#else
+#if defined(__i386) || defined(__amd64)
 	XTOI(px, ix);
+#else
+	ix = *(int *) &x;
 #endif
 	/* |x| ~< pi/4 */
 	ix &= 0x7fffffff;
-	if (ix <= 0x3ffe9220) {
+	if (ix <= 0x3ffe9220)
 		return __k_sinl(x, z);
-        }
 
 	/* argument reduction needed */
 	else {
@@ -107,5 +106,5 @@
 		/* NOTREACHED */
 		}
 	}
-    return 0.0L;
+	return 0.0L;
 }
--- old/usr/src/lib/libm/common/LD/sinpil.c	2014-05-04 03:05:39.942975095 +0200
+++ new/usr/src/lib/libm/common/LD/sinpil.c	2014-05-04 03:05:39.955350802 +0200
@@ -77,7 +77,7 @@
 
 #define I(q, m)	((int *) &(q))[m]
 #define U(q, m)	((unsigned *) &(q))[m]
-#if defined(_LITTLE_ENDIAN)
+#if defined(__i386) || defined(__amd64)
 #define LDBL_MOST_SIGNIF_I(ld)	((I(ld, 2) << 16) | (0xffff & (I(ld, 1) >> 15)))
 #define LDBL_LEAST_SIGNIF_U(ld)	U(ld, 0)
 #define PREC	64
--- old/usr/src/lib/libm/common/LD/tanhl.c	2014-05-04 03:05:41.590737174 +0200
+++ new/usr/src/lib/libm/common/LD/tanhl.c	2014-05-04 03:05:41.620104634 +0200
@@ -60,6 +60,7 @@
  */
 
 #include "libm.h"
+#include "longdouble.h"
 
 static const long double small = 1.0e-20L, one = 1.0, two = 2.0,
 #ifndef lint
@@ -71,6 +72,7 @@
 tanhl(long double x) {
 	long double t, y, z;
 	int signx;
+	volatile long double dummy;
 
 	if (isnanl(x))
 		return (x + x);		/* x is NaN */
@@ -85,7 +87,7 @@
 			z = -y / (y + two);
 		} else {
 #ifndef lint
-			volatile long double dummy = t + big;
+			dummy = t + big;
 							/* inexact if t != 0 */
 #endif
 			return (x);
--- old/usr/src/lib/libm/common/LD/tanl.c	2014-05-04 03:05:43.975402675 +0200
+++ new/usr/src/lib/libm/common/LD/tanl.c	2014-05-04 03:05:44.003714702 +0200
@@ -71,7 +71,7 @@
 tanl(long double x) {
 	long double y[2], z = 0.0L;
 	int n, ix;
-#if defined(_LITTLE_ENDIAN)
+#if defined(__i386) || defined(__amd64)
 	int *px = (int *) &x;
 #endif
 
@@ -80,10 +80,10 @@
 		return x - x;
 
 	/* High word of x. */
-#if defined(_BIG_ENDIAN)
-	ix = *(int *) &x;
-#else
+#if defined(__i386) || defined(__amd64)
 	XTOI(px, ix);
+#else
+	ix = *(int *) &x;
 #endif
 
 	/* |x| ~< pi/4 */
--- old/usr/src/lib/libm/common/Q/__tanl.c	2014-05-04 03:05:46.338181476 +0200
+++ new/usr/src/lib/libm/common/Q/__tanl.c	2014-05-04 03:05:46.367610637 +0200
@@ -111,7 +111,7 @@
 
 long double
 __k_tanl(long double x, long double y, int k) {
-	long double a, t, z, w, s, c;
+	long double a, t, z, w = 0, s, c;
 	int *pt = (int *) &t, *px = (int *) &x;
 	int i, j, hx, ix;
 
--- old/usr/src/lib/libm/common/Q/asinhl.c	2014-05-04 03:05:47.693535487 +0200
+++ new/usr/src/lib/libm/common/Q/asinhl.c	2014-05-04 03:05:47.724160942 +0200
@@ -42,13 +42,14 @@
 long double
 asinhl(long double x) {
 	long double t, w;
+	volatile long double dummy;
 
 	w = fabsl(x);
 	if (isnanl(x))
 		return (x + x);	/* x is NaN */
 	if (w < tiny) {
 #ifndef lint
-		volatile long double dummy = x + big;	/* inexact if x != 0 */
+		dummy = x + big;	/* inexact if x != 0 */
 #endif
 		return (x);	/* tiny x */
 	} else if (w < big) {
--- old/usr/src/lib/libm/common/Q/asinl.c	2014-05-04 03:05:49.304364118 +0200
+++ new/usr/src/lib/libm/common/Q/asinl.c	2014-05-04 03:05:49.335469626 +0200
@@ -53,6 +53,7 @@
 long double
 asinl(long double x) {
 	long double t, w;
+	volatile long double dummy;
 
 	w = fabsl(x);
 	if (isnanl(x))
@@ -60,7 +61,7 @@
 	else if (w <= half) {
 		if (w < small) {
 #ifndef lint
-			volatile long double dummy = w + big;
+			dummy = w + big;
 							/* inexact if w != 0 */
 #endif
 			return (x);
--- old/usr/src/lib/libm/common/Q/atan2l.c	2014-05-04 03:05:50.769934893 +0200
+++ new/usr/src/lib/libm/common/Q/atan2l.c	2014-05-04 03:05:50.800350865 +0200
@@ -103,7 +103,7 @@
 		return (signy == 1 ? -PIo2 - tiny : PIo2 + tiny);
 
 	/* when x is INF */
-	if (!finitel(x))
+	if (!finitel(x)) {
 		if (!finitel(y)) {
 			switch (m) {
 			case 0:
@@ -127,7 +127,7 @@
 				return (-PI - tiny);	/* atan(-...,-INF) */
 			}
 		}
-
+	}
 	/* when y is INF */
 	if (!finitel(y))
 		return (signy == 1 ? -PIo2 - tiny : PIo2 + tiny);
--- old/usr/src/lib/libm/common/Q/jnl.c	2014-05-04 03:05:52.278360984 +0200
+++ new/usr/src/lib/libm/common/Q/jnl.c	2014-05-04 03:05:52.738327527 +0200
@@ -218,11 +218,12 @@
 	GENERIC a, b, temp;
 
 	if(x!=x) return x+x;
-	if (x <= zero)
+	if (x <= zero) {
 		if(x==zero)
 			return -one/zero;
 		else
 			return zero/zero;
+	}
 	sign = 1;
 	if(n<0){
 		n = -n;
--- old/usr/src/lib/libm/common/Q/tanhl.c	2014-05-04 03:05:53.792831608 +0200
+++ new/usr/src/lib/libm/common/Q/tanhl.c	2014-05-04 03:05:53.821946273 +0200
@@ -72,6 +72,7 @@
 tanhl(long double x) {
 	long double t, y, z;
 	int signx;
+	volatile long double dummy;
 
 	if (isnanl(x))
 		return (x + x);		/* x is NaN */
@@ -86,7 +87,7 @@
 			z = -y / (y + two);
 		} else {
 #ifndef lint
-			volatile long double dummy = t + big;
+			dummy = t + big;
 							/* inexact if t != 0 */
 #endif
 			return (x);
--- old/usr/src/lib/libm/common/R/__tanf.c	2014-05-04 03:05:55.738553295 +0200
+++ new/usr/src/lib/libm/common/R/__tanf.c	2014-05-04 03:05:55.768109581 +0200
@@ -71,7 +71,7 @@
 
 float
 __k_tanf(double x, int n) {
-	float ft;
+	float ft = 0.0;
 	double z, w;
 	int ix;
 
--- old/usr/src/lib/libm/common/R/cosf.c	2014-05-04 03:05:57.700717690 +0200
+++ new/usr/src/lib/libm/common/R/cosf.c	2014-05-04 03:05:57.927387653 +0200
@@ -76,6 +76,7 @@
 	double	y, z, w;
 	float	f;
 	int	n, ix, hx, hy;
+	volatile int i;
 
 	hx = *((int *)&x);
 	ix = hx & 0x7fffffff;
@@ -85,7 +86,7 @@
 	if (ix <= 0x4016cbe4) {		/* |x| < 3*pi/4 */
 		if (ix <= 0x3f490fdb) {		/* |x| < pi/4 */
 			if (ix <= 0x39800000) {	/* |x| <= 2**-12 */
-				volatile int	i = (int)y;
+				i = (int)y;
 #ifdef lint
 				i = i;
 #endif
--- old/usr/src/lib/libm/common/R/exp10f.c	2014-05-04 03:05:59.335840719 +0200
+++ new/usr/src/lib/libm/common/R/exp10f.c	2014-05-04 03:05:59.153387101 +0200
@@ -31,7 +31,7 @@
 
 #include "libm.h"
 
-double exp10(double);
+extern double exp10(double);
 
 float
 exp10f(float x) {
--- old/usr/src/lib/libm/common/R/sincosf.c	2014-05-04 03:06:01.272660023 +0200
+++ new/usr/src/lib/libm/common/R/sincosf.c	2014-05-04 03:06:01.721916661 +0200
@@ -98,6 +98,7 @@
 	double	y, z, w;
 	float	f, g;
 	int	n, ix, hx, hy;
+	volatile int i;
 
 	hx = *((int *)&x);
 	ix = hx & 0x7fffffff;
@@ -107,7 +108,7 @@
 	if (ix <= 0x4016cbe4) {		/* |x| < 3*pi/4 */
 		if (ix <= 0x3f490fdb) {		/* |x| < pi/4 */
 			if (ix <= 0x39800000) {	/* |x| <= 2**-12 */
-				volatile int	i = (int)y;
+				i = (int)y;
 #ifdef lint
 				i = i;
 #endif
--- old/usr/src/lib/libm/common/R/sincospif.c	2014-05-04 03:06:02.804175682 +0200
+++ new/usr/src/lib/libm/common/R/sincospif.c	2014-05-04 03:06:03.027659232 +0200
@@ -31,7 +31,7 @@
 
 #include "libm.h"
 
-void sincospi(double x, double *s, double *c);
+extern void sincospi(double, double *, double *);
 
 void
 sincospif(float x, float *s, float *c) {
--- old/usr/src/lib/libm/common/R/sinf.c	2014-05-04 03:06:04.906657135 +0200
+++ new/usr/src/lib/libm/common/R/sinf.c	2014-05-04 03:06:04.720471958 +0200
@@ -76,6 +76,7 @@
 	double	y, z, w;
 	float	f;
 	int	n, ix, hx, hy;
+	volatile int i;
 
 	hx = *((int *)&x);
 	ix = hx & 0x7fffffff;
@@ -85,7 +86,7 @@
 	if (ix <= 0x4016cbe4) {		/* |x| < 3*pi/4 */
 		if (ix <= 0x3f490fdb) {		/* |x| < pi/4 */
 			if (ix <= 0x39800000) {	/* |x| <= 2**-12 */
-				volatile int	i = (int)y;
+				i = (int)y;
 #ifdef lint
 				i = i;
 #endif
--- old/usr/src/lib/libm/common/R/tanf.c	2014-05-04 03:06:06.819925583 +0200
+++ new/usr/src/lib/libm/common/R/tanf.c	2014-05-04 03:06:06.637138480 +0200
@@ -76,6 +76,7 @@
 	double	y, z, w;
 	float	f;
 	int	n, ix, hx, hy;
+	volatile int i;
 
 	hx = *((int *)&x);
 	ix = hx & 0x7fffffff;
@@ -86,7 +87,7 @@
 		if (ix <= 0x3f490fdb) {		/* |x| < pi/4 */
 			if (ix < 0x3c000000) {		/* |x| < 2**-7 */
 				if (ix <= 0x39800000) {	/* |x| < 2**-12 */
-					volatile int	i = (int)y;
+					i = (int)y;
 #ifdef lint
 					i = i;
 #endif
--- old/usr/src/lib/libm/common/complex/cpow.c	2014-05-04 03:06:08.209148956 +0200
+++ new/usr/src/lib/libm/common/complex/cpow.c	2014-05-04 03:06:08.240261962 +0200
@@ -104,7 +104,7 @@
 	zero = 0.0;
 
 static const int hiinf = 0x7ff00000;
-double atan2pi(double, double);
+extern double atan2pi(double, double);
 
 /*
  * Assuming |t[0]| > |t[1]| and |t[2]| > |t[3]|, sum4fp subroutine
--- old/usr/src/lib/libm/common/complex/k_cexp.c	2014-05-04 03:06:09.385767132 +0200
+++ new/usr/src/lib/libm/common/complex/k_cexp.c	2014-05-04 03:06:09.629214375 +0200
@@ -117,7 +117,7 @@
 
 double
 __k_cexp(double x, int *n) {
-	double hi, lo, c, t;
+	double hi = 0.0L, lo = 0.0L, c, t;
 	int k, xsb;
 	unsigned hx, lx;
 
--- old/usr/src/lib/libm/common/complex/k_clog_rl.c	2014-05-04 03:06:11.355716390 +0200
+++ new/usr/src/lib/libm/common/complex/k_clog_rl.c	2014-05-04 03:06:11.386044700 +0200
@@ -494,7 +494,7 @@
 	if (n > 122 || y == 0.0L) {
 #endif
 
-		XFSCALE(x, 0x3fff - (ix >> 16));
+		XFSCALE(x, (0x3fff - (ix >> 16)));
 		i = ((ix & 0xffff) + 0x100) >> 9;  /* 7.5 bits of x */
 		zk = 1.0L + ((long double) i) * 0.0078125L;
 		z = x - zk;
@@ -517,8 +517,8 @@
 /*
  * compute z = x*x + y*y
  */
-		XFSCALE(x, 0x3fff - (ix >> 16));
-		XFSCALE(y, 0x3fff - n - (iy >> 16));
+		XFSCALE(x, (0x3fff - (ix >> 16)));
+		XFSCALE(y, (0x3fff - n - (iy >> 16)));
 		ix = (ix & 0xffff) | 0x3fff0000;
 		iy = (iy & 0xffff) | (0x3fff0000 - (n << 16));
 		nx -= 0x3fff;
--- old/usr/src/lib/libm/common/m9x/__fex_hdlr.c	2014-05-04 03:06:12.696879693 +0200
+++ new/usr/src/lib/libm/common/m9x/__fex_hdlr.c	2014-05-04 03:06:12.727097764 +0200
@@ -378,7 +378,7 @@
 #define test_sse_hw	1
 #else
 extern int _sse_hw;
-#define test_sse_hw	&_sse_hw && _sse_hw
+#define test_sse_hw	_sse_hw
 #endif
 
 #if !defined(REG_PC)
@@ -394,7 +394,7 @@
 {
 	struct fex_handler_data	*thr_handlers;
 	struct sigaction	act;
-	void			(*handler)(), (*simd_handler[4])();
+	void			(*handler)() = NULL, (*simd_handler[4])();
 	int			mode, simd_mode[4], i, len, accrued, *ap;
 	unsigned int		cwsw, oldcwsw, mxcsr, oldmxcsr;
 	enum fex_exception	e, simd_e[4];
--- old/usr/src/lib/libm/common/m9x/__fex_i386.c	2014-05-04 03:06:14.497288293 +0200
+++ new/usr/src/lib/libm/common/m9x/__fex_i386.c	2014-05-04 03:06:14.525386308 +0200
@@ -1428,6 +1428,9 @@
 		case fex_ldouble:
 			*(float *)ea = (float) r.val.q;
 			break;
+
+		default:
+			break;
 		}
 		if (ex != FPE_FLTRES && (op & 8) != 0)
 			pop(uap);
@@ -1461,6 +1464,9 @@
 		case fex_ldouble:
 			*(int *)ea = (int) r.val.q;
 			break;
+
+		default:
+			break;
 		}
 		if (ex != FPE_FLTRES && (op & 8) != 0)
 			pop(uap);
@@ -1494,6 +1500,9 @@
 		case fex_ldouble:
 			*(double *)ea = (double) r.val.q;
 			break;
+
+		default:
+			break;
 		}
 		if (ex != FPE_FLTRES && (op & 8) != 0)
 			pop(uap);
@@ -1527,6 +1536,9 @@
 		case fex_ldouble:
 			*(short *)ea = (short) r.val.q;
 			break;
+
+		default:
+			break;
 		}
 		if (ex != FPE_FLTRES && (op & 8) != 0)
 			pop(uap);
@@ -1565,6 +1577,9 @@
 		case fex_ldouble:
 			*(long long *)ea = (long long) r.val.q;
 			break;
+
+		default:
+			break;
 		}
 		if (ex != FPE_FLTRES)
 			pop(uap);
@@ -1588,6 +1603,9 @@
 	case fex_double:
 		r.val.q = (long double) r.val.d;
 		break;
+
+	default:
+		break;
 	}
 
 	/* for load instructions, push the result onto the stack */
--- old/usr/src/lib/libm/common/m9x/__fex_sparc.c	2014-05-04 03:06:16.713632756 +0200
+++ new/usr/src/lib/libm/common/m9x/__fex_sparc.c	2014-05-04 03:06:16.744172412 +0200
@@ -662,6 +662,9 @@
 			case fex_ldouble:
 				info->res.val.i = (int) info->res.val.q;
 				break;
+
+			default:
+				break;
 			}
 			*(int*)FPreg(rd) = info->res.val.i;
 			return;
@@ -685,6 +688,9 @@
 			case fex_ldouble:
 				info->res.val.l = (long long) info->res.val.q;
 				break;
+
+			default:
+				break;
 			}
 			*(long long*)FPREG(rd) = info->res.val.l;
 			break;
@@ -706,6 +712,9 @@
 			case fex_ldouble:
 				info->res.val.f = (float) info->res.val.q;
 				break;
+
+			default:
+				break;
 			}
 			*(float*)FPreg(rd) = info->res.val.f;
 			break;
@@ -727,6 +736,9 @@
 			case fex_ldouble:
 				info->res.val.d = (double) info->res.val.q;
 				break;
+
+			default:
+				break;
 			}
 			*(double*)FPREG(rd) = info->res.val.d;
 			break;
@@ -748,6 +760,9 @@
 			case fex_double:
 				info->res.val.q = (long double) info->res.val.d;
 				break;
+
+			default:
+				break;
 			}
 			*(long double*)FPREG(rd) = info->res.val.q;
 			break;
@@ -774,6 +789,9 @@
 			case fex_ldouble:
 				info->res.val.d = (double) info->res.val.q;
 				break;
+
+			default:
+				break;
 			}
 			*(double*)FPREG(rd) = info->res.val.d;
 			break;
@@ -795,6 +813,9 @@
 			case fex_double:
 				info->res.val.q = (long double) info->res.val.d;
 				break;
+
+			default:
+				break;
 			}
 			*(long double*)FPREG(rd) = info->res.val.q;
 			break;
@@ -820,6 +841,9 @@
 		case fex_ldouble:
 			info->res.val.f = (float) info->res.val.q;
 			break;
+
+		default:
+			break;
 		}
 		*(float*)FPreg(rd) = info->res.val.f;
 		break;
@@ -841,6 +865,9 @@
 		case fex_ldouble:
 			info->res.val.d = (double) info->res.val.q;
 			break;
+
+		default:
+			break;
 		}
 		*(double*)FPREG(rd) = info->res.val.d;
 		break;
@@ -862,6 +889,9 @@
 		case fex_double:
 			info->res.val.q = (long double) info->res.val.d;
 			break;
+
+		default:
+			break;
 		}
 		*(long double*)FPREG(rd) = info->res.val.q;
 		break;
--- old/usr/src/lib/libm/common/m9x/__fex_sse.c	2014-05-04 03:06:18.139734559 +0200
+++ new/usr/src/lib/libm/common/m9x/__fex_sse.c	2014-05-04 03:06:18.169694625 +0200
@@ -243,7 +243,7 @@
 			    fp_reg_set.fpchip_state.xmm[r];
 		}
 	} else if ((modrm & 0xc7) == 0x05) {
-#if defined(__amd64)
+#ifdef __amd64
 		/* address of next instruction + offset */
 		r = i + 4;
 		if (inst->op == cmpss || inst->op == cmpps ||
@@ -262,7 +262,7 @@
 			sib = ip[i++];
 			if ((sib & 7) == 5 && (modrm >> 6) == 0) {
 				/* start with absolute address */
-				addr = (char *)(uintptr_t)(ip + i);
+				addr = (char *)(uintptr_t)(*(int *)(ip + i));
 				i += 4;
 			} else {
 				/* start with base */
@@ -370,6 +370,8 @@
 	case cvttss2siq:
 	case cvttsd2siq:
 		return fex_inv_int;
+	default:
+		break;
 	}
 
 	/* check op1 for signaling nan */
@@ -411,6 +413,8 @@
 			return fex_inv_zdz;
 		if (t1 == fp_infinity && t2 == fp_infinity)
 			return fex_inv_idi;
+	default:
+		break;
 	}
 
 	return (enum fex_exception)-1;
@@ -638,6 +642,8 @@
 			info->res.type = fex_nodata;
 			sse_comisd(&info->op1.val.d, &info->op2.val.d);
 			break;
+		default:
+			break;
 		}
 	} else {
 		if (inst->op == cvtsi2ss) {
@@ -791,6 +797,8 @@
 			info->res.type = fex_nodata;
 			sse_comiss(&info->op1.val.f, &info->op2.val.f);
 			break;
+		default:
+			break;
 		}
 	}
 	__fenv_getmxcsr(&mxcsr);
@@ -1083,6 +1091,8 @@
 			dummy.op2 = (sseoperand_t *)&inst->op2->d[i];
 			e[i] = __fex_get_sse_op(uap, &dummy, &info[i]);
 		}
+	default:
+		break;
 	}
 }
 
@@ -1098,10 +1108,10 @@
 __fex_st_sse_result(ucontext_t *uap, sseinst_t *inst, enum fex_exception e,
     fex_info_t *info)
 {
-	int		i;
-	long long	l;
-	float		f, fscl;
-	double		d, dscl;
+	int		i = 0;
+	long long	l = 0L;;
+	float		f = 0.0, fscl;
+	double		d = 0.0L, dscl;
 
 	/* for compares that write eflags, just set the flags
 	   to indicate "unordered" */
@@ -1228,6 +1238,9 @@
 		case fex_ldouble:
 			i = info->res.val.q;
 			break;
+
+		default:
+			break;
 		}
 		inst->op1->i[0] = i;
 	} else if (inst->op == cmpsd || inst->op == cvttss2siq ||
@@ -1253,6 +1266,9 @@
 		case fex_ldouble:
 			l = info->res.val.q;
 			break;
+
+		default:
+			break;
 		}
 		inst->op1->l[0] = l;
 	} else if ((((int)inst->op & DOUBLE) && inst->op != cvtsd2ss) ||
@@ -1277,6 +1293,9 @@
 		case fex_ldouble:
 			d = info->res.val.q;
 			break;
+
+		default:
+			break;
 		}
 		inst->op1->d[0] = d;
 	} else {
@@ -1300,6 +1319,9 @@
 		case fex_ldouble:
 			f = info->res.val.q;
 			break;
+
+		default:
+			break;
 		}
 		inst->op1->f[0] = f;
 	}
@@ -1578,5 +1600,9 @@
 		}
 		/* zero the high 64 bits of the destination */
 		inst->op1->l[1] = 0ll;
+
+	default:
+		break;
 	}
 }
+
--- old/usr/src/lib/libm/common/m9x/fdim.c	2014-05-04 03:06:20.170474739 +0200
+++ new/usr/src/lib/libm/common/m9x/fdim.c	2014-05-04 03:06:20.199273295 +0200
@@ -44,11 +44,7 @@
 
 double
 __fdim(double x, double y) {
-#if defined(COMPARISON_MACRO_BUG)
-	if (x == x && y == y && x <= y) {	/* } */
-#else
 	if (islessequal(x, y)) {
-#endif
 		x = 0.0;
 		y = -x;
 	}
--- old/usr/src/lib/libm/common/m9x/fdimf.c	2014-05-04 03:06:21.900546712 +0200
+++ new/usr/src/lib/libm/common/m9x/fdimf.c	2014-05-04 03:06:21.930736164 +0200
@@ -47,11 +47,7 @@
 	 * fmovsle	%fcc0,%f3,%f1
 	 * fsubs	%f0,%f1,%f0
 	 */
-#if defined(COMPARISON_MACRO_BUG)
-	if (x == x && y == y && x <= y) {	/* } */
-#else
 	if (islessequal(x, y)) {
-#endif
 		x = 0.0f;
 		y = -x;
 	}
--- old/usr/src/lib/libm/common/m9x/fdiml.c	2014-05-04 03:06:23.475611153 +0200
+++ new/usr/src/lib/libm/common/m9x/fdiml.c	2014-05-04 03:06:23.499163732 +0200
@@ -35,11 +35,7 @@
 
 long double
 __fdiml(long double x, long double y) {
-#if defined(COMPARISON_MACRO_BUG)
-	if (x == x && y == y && x <= y) {
-#else
 	if (islessequal(x, y)) {
-#endif
 		x = 0.0l;
 		y = -x;
 	}
--- old/usr/src/lib/libm/common/m9x/fenv_inlines.h	2014-05-04 03:06:24.742450005 +0200
+++ new/usr/src/lib/libm/common/m9x/fenv_inlines.h	2014-05-04 03:06:24.772096466 +0200
@@ -42,13 +42,12 @@
 extern __inline__ void
 __fenv_getcwsw(unsigned int *value)
 {
-	union fp_cwsw ret;
+	union fp_cwsw *u = (union fp_cwsw *)value;
 
 	__asm__ __volatile__(
 	    "fstsw %0\n\t"
 	    "fstcw %1\n\t"
-	    : "=m" (ret.words.cw), "=m" (ret.words.sw));
-	*value = ret.cwsw;
+	    : "=m" (u->words.cw), "=m" (u->words.sw));
 }
 
 extern __inline__ void
@@ -66,7 +65,7 @@
 	    "fldenv %0\n\t"
 	    "fwait\n\t"
 	    : "=m" (fenv), "=m" (fenv[0]), "=m" (fenv[2])
-	    : "d" (cwsw.words.cw), "c" (cwsw.words.sw)
+	    : "r" (cwsw.words.cw), "r" (cwsw.words.sw)
 	    /* For practical purposes, we clobber the whole FPU */
 	    : "cc", "st", "st(1)", "st(2)", "st(3)", "st(4)", "st(5)",
 	      "st(6)", "st(7)");
@@ -75,7 +74,7 @@
 extern __inline__ void
 __fenv_getmxcsr(unsigned int *value)
 {
-	__asm__ __volatile__("stmxcsr %1" : "+m" (*value));
+	__asm__ __volatile__("stmxcsr %0" : "=m" (*value));
 }
 
 extern __inline__ void
@@ -89,7 +88,7 @@
 {
 	long double ret;
 
-	__asm__ __volatile__("f2xm1" : "=t" (ret) : "0" (x));
+	__asm__ __volatile__("f2xm1" : "=t" (ret) : "0" (x) : "cc");
 	return (ret);
 }
 
@@ -98,7 +97,10 @@
 {
 	long double ret;
 
-	__asm__ __volatile__("fyl2x" : "=t" (ret): "0" (x), "u" (y) : "st(1)");
+	__asm__ __volatile__("fyl2x"
+	    : "=t" (ret)
+	    : "0" (x), "u" (y)
+	    : "st(1)", "cc");
 	return (ret);
 }
 
@@ -112,7 +114,10 @@
 	long double ret;
 	long double dummy;
 
-	__asm__ __volatile__("fptan" : "=t" (dummy), "=u" (ret) : "0" (x));
+	__asm__ __volatile__("fptan"
+	    : "=t" (dummy), "=u" (ret)
+	    : "0" (x)
+	    : "cc");
 	return (ret);
 }
 
@@ -124,35 +129,29 @@
 	__asm__ __volatile__("fpatan"
 	    : "=t" (ret)
 	    : "0" (y), "u" (x)
-	    : "st(1)");
+	    : "st(1)", "cc");
 	return (ret);
 }
 
 extern __inline__ long double
 fxtract(long double x)
 {
-	long double ret;
-
-	__asm__ __volatile__("fxtract" : "=t" (ret) : "0" (x));
-	return (ret);
+	__asm__ __volatile__("fxtract" : "+t" (x) : : "cc");
+	return (x);
 }
 
 extern __inline__ long double
 fprem1(long double idend, long double div)
 {
-	long double ret;
-
-	__asm__ __volatile__("fprem1" : "=t" (ret) : "0" (div), "u" (idend));
-	return (ret);
+	__asm__ __volatile__("fprem1" : "+t" (div) : "u" (idend) : "cc");
+	return (div);
 }
 
 extern __inline__ long double
 fprem(long double idend, long double div)
 {
-	long double ret;
-
-	__asm__ __volatile__("fprem" : "=t" (ret) : "0" (div), "u" (idend));
-	return (ret);
+	__asm__ __volatile__("fprem" : "+t" (div) : "u" (idend) : "cc");
+	return (div);
 }
 
 extern __inline__ long double
@@ -163,35 +162,29 @@
 	__asm__ __volatile__("fyl2xp1"
 	    : "=t" (ret)
 	    : "0" (x), "u" (y)
-	    : "st(1)");
+	    : "st(1)", "cc");
 	return (ret);
 }
 
 extern __inline__ long double
 fsqrt(long double x)
 {
-	long double ret;
-
-	__asm__ __volatile__("fsqrt" : "=t" (ret) : "0" (x));
-	return (ret);
+	__asm__ __volatile__("fsqrt" : "+t" (x) : : "cc");
+	return (x);
 }
 
 extern __inline__ long double
 fsincos(long double x)
 {
-	long double ret;
-
-	__asm__ __volatile__("fsincos" : "=t" (ret) : "0" (x));
-	return (ret);
+	__asm__ __volatile__("fsincos" : "+t" (x) : : "cc");
+	return (x);
 }
 
 extern __inline__ long double
 frndint(long double x)
 {
-	long double ret;
-
-	__asm__ __volatile__("frndint" : "=t" (ret) : "0" (x));
-	return (ret);
+	__asm__ __volatile__("frndint" : "+t" (x) : : "cc");
+	return (x);
 }
 
 extern __inline__ long double
@@ -199,26 +192,22 @@
 {
 	long double ret;
 
-	__asm__ __volatile__("fscale" : "=t" (ret) : "0" (y), "u" (x));
+	__asm__ __volatile__("fscale" : "=t" (ret) : "0" (y), "u" (x) : "cc");
 	return (ret);
 }
 
 extern __inline__ long double
 fsin(long double x)
 {
-	long double ret;
-
-	__asm__ __volatile__("fsin" : "=t" (ret) : "0" (x));
-	return (ret);
+	__asm__ __volatile__("fsin" : "+t" (x) : : "cc");
+	return (x);
 }
 
 extern __inline__ long double
 fcos(long double x)
 {
-	long double ret;
-
-	__asm__ __volatile__("fcos" : "=t" (ret) : "0" (x));
-	return (ret);
+	__asm__ __volatile__("fcos" : "+t" (x) : : "cc");
+	return (x);
 }
 
 extern __inline__ void
@@ -227,8 +216,9 @@
 	__asm__ __volatile__(
 	    "cmpeqss %2, %1\n\t"
 	    "movss   %1, %0"
-	    : "=m" (*i1)
-	    : "x" (*f1), "x" (*f2));
+	    : "=m" (*i1), "+x" (*f1)
+	    : "x" (*f2)
+	    : "cc");
 }
 
 extern __inline__ void
@@ -237,8 +227,9 @@
 	__asm__ __volatile__(
 	    "cmpltss %2, %1\n\t"
 	    "movss   %1, %0"
-	    : "=m" (*i1)
-	    : "x" (*f1), "x" (*f2));
+	    : "=m" (*i1), "+x" (*f1)
+	    : "x" (*f2)
+	    : "cc");
 }
 
 extern __inline__ void
@@ -247,8 +238,9 @@
 	__asm__ __volatile__(
 	    "cmpless %2, %1\n\t"
 	    "movss   %1, %0"
-	    : "=m" (*i1)
-	    : "x" (*f1), "x" (*f2));
+	    : "=m" (*i1), "+x" (*f1)
+	    : "x" (*f2)
+	    : "cc");
 }
 
 extern __inline__ void
@@ -257,8 +249,9 @@
 	__asm__ __volatile__(
 	    "cmpunordss %2, %1\n\t"
 	    "movss      %1, %0"
-	    : "=m" (*i1)
-	    : "x" (*f1), "x" (*f2));
+	    : "=m" (*i1), "+x" (*f1)
+	    : "x" (*f2)
+	    : "cc");
 }
 
 extern __inline__ void
@@ -267,8 +260,8 @@
 	__asm__ __volatile__(
 	    "minss %2, %1\n\t"
 	    "movss %1, %0"
-	    : "=m" (*f3)
-	    : "x" (*f1), "x" (*f2));
+	    : "=m" (*f3), "+x" (*f1)
+	    : "x" (*f2));
 }
 
 extern __inline__ void
@@ -277,8 +270,8 @@
 	__asm__ __volatile__(
 	    "maxss %2, %1\n\t"
 	    "movss %1, %0"
-	    : "=m" (*f3)
-	    : "x" (*f1), "x" (*f2));
+	    : "=m" (*f3), "+x" (*f1)
+	    : "x" (*f2));
 }
 
 extern __inline__ void
@@ -287,8 +280,8 @@
 	__asm__ __volatile__(
 	    "addss %2, %1\n\t"
 	    "movss %1, %0"
-	    : "=m" (*f3)
-	    : "x" (*f1), "x" (*f2));
+	    : "=m" (*f3), "+x" (*f1)
+	    : "x" (*f2));
 }
 
 extern __inline__ void
@@ -297,8 +290,8 @@
 	__asm__ __volatile__(
 	    "subss %2, %1\n\t"
 	    "movss %1, %0"
-	    : "=m" (*f3)
-	    : "x" (*f1), "x" (*f2));
+	    : "=m" (*f3), "+x" (*f1)
+	    : "x" (*f2));
 }
 
 extern __inline__ void
@@ -307,8 +300,8 @@
 	__asm__ __volatile__(
 	    "mulss %2, %1\n\t"
 	    "movss %1, %0"
-	    : "=m" (*f3)
-	    : "x" (*f1), "x" (*f2));
+	    : "=m" (*f3), "+x" (*f1)
+	    : "x" (*f2));
 }
 
 extern __inline__ void
@@ -317,19 +310,20 @@
 	__asm__ __volatile__(
 	    "divss %2, %1\n\t"
 	    "movss %1, %0"
-	    : "=m" (*f3)
-	    : "x" (*f1), "x" (*f2));
+	    : "=m" (*f3), "+x" (*f1)
+	    : "x" (*f2));
 }
 
 extern __inline__ void
 sse_sqrtss(float *f1, float *f2)
 {
+	double tmp;
+
 	__asm__ __volatile__(
-	    "sqrtss %1, %%xmm0\n\t"
-	    "movss  %%xmm0, %0"
-	    : "=m" (*f2)
-	    : "m" (*f1)
-	    : "xmm0");
+	    "sqrtss %2, %1\n\t"
+	    "movss  %1, %0"
+	    : "=m" (*f2), "=x" (tmp)
+	    : "m" (*f1));
 }
 
 extern __inline__ void
@@ -348,79 +342,86 @@
 extern __inline__ void
 sse_cvtss2sd(float *f1, double *d1)
 {
+	double tmp;
+
 	__asm__ __volatile__(
-	    "cvtss2sd %1, %%xmm0\n\t"
-	    "movsd    %%xmm0, %0"
-	    : "=m" (*d1)
-	    : "m" (*f1)
-	    : "xmm0");
+	    "cvtss2sd %2, %1\n\t"
+	    "movsd    %1, %0"
+	    : "=m" (*d1), "=x" (tmp)
+	    : "m" (*f1));
 }
 
 extern __inline__ void
 sse_cvtsi2ss(int *i1, float *f1)
 {
+	double tmp;
+
 	__asm__ __volatile__(
-	    "cvtsi2ss %1, %%xmm0\n\t"
-	    "movss    %%xmm0, %0"
-	    : "=m" (*f1)
-	    : "m" (*i1)
-	    : "xmm0");
+	    "cvtsi2ss %2, %1\n\t"
+	    "movss    %1, %0"
+	    : "=m" (*f1), "=x" (tmp)
+	    : "m" (*i1));
 }
 
 extern __inline__ void
 sse_cvttss2si(float *f1, int *i1)
 {
+	int tmp;
+
 	__asm__ __volatile__(
-	    "cvttss2si %1, %%ecx\n\t"
-	    "movl      %%ecx, %0"
-	    : "=m" (*i1)
-	    : "m" (*f1)
-	    : "ecx");
+	    "cvttss2si %2, %1\n\t"
+	    "movl      %1, %0"
+	    : "=m" (*i1), "=r" (tmp)
+	    : "m" (*f1));
 }
 
 extern __inline__ void
 sse_cvtss2si(float *f1, int *i1)
 {
+	int tmp;
+
 	__asm__ __volatile__(
-	    "cvtss2si %1, %%ecx\n\t"
-	    "movl     %%ecx, %0"
-	    : "=m" (*i1)
-	    : "m" (*f1)
-	    : "ecx");
+	    "cvtss2si %2, %1\n\t"
+	    "movl     %1, %0"
+	    : "=m" (*i1), "=r" (tmp)
+	    : "m" (*f1));
 }
 
 #if defined(__amd64)
 extern __inline__ void
 sse_cvtsi2ssq(long long *ll1, float *f1)
 {
+	double tmp;
+
 	__asm__ __volatile__(
-	    "cvtsi2ssq %1, %%xmm0\n\t"
-	    "movss     %%xmm0, %0"
-	    : "=m" (*f1)
-	    : "m" (*ll1)
-	    : "xmm0");
+	    "cvtsi2ssq %2, %1\n\t"
+	    "movss     %1, %0"
+	    : "=m" (*f1), "=x" (tmp)
+	    : "m" (*ll1));
 }
 
 extern __inline__ void
 sse_cvttss2siq(float *f1, long long *ll1)
 {
+	uint64_t tmp;
+
 	__asm__ __volatile__(
-	    "cvttss2siq %1, %%rcx\n\t"
-	    "movq       %%rcx, %0"
-	    : "=m" (*ll1)
-	    : "m" (*f1)
-	    : "rcx");
+	    "cvttss2siq %2, %1\n\t"
+	    "movq       %1, %0"
+	    : "=m" (*ll1), "=r" (tmp)
+	    : "m" (*f1));
 }
 
 extern __inline__ void
 sse_cvtss2siq(float *f1, long long *ll1)
 {
+	uint64_t tmp;
+
 	__asm__ __volatile__(
-	    "cvtss2siq %1, %%rcx\n\t"
-	    "movq      %%rcx, %0"
-	    : "=m" (*ll1)
-	    : "m" (*f1)
-	    : "rcx");
+	    "cvtss2siq %2, %1\n\t"
+	    "movq      %1, %0"
+	    : "=m" (*ll1), "=r" (tmp)
+	    : "m" (*f1));
 }
 
 #endif
@@ -431,8 +432,8 @@
 	__asm__ __volatile__(
 	    "cmpeqsd %2,%1\n\t"
 	    "movsd   %1,%0"
-	    : "=m" (*ll1)
-	    : "x" (*d1), "x" (*d2));
+	    : "=m" (*ll1), "=x" (*d1)
+	    : "x" (*d2));
 }
 
 extern __inline__ void
@@ -441,8 +442,8 @@
 	__asm__ __volatile__(
 	    "cmpltsd %2,%1\n\t"
 	    "movsd   %1,%0"
-	    : "=m" (*ll1)
-	    : "x" (*d1), "x" (*d2));
+	    : "=m" (*ll1), "=x" (*d1)
+	    : "x" (*d2));
 }
 
 extern __inline__ void
@@ -451,8 +452,8 @@
 	__asm__ __volatile__(
 	    "cmplesd %2,%1\n\t"
 	    "movsd   %1,%0"
-	    : "=m" (*ll1)
-	    : "x" (*d1), "x" (*d2));
+	    : "=m" (*ll1), "=x" (*d1)
+	    : "x" (*d2));
 }
 
 extern __inline__ void
@@ -461,8 +462,8 @@
 	__asm__ __volatile__(
 	    "cmpunordsd %2,%1\n\t"
 	    "movsd      %1,%0"
-	    : "=m" (*ll1)
-	    : "x" (*d1), "x" (*d2));
+	    : "=m" (*ll1), "=x" (*d1)
+	    : "x" (*d2));
 }
 
 
@@ -472,8 +473,8 @@
 	__asm__ __volatile__(
 	    "minsd %2,%1\n\t"
 	    "movsd %1,%0"
-	    : "=m" (*d3)
-	    : "x" (*d1), "x" (*d2));
+	    : "=m" (*d3), "=x" (*d1)
+	    : "x" (*d2));
 }
 
 extern __inline__ void
@@ -482,8 +483,8 @@
 	__asm__ __volatile__(
 	    "maxsd %2,%1\n\t"
 	    "movsd %1,%0"
-	    : "=m" (*d3)
-	    : "x" (*d1), "x" (*d2));
+	    : "=m" (*d3), "=x" (*d1)
+	    : "x" (*d2));
 }
 
 extern __inline__ void
@@ -492,8 +493,8 @@
 	__asm__ __volatile__(
 	    "addsd %2,%1\n\t"
 	    "movsd %1,%0"
-	    : "=m" (*d3)
-	    : "x" (*d1), "x" (*d2));
+	    : "=m" (*d3), "=x" (*d1)
+	    : "x" (*d2));
 }
 
 extern __inline__ void
@@ -502,8 +503,8 @@
 	__asm__ __volatile__(
 	    "subsd %2,%1\n\t"
 	    "movsd %1,%0"
-	    : "=m" (*d3)
-	    : "x" (*d1), "x" (*d2));
+	    : "=m" (*d3), "=x" (*d1)
+	    : "x" (*d2));
 }
 
 extern __inline__ void
@@ -512,8 +513,8 @@
 	__asm__ __volatile__(
 	    "mulsd %2,%1\n\t"
 	    "movsd %1,%0"
-	    : "=m" (*d3)
-	    : "x" (*d1), "x" (*d2));
+	    : "=m" (*d3), "=x" (*d1)
+	    : "x" (*d2));
 }
 
 extern __inline__ void
@@ -522,20 +523,20 @@
 	__asm__ __volatile__(
 	    "divsd %2,%1\n\t"
 	    "movsd %1,%0"
-	    : "=m" (*d3)
-	    : "x" (*d1), "x" (*d2)
-	    : "xmm0");
+	    : "=m" (*d3), "=x" (*d1)
+	    : "x" (*d2));
 }
 
 extern __inline__ void
 sse_sqrtsd(double *d1, double *d2)
 {
+	double tmp;
+
 	__asm__ __volatile__(
-	    "sqrtsd %1, %%xmm0\n\t"
-	    "movsd %%xmm0, %0"
-	    : "=m" (*d2)
-	    : "m" (*d1)
-	    : "xmm0");
+	    "sqrtsd %2, %1\n\t"
+	    "movsd %1, %0"
+	    : "=m" (*d2), "=x" (tmp)
+	    : "m" (*d1));
 }
 
 extern __inline__ void
@@ -553,117 +554,123 @@
 extern __inline__ void
 sse_cvtsd2ss(double *d1, float *f1)
 {
+	double tmp;
+
 	__asm__ __volatile__(
-	    "cvtsd2ss %1,%%xmm0\n\t"
-	    "movss    %%xmm0,%0"
-	    : "=m" (*f1)
-	    : "m" (*d1)
-	    : "xmm0");
+	    "cvtsd2ss %2,%1\n\t"
+	    "movss    %1,%0"
+	    : "=m" (*f1), "=x" (tmp)
+	    : "m" (*d1));
 }
 
-
 extern __inline__ void
 sse_cvtsi2sd(int *i1, double *d1)
 {
+	double tmp;
 	__asm__ __volatile__(
-	    "cvtsi2sd %1,%%xmm0\n\t"
-	    "movsd    %%xmm0,%0"
-	    : "=m" (*d1)
-	    : "m" (*i1)
-	    : "xmm0");
+	    "cvtsi2sd %2,%1\n\t"
+	    "movsd    %1,%0"
+	    : "=m" (*d1), "=x" (tmp)
+	    : "m" (*i1));
 }
 
 extern __inline__ void
 sse_cvttsd2si(double *d1, int *i1)
 {
+	int tmp;
+
 	__asm__ __volatile__(
-	    "cvttsd2si %1,%%ecx\n\t"
-	    "movl      %%ecx,%0"
-	    : "=m" (*i1)
-	    : "m" (*d1)
-	    : "ecx");
+	    "cvttsd2si %2,%1\n\t"
+	    "movl      %1,%0"
+	    : "=m" (*i1), "=r" (tmp)
+	    : "m" (*d1));
 }
 
 extern __inline__ void
 sse_cvtsd2si(double *d1, int *i1)
 {
+	int tmp;
+
 	__asm__ __volatile__(
-	    "cvtsd2si %1,%%ecx\n\t"
-	    "movl     %%ecx,%0"
-	    : "=m" (*i1)
-	    : "m" (*d1)
-	    : "ecx");
+	    "cvtsd2si %2,%1\n\t"
+	    "movl     %1,%0"
+	    : "=m" (*i1), "=r" (tmp)
+	    : "m" (*d1));
 }
 
 #if defined(__amd64)
 extern __inline__ void
 sse_cvtsi2sdq(long long *ll1, double *d1)
 {
+	double tmp;
+
 	__asm__ __volatile__(
-	    "cvtsi2sdq %1,%%xmm0\n\t"
-	    "movsd     %%xmm0,%0"
-	    : "=m" (*d1)
-	    : "m" (*ll1)
-	    : "xmm0");
+	    "cvtsi2sdq %2,%1\n\t"
+	    "movsd     %1,%0"
+	    : "=m" (*d1), "=x" (tmp)
+	    : "m" (*ll1));
 }
 
 extern __inline__ void
 sse_cvttsd2siq(double *d1, long long *ll1)
 {
+	uint64_t tmp;
+
 	__asm__ __volatile__(
-	    "cvttsd2siq %1,%%rcx\n\t"
-	    "movq       %%rcx,%0"
-	    : "=m" (*ll1)
-	    : "m" (*d1)
-	    : "rcx");
+	    "cvttsd2siq %2,%1\n\t"
+	    "movq       %1,%0"
+	    : "=m" (*ll1), "=r" (tmp)
+	    : "m" (*d1));
 }
 
 extern __inline__ void
 sse_cvtsd2siq(double *d1, long long *ll1)
 {
+	uint64_t tmp;
+
 	__asm__ __volatile__(
-	    "cvtsd2siq %1,%%rcx\n\t"
-	    "movq      %%rcx,%0"
-	    : "=m" (*ll1)
-	    : "m" (*d1)
-	    : "rcx");
+	    "cvtsd2siq %2,%1\n\t"
+	    "movq      %1,%0"
+	    : "=m" (*ll1), "=r" (tmp)
+	    : "m" (*d1));
 }
 #endif
+
 #elif defined(__sparc)
 extern __inline__ void
 __fenv_getfsr(unsigned long *l)
 {
-    __asm__ __volatile__(
+	__asm__ __volatile__(
 #if defined(__sparcv9)
-        "stx %%fsr,%0\n\t"
+		"stx %%fsr,%0\n\t"
 #else
-        "st  %%fsr,%0\n\t"
+		"st  %%fsr,%0\n\t"
 #endif
-        : "=m" (*l));
+		: "=m" (*l));
 }
 
 extern __inline__ void
 __fenv_setfsr(const unsigned long *l)
 {
-    __asm__ __volatile__(
+	__asm__ __volatile__(
 #if defined(__sparcv9)
-        "ldx %0,%%fsr\n\t"
+		"ldx %0,%%fsr\n\t"
 #else
-        "ld %0,%%fsr\n\t"
+		"ld %0,%%fsr\n\t"
 #endif
-        : : "m" (*l));
+		: : "m" (*l) : "cc");
 }
 
 extern __inline__ void
 __fenv_getfsr32(unsigned int *l)
 {
-    __asm__ __volatile__("st %%fsr,%0\n\t" : "=m" (*l));
+	__asm__ __volatile__("st %%fsr,%0\n\t" : "=m" (*l));
 }
 
 extern __inline__ void
 __fenv_setfsr32(const unsigned int *l)
 {
-    __asm__ __volatile__("ld %0,%%fsr\n\t" : : "m" (*l));
+	__asm__ __volatile__("ld %0,%%fsr\n\t" : : "m" (*l));
 }
 #else
 #error "GCC FENV inlines not implemented for this platform"
--- old/usr/src/lib/libm/common/m9x/fex_handler.h	2014-05-04 03:06:27.198496344 +0200
+++ new/usr/src/lib/libm/common/m9x/fex_handler.h	2014-05-04 03:06:27.213078526 +0200
@@ -27,8 +27,6 @@
  * Use is subject to license terms.
  */
 
-/* #include <sys/isa_defs.h> */
-
 /* the following enums must match the bit positions in fenv.h */
 enum fex_exception {
 	fex_inexact		= 0,
@@ -65,7 +63,7 @@
 
 /* inline templates and macros for accessing fp state */
 extern void __fenv_getfsr(unsigned long *);
-extern void __fenv_setfsr(unsigned const long *);
+extern void __fenv_setfsr(const unsigned long *);
 
 #if defined(__sparc)
 
--- old/usr/src/lib/libm/common/m9x/fex_log.c	2014-05-04 03:06:29.486287752 +0200
+++ new/usr/src/lib/libm/common/m9x/fex_log.c	2014-05-04 03:06:29.515834354 +0200
@@ -122,7 +122,7 @@
 static int check_exc_list(char *addr, unsigned long code, char *stk,
     struct frame *fp)
 {
-	struct exc_list	*l, *ll;
+	struct exc_list	*l, *ll = NULL;
 	struct frame	*f;
 	int		i, n;
 
--- old/usr/src/lib/libm/common/m9x/fma.c	2014-05-04 03:06:31.227196182 +0200
+++ new/usr/src/lib/libm/common/m9x/fma.c	2014-05-04 03:06:31.253623706 +0200
@@ -76,8 +76,7 @@
 		double d;
 	} xx, yy, zz;
 	double xhi, yhi, xlo, ylo, t;
-	unsigned xy0, xy1, xy2, xy3, z0, z1, z2, z3, rm, sticky;
-	unsigned int fsr;
+	unsigned int xy0, xy1, xy2, xy3, z0, z1, z2, z3, fsr, rm, sticky;
 	int hx, hy, hz, ex, ey, ez, exy, sxy, sz, e, ibit;
 	volatile double	dummy;
 
@@ -493,119 +492,6 @@
 	return ((double) yy.e);
 }
 
-#if 0
-/*
- * another fma for x86: assumes return value will be left in
- * long double (80-bit double extended) precision
- */
-long double
-__fma(double x, double y, double z) {
-	union {
-		unsigned i[3];
-		long double e;
-	} xx, yy, zz, tt;
-	long double xe, ye, xhi, xlo, yhi, ylo, zhi, zlo;
-	int ex, ey, ez;
-	unsigned cwsw, oldcwsw, s;
-
-	/* convert the operands to double extended */
-	xx.e = (long double) x;
-	yy.e = (long double) y;
-	zz.e = (long double) z;
-
-	/* extract the exponents of the arguments */
-	ex = xx.i[2] & 0x7fff;
-	ey = yy.i[2] & 0x7fff;
-	ez = zz.i[2] & 0x7fff;
-
-	/* dispense with inf, nan, and zero cases */
-	if (ex == 0x7fff || ey == 0x7fff || ex == 0 || ey == 0)
-		/* x or y is inf, nan, or zero */
-		return (xx.e * yy.e + zz.e);
-
-	if (ez >= 0x7fff) /* z is inf or nan */
-		return (xx.e + zz.e);	/* avoid spurious inexact in x * y */
-
-	if (ez == 0) /* z is zero */
-		return (xx.e * yy.e);	/* x * y isn't zero; no need to add z */
-
-	/*
-	 * save the control and status words, mask all exceptions, and
-	 * set rounding to 64-bit precision and to-nearest
-	 */
-	__fenv_getcwsw(&oldcwsw);
-	cwsw = (oldcwsw & 0xf0c0ffff) | 0x033f0000;
-	__fenv_setcwsw(&cwsw);
-
-	/* multiply x*y to 106 bits */
-	xe = xx.e;
-	xx.i[0] = 0;
-	xhi = xx.e; /* hi 32 bits */
-	xlo = xe - xhi; /* lo 21 bits */
-	ye = yy.e;
-	yy.i[0] = 0;
-	yhi = yy.e;
-	ylo = ye - yhi;
-	xx.e = xe * ye;
-	xx.i[0] &= ~0x7ff; /* 53 bits of x*y */
-	yy.e = ((xhi * yhi - xx.e) + xhi * ylo + xlo * yhi) + xlo * ylo;
-
-	/* reduce to a sum of two terms */
-	if (yy.e != 0.0) {
-		ex = xx.i[2] & 0x7fff;
-		if (ez - ex > 10) {
-			/* collapse y into a single bit and add to x */
-			yy.i[0] = 0;
-			yy.i[1] = 0x80000000;
-			yy.i[2] = (yy.i[2] & 0x8000) | (ex - 60);
-			xx.e += yy.e;
-		} else if (ex - ez <= 10) {
-			xx.e += zz.e; /* exact */
-			zz.e = yy.e;
-		} else if (ex - ez <= 42) {
-			/* split z into two pieces */
-			tt.i[0] = 0;
-			tt.i[1] = 0x80000000;
-			tt.i[2] = ex + 11;
-			zhi = (zz.e + tt.e) - tt.e;
-			zlo = zz.e - zhi;
-			xx.e += zhi;
-			zz.e = yy.e + zlo;
-		} else if (ex - ez <= 63) {
-			zz.e += yy.e; /* exact */
-		} else if (ex - ez <= 106) {
-			/*
-			 * collapse the tail of z into a sticky bit and add z
-			 * to y without error
-			 */
-			if (ex - ez <= 81) {
-				s = 1 << (ex - ez - 50);
-				if (zz.i[0] & (s - 1))
-					zz.i[0] |= s;
-				zz.i[0] &= ~(s - 1);
-			} else {
-				s = 1 << (ex - ez - 82);
-				if ((zz.i[1] & (s - 1)) | zz.i[0])
-					zz.i[1] |= s;
-				zz.i[1] &= ~(s - 1);
-				zz.i[0] = 0;
-			}
-			zz.e += yy.e;
-		} else {
-			/* collapse z into a single bit and add to y */
-			zz.i[0] = 0;
-			zz.i[1] = 0x80000000;
-			zz.i[2] = (zz.i[2] & 0x8000) | (ex - 113);
-			zz.e += yy.e;
-		}
-	}
-
-	/* restore the control and status words, and sum */
-	__fenv_setcwsw(&oldcwsw);
-	return (xx.e + zz.e);
-}
-#endif
-
 #else
 #error Unknown architecture
 #endif
--- old/usr/src/lib/libm/common/m9x/fmal.c	2014-05-04 03:06:33.619621690 +0200
+++ new/usr/src/lib/libm/common/m9x/fmal.c	2014-05-04 03:06:33.649887126 +0200
@@ -84,17 +84,17 @@
 long double
 __fmal(long double x, long double y, long double z) {
 	union {
-		unsigned i[4];
+		unsigned int i[4];
 		long double q;
 	} xx, yy, zz;
 	union {
-		unsigned i[2];
+		unsigned int i[2];
 		double d;
 	} u;
 	double dx[5], dy[5], dxy[9], c, s;
-	unsigned xy0, xy1, xy2, xy3, xy4, xy5, xy6, xy7;
-	unsigned z0, z1, z2, z3, z4, z5, z6, z7;
-	unsigned rm, sticky;
+	unsigned int xy0, xy1, xy2, xy3, xy4, xy5, xy6, xy7;
+	unsigned int z0, z1, z2, z3, z4, z5, z6, z7;
+	unsigned int rm, sticky;
 	unsigned int fsr;
 	int hx, hy, hz, ex, ey, ez, exy, sxy, sz, e, ibit;
 	int cx, cy, cz;
--- old/usr/src/lib/libm/common/m9x/fmax.c	2014-05-04 03:06:34.957958649 +0200
+++ new/usr/src/lib/libm/common/m9x/fmax.c	2014-05-04 03:06:35.202981665 +0200
@@ -58,17 +58,12 @@
 	if (x != x)
 		x = y;
 
-	/* if x is less than y or x and y are unordered, replace x by y */
-#if defined(COMPARISON_MACRO_BUG)
-	if (x < y)
-#else
-	if (!isgreaterequal(x, y))
-#endif
+	/* At this point, x and y are either both numeric, or both NaN */
+	if (!isnan(x) && !isgreaterequal(x, y))
 		x = y;
 
 	/*
-	 * now x and y are either both NaN or both numeric; clear the
-	 * sign of the result if either x or y has its sign clear
+	 * clear the sign of the result if either x or y has its sign clear
 	 */
 	xx.d = x;
 	yy.d = y;
--- old/usr/src/lib/libm/common/m9x/fmaxf.c	2014-05-04 03:06:36.918424451 +0200
+++ new/usr/src/lib/libm/common/m9x/fmaxf.c	2014-05-04 03:06:36.949437226 +0200
@@ -127,17 +127,12 @@
 	if (x != x)
 		x = y;
 
-	/* if x is less than y or x and y are unordered, replace x by y */
-#if defined(COMPARISON_MACRO_BUG)
-	if (x < y)
-#else
-	if (!isgreaterequal(x, y))
-#endif
+	/* At this point, x and y are either both numeric, or both NaN */
+	if (!isnan(x) && !isgreaterequal(x, y))
 		x = y;
 
 	/*
-	 * now x and y are either both NaN or both numeric; clear the
-	 * sign of the result if either x or y has its sign clear
+	 * clear the sign of the result if either x or y has its sign clear
 	 */
 	xx.f = x;
 	yy.f = y;
--- old/usr/src/lib/libm/common/m9x/fmaxl.c	2014-05-04 03:06:38.433878046 +0200
+++ new/usr/src/lib/libm/common/m9x/fmaxl.c	2014-05-04 03:06:38.461931870 +0200
@@ -51,17 +51,16 @@
 	if (y != y)
 		y = x;
 
-	/* if x is less than y or x and y are unordered, replace x by y */
-#if defined(COMPARISON_MACRO_BUG)
-	if (x != x || x < y)
-#else
-	if (!isgreaterequal(x, y))
-#endif
+	/* if x is nan, replace it by y */
+	if (x != x)
+		x = y;
+
+	/* At this point, x and y are either both numeric, or both NaN */
+	if (!isnan(x) && !isgreaterequal(x, y))
 		x = y;
 
 	/*
-	 * now x and y are either both NaN or both numeric; clear the
-	 * sign of the result if either x or y has its sign clear
+	 * clear the sign of the result if either x or y has its sign clear
 	 */
 	xx.ld = x;
 	yy.ld = y;
--- old/usr/src/lib/libm/common/m9x/fmin.c	2014-05-04 03:06:39.230656496 +0200
+++ new/usr/src/lib/libm/common/m9x/fmin.c	2014-05-04 03:06:39.259578599 +0200
@@ -41,6 +41,8 @@
 
 #include "libm.h"	/* for islessequal macro */
 
+#include "fenv_inlines.h"
+#include <stdio.h>
 #include <sys/isa_defs.h>
 
 double
@@ -50,7 +52,7 @@
 		double d;
 	} xx, yy;
 	unsigned s;
-
+	
 	/* if y is nan, replace it by x */
 	if (y != y)
 		y = x;
@@ -59,17 +61,12 @@
 	if (x != x)
 		x = y;
 
-	/* if x is greater than y or x and y are unordered, replace x by y */
-#if defined(COMPARISON_MACRO_BUG)
-	if (x != x || x > y)
-#else
-	if (!islessequal(x, y))
-#endif
+	/* At this point, x and y are either both numeric, or both NaN */
+	if (!isnan(x) && !islessequal(x, y))
 		x = y;
 
 	/*
-	 * now x and y are either both NaN or both numeric; set the
-	 * sign of the result if either x or y has its sign set
+	 * set the sign of the result if either x or y has its sign set
 	 */
 	xx.d = x;
 	yy.d = y;
--- old/usr/src/lib/libm/common/m9x/fminf.c	2014-05-04 03:06:40.750780777 +0200
+++ new/usr/src/lib/libm/common/m9x/fminf.c	2014-05-04 03:06:40.994481746 +0200
@@ -86,17 +86,12 @@
 	if (x != x)
 		x = y;
 
-/* if x is greater than y or x and y are unordered, replace x by y */
-#if defined(COMPARISON_MACRO_BUG)
-	if (x > y)
-#else
-	if (!islessequal(x, y))
-#endif
+	/* At this point, x and y are either both numeric, or both NaN */
+	if (!isnan(x) && !islessequal(x, y))
 		x = y;
 
 	/*
-	 * now x and y are either both NaN or both numeric; set the
-	 * sign of the result if either x or y has its sign set
+	 * set the sign of the result if either x or y has its sign set
 	 */
 	xx.f = x;
 	yy.f = y;
--- old/usr/src/lib/libm/common/m9x/fminl.c	2014-05-04 03:06:43.033018327 +0200
+++ new/usr/src/lib/libm/common/m9x/fminl.c	2014-05-04 03:06:43.063122525 +0200
@@ -51,17 +51,16 @@
 	if (y != y)
 		y = x;
 
-	/* if x is greater than y or x and y are unordered, replace x by y */
-#if defined(COMPARISON_MACRO_BUG)
-	if (x != x || x > y)
-#else
-	if (!islessequal(x, y))
-#endif
+	/* if x is nan, replace it by y */
+	if (x != x)
+		x = y;
+
+	/* At this point, x and y are either both numeric, or both NaN */
+	if (!isnan(x) && !islessequal(x, y))
 		x = y;
 
 	/*
-	 * now x and y are either both NaN or both numeric; set the
-	 * sign of the result if either x or y has its sign set
+	 * set the sign of the result if either x or y has its sign set
 	 */
 	xx.ld = x;
 	yy.ld = y;
--- old/usr/src/lib/libm/common/m9x/llrintl.c	2014-05-04 03:06:44.440435197 +0200
+++ new/usr/src/lib/libm/common/m9x/llrintl.c	2014-05-04 03:06:44.667613689 +0200
@@ -56,8 +56,7 @@
 		unsigned i;
 		float f;
 	} tt;
-	unsigned int hx, sx, frac;
-	unsigned int fsr;
+	unsigned int hx, sx, frac, fsr;
 	int rm, j;
 	volatile float dummy;
 
--- old/usr/src/lib/libm/common/m9x/lrintl.c	2014-05-04 03:06:46.772542518 +0200
+++ new/usr/src/lib/libm/common/m9x/lrintl.c	2014-05-04 03:06:46.579540653 +0200
@@ -43,15 +43,14 @@
 long
 lrintl(long double x) {
 	union {
-		unsigned i[4];
+		unsigned int i[4];
 		long double q;
 	} xx;
 	union {
-		unsigned i;
+		unsigned int i;
 		float f;
 	} tt;
-	unsigned hx, sx, frac, l;
-	unsigned int fsr;
+	unsigned int hx, sx, frac, l, fsr;
 	int rm, j;
 	volatile float dummy;
 
--- old/usr/src/lib/libm/common/m9x/nan.c	2014-05-04 03:06:48.500452919 +0200
+++ new/usr/src/lib/libm/common/m9x/nan.c	2014-05-04 03:06:48.530339124 +0200
@@ -38,20 +38,22 @@
 #include "libm.h"
 #include <sys/isa_defs.h>
 
-#if defined(_BIG_ENDIAN)
+#if defined(__sparc)
 
 static const union {
 	unsigned i[2];
 	double d;
 } __nan_union = { 0x7fffffff, 0xffffffff };
 
-#else
+#elif defined(__i386) || defined(__amd64)
 
 static const union {
 	unsigned i[2];
 	double d;
 } __nan_union = { 0xffffffff, 0x7fffffff };
 
+#else
+#error Unknown architecture
 #endif
 
 /* ARGSUSED0 */
--- old/usr/src/lib/libm/common/m9x/nearbyint.c	2014-05-04 03:06:49.809079553 +0200
+++ new/usr/src/lib/libm/common/m9x/nearbyint.c	2014-05-04 03:06:50.051983432 +0200
@@ -100,9 +100,9 @@
 			return (x);
 		xx.i[LOWORD] = 0;
 		xx.i[HIWORD] &= ~(i - 1);
-		if (rm == FE_UPWARD || (rm == FE_TONEAREST &&
-			(frac > 0x80000000u || (frac == 0x80000000) &&
-			(xx.i[HIWORD] & i))))
+		if ((rm == FE_UPWARD) || ((rm == FE_TONEAREST) &&
+			((frac > 0x80000000u) || ((frac == 0x80000000) &&
+			(xx.i[HIWORD] & i)))))
 			xx.i[HIWORD] += i;
 	} else {
 		i = 1 << j;
@@ -110,9 +110,9 @@
 		if (!frac)
 			return (x);
 		xx.i[LOWORD] &= ~(i - 1);
-		if (rm == FE_UPWARD || (rm == FE_TONEAREST &&
-			(frac > 0x80000000u || (frac == 0x80000000) &&
-			(xx.i[LOWORD] & i)))) {
+		if ((rm == FE_UPWARD) || ((rm == FE_TONEAREST) &&
+			(frac > 0x80000000u || ((frac == 0x80000000) &&
+			(xx.i[LOWORD] & i))))) {
 			xx.i[LOWORD] += i;
 			if (xx.i[LOWORD] == 0)
 				xx.i[HIWORD]++;
--- old/usr/src/lib/libm/common/m9x/nearbyintf.c	2014-05-04 03:06:51.960166730 +0200
+++ new/usr/src/lib/libm/common/m9x/nearbyintf.c	2014-05-04 03:06:51.990180860 +0200
@@ -80,7 +80,7 @@
 
 	hx &= ~(i - 1);
 	if (rm == FE_UPWARD || (rm == FE_TONEAREST && (frac > (i >> 1) ||
-		(frac == (i >> 1)) && (hx & i))))
+		((frac == (i >> 1)) && (hx & i)))))
 		xx.i = sx | (hx + i);
 	else
 		xx.i = sx | hx;
--- old/usr/src/lib/libm/common/m9x/scalblnl.c	2014-05-04 03:06:53.488520968 +0200
+++ new/usr/src/lib/libm/common/m9x/scalblnl.c	2014-05-04 03:06:53.518940101 +0200
@@ -45,8 +45,8 @@
 #elif defined(__x86)
 #define	XSET_EXP(k, x)	((int *) &x)[2] = (((int *) &x)[2] & ~0x7fff) | k
 #if defined(HANDLE_UNSUPPORTED)
-#define	ISINFNANL(k, x)	(k == 0x7fff || k != 0 && \
-				(((int *) &x)[1] & 0x80000000) == 0)
+#define      ISINFNANL(k, x) (k == 0x7fff || k != 0 && \
+                         (((int *) &x)[1] & 0x80000000) == 0)
 #else
 #define	ISINFNANL(k, x)	(k == 0x7fff)
 #endif
--- old/usr/src/lib/libm/common/m9x/tgamma.c	2014-05-04 03:06:55.281784015 +0200
+++ new/usr/src/lib/libm/common/m9x/tgamma.c	2014-05-04 03:06:55.310990734 +0200
@@ -1406,7 +1406,7 @@
 /* gamma(x+i) for 0 <= x < 1  */
 static struct Double
 gam_n(int i, double x) {
-	struct Double rr, yy;
+	struct Double rr = {0.0L, 0.0L}, yy;
 	double r1, r2, t2, z, xh, xl, yh, yl, zh, z1, z2, zl, x5, wh, wl;
 
 	/* compute yy = gamma(x+1) */
@@ -1558,7 +1558,7 @@
 		__HI(w) += m << 20;
 		return (w);
 	}
-	if (hx > 0) {		/* x from 0 to 8 */
+	if (hx > 0) {		/* 0 < x < 8 */
 		i = (int) x;
 		ww = gam_n(i, x - (double) i);
 		return (ww.h + ww.l);
--- old/usr/src/lib/libm/common/m9x/tgammaf.c	2014-05-04 03:06:56.478434198 +0200
+++ new/usr/src/lib/libm/common/m9x/tgammaf.c	2014-05-04 03:06:56.509854424 +0200
@@ -400,7 +400,7 @@
  */
 static double
 gam_n(int i, double x) {
-	double rr, yy;
+	double rr = 0.0L, yy;
 	double z1, z2;
 
 	/* compute yy = gamma(x+1) */
@@ -472,7 +472,7 @@
 	if (hx >= 0x41000000)	/* x >= 8 */
 		return ((float) large_gam(x));
 
-	if (hx > 0) {		/* x from 0 to 8 */
+	if (hx > 0) {		/* 0 < x < 8 */
 		i = (int) xf;
 		return ((float) gam_n(i, x - (double) i));
 	}
--- old/usr/src/lib/libm/common/m9x/tgammal.c	2014-05-04 03:06:58.441863388 +0200
+++ new/usr/src/lib/libm/common/m9x/tgammal.c	2014-05-04 03:06:58.472010301 +0200
@@ -881,7 +881,7 @@
  */
 static struct LDouble
 gam_n(int i, long double x) {
-	struct LDouble rr, yy;
+	struct LDouble rr = {0.0L, 0.0L}, yy;
 	long double r1, r2, t2, z, xh, xl, yh, yl, zh, z1, z2, zl, x5, wh, wl;
 
 	/* compute yy = gamma(x+1) */
@@ -1032,7 +1032,7 @@
 		return (scalbnl(w, m));
 	}
 
-	if (hx > 0) {		/* x from 0 to 8 */
+	if (hx > 0) {		/* 0 < x < 8 */
 		i = (int) x;
 		ww = gam_n(i, x - (long double) i);
 		return (ww.h + ww.l);
--- old/usr/src/lib/libm/i386/src/libm_inlines.h	2014-05-04 03:06:59.843458973 +0200
+++ new/usr/src/lib/libm/i386/src/libm_inlines.h	2014-05-04 03:06:59.874117579 +0200
@@ -28,7 +28,7 @@
  * Copyright 2011, Richard Lowe
  */
 
-/* Functions in this file are duplicated in libm.m4.  Keep them in sync */
+/* Functions in this file are duplicated in locallibm.il.  Keep them in sync */
 
 #ifndef _LIBM_INLINES_H
 #define	_LIBM_INLINES_H
@@ -47,30 +47,18 @@
 #define	_HIER_WORD(x)	((uint32_t *)&x)[2]
 
 extern __inline__ double
-__ieee754_sqrt(double a)
-{
-	double ret;
-
-	__asm__ __volatile__("fsqrt\n\t" : "=t" (ret) : "0" (a));
-	return (ret);
-}
-
-extern __inline__ double
 __inline_sqrt(double a)
 {
 	double ret;
 
-	__asm__ __volatile__("fsqrt\n\t" : "=t" (ret) : "0" (a));
+	__asm__ __volatile__("fsqrt\n\t" : "=t" (ret) : "0" (a) : "cc");
 	return (ret);
 }
 
 extern __inline__ double
-__d_sqrt_(double *a)
+__ieee754_sqrt(double a)
 {
-	double ret;
-
-	__asm__ __volatile__("fsqrt\n\t" : "=t" (ret) : "0" (*a));
-	return (ret);
+	return (__inline_sqrt(a));
 }
 
 extern __inline__ float
@@ -78,34 +66,24 @@
 {
 	float ret;
 
-	__asm__ __volatile__("fsqrt\n\t" : "=t" (ret) : "0" (a));
+	__asm__ __volatile__("fsqrt\n\t" : "=t" (ret) : "0" (a) : "cc");
 	return (ret);
 }
 
 extern __inline__ double
 __inline_rint(double a)
 {
-	double ret;
-
 	__asm__ __volatile__(
-		"andl $0x7fffffff,%2\n\t"
-		"cmpl $0x43300000,%2\n\t"
-		"jae  1f\n\t"
-		"frndint\n\t"
-		"1: fwait\n\t"
-		: "=t" (ret)
-                : "0" (a), "r" (_HI_WORD(a)));
-
-	return (ret);
-}
-
-extern __inline__ short
-__inline_fstsw(void)
-{
-	short ret;
+	    "andl $0x7fffffff,%1\n\t"
+	    "cmpl $0x43300000,%1\n\t"
+	    "jae  1f\n\t"
+	    "frndint\n\t"
+	    "1: fwait\n\t"
+	    : "+t" (a), "+&r" (_HI_WORD(a))
+	    :
+	    : "cc");
 
-	__asm__ __volatile__("fstsw %0\n\t" : "=r" (ret));
-	return (ret);
+	return (a);
 }
 
 /*
@@ -155,24 +133,24 @@
 extern __inline__ double
 ceil(double d)
 {
-	double ret;
 	short rd = __swap87RD(fp_positive);
 
-	__asm__ __volatile__("frndint" : "=t" (ret) : "0" (d));
+	__asm__ __volatile__("frndint" : "+t" (d), "+r" (rd) : : "cc");
 	__swap87RD(rd);
 
-	return (ret);
+	return (d);
 }
 
 extern __inline__ double
 copysign(double d1, double d2)
 {
 	__asm__ __volatile__(
-	    "andl $0x7fffffff,%0\n\t" /* %0 <-- hi_32(abs(d)) */
-	    "andl $0x80000000,%1\n\t" /* %1[31] <-- sign_bit(d2) */
-	    "orl  %1,%0\n\t"	      /* %0 <-- hi_32(copysign(x,y)) */
-	    : "+r" (_HI_WORD(d1))
-	    : "r" (_HI_WORD(d2)));
+	    "andl $0x7fffffff,%0\n\t"	/* %0 <-- hi_32(abs(d)) */
+	    "andl $0x80000000,%1\n\t"	/* %1[31] <-- sign_bit(d2) */
+	    "orl  %1,%0\n\t"		/* %0 <-- hi_32(copysign(x,y)) */
+	    : "+&r" (_HI_WORD(d1)), "+r" (_HI_WORD(d2))
+	    :
+	    : "cc");
 
 	return (d1);
 }
@@ -180,150 +158,85 @@
 extern __inline__ double
 fabs(double d)
 {
-	double ret;
-
-	__asm__ __volatile__("fabs\n\t" : "=t" (ret) : "0" (d));
-	return (ret);
+	__asm__ __volatile__("fabs\n\t" : "+t" (d) : : "cc");
+	return (d);
 }
 
 extern __inline__ float
 fabsf(float d)
 {
-	float ret;
-
-	__asm__ __volatile__("fabs\n\t" : "=t" (ret) : "0" (d));
-	return (ret);
+	__asm__ __volatile__("fabs\n\t" : "+t" (d) : : "cc");
+	return (d);
 }
 
 extern __inline__ long double
 fabsl(long double d)
 {
-	long double ret;
-
-	__asm__ __volatile__("fabs\n\t" : "=t" (ret) : "0" (d));
-	return (ret);
+	__asm__ __volatile__("fabs\n\t" : "+t" (d) : : "cc");
+	return (d);
 }
 
 extern __inline__ int
 finite(double d)
 {
-	int ret;
+	int ret = _HI_WORD(d);
 
 	__asm__ __volatile__(
-	    "notl %1\n\t"
-	    "andl $0x7ff00000,%1\n\t"
-	    "negl %1\n\t"
-	    "shrl $31,%1\n\t"
-	    : "=r" (ret)
-	    : "0" (_HI_WORD(d)));
+	    "notl %0\n\t"
+	    "andl $0x7ff00000,%0\n\t"
+	    "negl %0\n\t"
+	    "shrl $31,%0\n\t"
+	    : "+r" (ret)
+	    :
+	    : "cc");
 	return (ret);
 }
 
 extern __inline__ double
 floor(double d)
 {
-	double ret;
 	short rd = __swap87RD(fp_negative);
 
-	__asm__ __volatile__("frndint" : "=t" (ret) : "0" (d));
+	__asm__ __volatile__("frndint" : "+t" (d), "+r" (rd) : : "cc");
 	__swap87RD(rd);
 
-	return (ret);
-}
-
-/*
- *	branchless __isnan
- *	((0x7ff00000-[((lx|-lx)>>31)&1]|ahx)>>31)&1 = 1 iff x is NaN
- */
-extern __inline__ int
-isnan(double d)
-{
-	int ret;
-
-	__asm__ __volatile__(
-	"movl %1,%%ecx\n\t"
-	"negl %%ecx\n\t"	  /* ecx <-- -lo_32(x) */
-	"orl  %%ecx,%1\n\t"
-	"shrl $31,%1\n\t"	  /* 1 iff lx != 0 */
-	"andl $0x7fffffff,%2\n\t" /* ecx <-- hi_32(abs(x)) */
-	"orl  %2,%1\n\t"
-	"subl $0x7ff00000,%1\n\t"
-	"negl %1\n\t"
-	"shrl $31,%1\n\t"
-	: "=r" (ret)
-	: "0" (_HI_WORD(d)), "r" (_LO_WORD(d))
-	: "ecx");
-
-	return (ret);
+	return (d);
 }
 
 extern __inline__ int
 isnanf(float f)
 {
-	int ret;
-
 	__asm__ __volatile__(
 	    "andl $0x7fffffff,%0\n\t"
 	    "negl %0\n\t"
 	    "addl $0x7f800000,%0\n\t"
 	    "shrl $31,%0\n\t"
-	    : "=r" (ret)
-	    : "0" (f));
+	    : "+r" (f)
+	    :
+	    : "cc");
 
-	return (ret);
-}
-
-extern __inline__ int
-isinf(double d)
-{
-	int ret;
-
-	__asm__ __volatile__(
-	"andl $0x7fffffff,%1\n\t"	    /* set first bit to 0 */
-	"cmpl $0x7ff00000,%1\n\t"
-	"pushfl\n\t"
-	"popl %0\n\t"
-	"cmpl $0,%2\n\t"		/* is lo_32(x) = 0? */
-	"pushfl\n\t"
-	"popl %2\n\t"	/* bit 6 of ecx <-- lo_32(x) == 0 */
-	"andl %2,%0\n\t"
-	"andl $0x40,%0\n\t"
-	"shrl $6,%0\n\t"
-	: "=r" (ret)
-	: "0" (_HI_WORD(d)), "r" (_LO_WORD(d)));
-
-	return (ret);
+	return (f);
 }
 
 extern __inline__ double
 rint(double a) {
-	double ret;
-
-	__asm__ __volatile__(
-		"andl $0x7fffffff,%2\n\t"
-		"cmpl $0x43300000,%2\n\t"
-		"jae  1f\n\t"
-		"frndint\n\t"
-		"1: fwait\n\t"
-		: "=t" (ret)
-		: "0" (a), "r" (_HI_WORD(a)));
-
-	return (ret);
+    return (__inline_rint(a));
 }
 
 extern __inline__ double
 scalbn(double d, int n)
 {
-	double ret, dummy;
+	double dummy;
 
 	__asm__ __volatile__(
-	    "fildl %3\n\t"	/* Convert N to extended */
+	    "fildl %2\n\t"	/* Convert N to extended */
 	    "fxch\n\t"
 	    "fscale\n\t"
-	    : "=t" (ret), "=u" (dummy)
-	    : "0" (d), "m" (n));
+	    : "+t" (d), "=u" (dummy)
+	    : "m" (n)
+	    : "cc");
 
-	return (ret);
+	return (d);
 }
 
 extern __inline__ int
@@ -341,54 +254,50 @@
 extern __inline__ double
 sqrt(double d)
 {
-	double ret;
-	__asm__ __volatile__("fsqrt" : "=t" (ret) : "0" (d));
-	return (ret);
+	return (__inline_sqrt(d));
 }
 
 extern __inline__ float
 sqrtf(float f)
 {
-	float ret;
-	__asm__ __volatile__("fsqrt" : "=t" (ret) : "0" (f));
-	return (ret);
+	return (__inline_sqrtf(f));
 }
 
 extern __inline__ long double
 sqrtl(long double ld)
 {
-	long double ret;
-	__asm__ __volatile__("fsqrt" : "=t" (ret) : "0" (ld));
-	return (ret);
+	__asm__ __volatile__("fsqrt" : "+t" (ld) : : "cc");
+	return (ld);
 }
 
 extern __inline__ int
 isnanl(long double ld)
 {
-        int ret;
+	int ret = _HIER_WORD(ld);
 
-        __asm__ __volatile__(
-            "andl  $0x00007fff,%1\n\t"
-            "jz	   1f\n\t"             /* jump if __exp is all 0 */
-	    "xorl  $0x00007fff,%1\n\t"
-            "jz	   2f\n\t"             /* jump if __exp is all 1 */
-	    "testl $0x80000000,%2\n\t"
-	    "jz	   3f\n\t"             /* jump if leading bit is 0 */
-	    "movl  $0,%1\n\t"
+	__asm__ __volatile__(
+	    "andl  $0x00007fff,%0\n\t"
+	    "jz	   1f\n\t"		/* jump if exp is all 0 */
+	    "xorl  $0x00007fff,%0\n\t"
+	    "jz	   2f\n\t"		/* jump if exp is all 1 */
+	    "testl $0x80000000,%1\n\t"
+	    "jz	   3f\n\t"		/* jump if leading bit is 0 */
+	    "movl  $0,%0\n\t"
 	    "jmp   1f\n\t"
-            "2:\n\t"                   /* note that %eax = 0 from before */
-            "cmpl  $0x80000000,%2\n\t" /* what is first half of __significand? */
-	    "jnz   3f\n\t"	       /* jump if not equal to 0x80000000 */
-	    "testl $0xffffffff,%3\n\t" /* is second half of __significand 0? */
-	    "jnz   3f\n\t"	       /* jump if not equal to 0 */
+	    "2:\n\t"			/* note that %0 = 0 from before */
+	    "cmpl  $0x80000000,%1\n\t"	/* what is first half of significand? */
+	    "jnz   3f\n\t"		/* jump if not equal to 0x80000000 */
+	    "testl $0xffffffff,%2\n\t"	/* is second half of significand 0? */
+	    "jnz   3f\n\t"		/* jump if not equal to 0 */
 	    "jmp   1f\n\t"
-            "3:\n\t"
-            "movl  $1,%1\n\t"
-            "1:\n\t"
-            : "=r" (ret)
-            : "0" (_HIER_WORD(ld)), "r" (_HI_WORD(ld)), "r" (_LO_WORD(ld)));
+	    "3:\n\t"
+	    "movl  $1,%0\n\t"
+	    "1:\n\t"
+	    : "+&r" (ret)
+	    : "r" (_HI_WORD(ld)), "r" (_LO_WORD(ld))
+	    : "cc");
 
-        return (ret);
+	return (ret);
 }
 
 #ifdef __cplusplus
--- old/usr/src/lib/libm/i386/src/locallibm.il	2014-05-04 03:07:01.612189818 +0200
+++ new/usr/src/lib/libm/i386/src/locallibm.il	2014-05-04 03:07:01.428628389 +0200
@@ -217,24 +217,6 @@
 	addl	$8,%esp
 	.end
 
-/
-/	branchless __isnan
-/	((0x7ff00000-[((lx|-lx)>>31)&1]|ahx)>>31)&1 = 1 iff x is NaN
-/
-	.inline	__isnan,0
-	movl	(%esp),%eax		/// eax <-- lo_32(x)
-	movl	%eax,%ecx
-	negl	%ecx			/ ecx <-- -lo_32(x)
-	orl	%ecx,%eax
-	shrl	$31,%eax		/ 1 iff lx != 0
-	movl	4(%esp),%ecx		/// ecx <-- hi_32(x)
-	andl	$0x7fffffff,%ecx	/ ecx <-- hi_32(abs(x))
-	orl	%ecx,%eax
-	subl	$0x7ff00000,%eax
-	negl	%eax
-	shrl	$31,%eax
-	.end
-
 	.inline	__isnanf,0
 	movl	(%esp),%eax
 	andl	$0x7fffffff,%eax
@@ -243,19 +225,6 @@
 	shrl	$31,%eax
 	.end
 
-	.inline	__isinf,0
-	movl	4(%esp),%eax		/ eax <-- hi_32(x)
-	andl    $0x7fffffff,%eax        / set first bit to 0
-	cmpl    $0x7ff00000,%eax
-	pushfl
-	popl    %eax
-	cmpl    $0,(%esp)		/ is lo_32(x) = 0?
-	pushfl
-	popl    %ecx			/ bit 6 of ecx <-- lo_32(x) == 0
-	andl    %ecx,%eax
-	andl    $0x40,%eax
-	shrl    $6,%eax
-	.end
 
 	.inline	__isnormal,0
 					/ TRUE iff (x is _finite, but
--- old/usr/src/lib/libm/sparc/src/libm_inlines.h	2014-05-04 03:07:03.997456310 +0200
+++ new/usr/src/lib/libm/sparc/src/libm_inlines.h	2014-05-04 03:07:04.236358665 +0200
@@ -28,7 +28,7 @@
  * Copyright 2011, Richard Lowe.
  */
 
-/* Functions in this file are duplicated in libm.m4.  Keep them in sync */
+/* Functions in this file are duplicated in locallibm.il.  Keep them in sync */
 
 #ifndef _LIBM_INLINES_H
 #define	_LIBM_INLINES_H
@@ -47,7 +47,7 @@
 {
 	double ret;
 
-	__asm__ __volatile__("fsqrtd %0,%0\n\t" : "=e" (ret) : "0" (d));
+	__asm__ __volatile__("fsqrtd %1,%0\n\t" : "=e" (ret) : "e" (d));
 	return (ret);
 }
 
@@ -56,7 +56,7 @@
 {
 	float ret;
 
-	__asm__ __volatile__("fsqrts %0,%0\n\t" : "=f" (ret) : "0" (f));
+	__asm__ __volatile__("fsqrts %1,%0\n\t" : "=f" (ret) : "f" (f));
 	return (ret);
 }
 
@@ -64,47 +64,49 @@
 fp_classf(float f)
 {
 	enum fp_class_type ret;
+	uint32_t tmp;
 
+	/* XXX: Separate input and output */
 	__asm__ __volatile__(
-	    "sethi  %%hi(0x80000000),%%o2\n\t"
-	    "andncc %0,%%o2,%0\n\t"
+	    "sethi  %%hi(0x80000000),%1\n\t"
+	    "andncc %3,%1,%0\n\t"
 	    "bne    1f\n\t"
 	    "nop\n\t"
 	    "mov    0,%0\n\t"
-	    "ba	2f\n\t"             /* x is 0 */
+	    "ba	2f\n\t"		/* x is 0 */
 	    "nop\n\t"
 	    "1:\n\t"
-	    "sethi  %%hi(0x7f800000),%%o2\n\t"
-	    "andcc  %0,%%o2,%%g0\n\t"
+	    "sethi  %%hi(0x7f800000),%1\n\t"
+	    "andcc  %0,%1,%%g0\n\t"
 	    "bne    1f\n\t"
 	    "nop\n\t"
 	    "mov    1,%0\n\t"
-	    "ba	    2f\n\t"	    /* x is subnormal */
+	    "ba	    2f\n\t"	/* x is subnormal */
 	    "nop\n\t"
 	    "1:\n\t"
-	    "cmp    %0,%%o2\n\t"
+	    "cmp    %0,%1\n\t"
 	    "bge    1f\n\t"
 	    "nop\n\t"
 	    "mov    2,%0\n\t"
-	    "ba	    2f\n\t"	    /* x is normal */
+	    "ba	    2f\n\t"	/* x is normal */
 	    "nop\n\t"
 	    "1:\n\t"
 	    "bg	    1f\n\t"
 	    "nop\n\t"
 	    "mov    3,%0\n\t"
-	    "ba	    2f\n\t"	    /* x is __infinity */
+	    "ba	    2f\n\t"	/* x is __infinity */
 	    "nop\n\t"
 	    "1:\n\t"
-	    "sethi  %%hi(0x00400000),%%o2\n\t"
-	    "andcc  %0,%%o2,%%g0\n\t"
-	    "mov    4,%0\n\t"       /* x is quiet NaN */
+	    "sethi  %%hi(0x00400000),%1\n\t"
+	    "andcc  %0,%1,%%g0\n\t"
+	    "mov    4,%0\n\t"	/* x is quiet NaN */
 	    "bne    2f\n\t"
 	    "nop\n\t"
-	    "mov    5,%0\n\t"       /* x is signaling NaN */
+	    "mov    5,%0\n\t"	/* x is signaling NaN */
 	    "2:\n\t"
-	    : "=r" (ret)
-	    : "0" (f)
-	    : "o2");
+	    : "+r" (ret), "=&r" (tmp)
+	    : "r" (f)
+	    : "cc");
 	return (ret);
 }
 
@@ -115,53 +117,54 @@
 fp_class(double d)
 {
 	enum fp_class_type ret;
+	uint32_t tmp;
 
 	__asm__ __volatile__(
-	    "sethi %%hi(0x80000000),%%o2\n\t" /* o2 gets 80000000 */
-	    "andn  %0,%%o2,%0\n\t"	      /* o0-o1 gets abs(x) */
-	    "orcc  %0,%2,%%g0\n\t"	      /* set cc as x is zero/nonzero */
-	    "bne   1f\n\t"		      /* branch if x is nonzero */
+	    "sethi %%hi(0x80000000),%1\n\t"	/* %1 gets 80000000 */
+	    "andn  %2,%1,%0\n\t"		/* %2-%0 gets abs(x) */
+	    "orcc  %0,%3,%%g0\n\t"		/* set cc as x is zero/nonzero */
+	    "bne   1f\n\t"			/* branch if x is nonzero */
 	    "nop\n\t"
 	    "mov   0,%0\n\t"
-	    "ba	   2f\n\t"		      /* x is 0 */
+	    "ba	   2f\n\t"			/* x is 0 */
 	    "nop\n\t"
 	    "1:\n\t"
-	    "sethi %%hi(0x7ff00000),%%o2\n\t" /* o2 gets 7ff00000 */
-	    "andcc %0,%%o2,%%g0\n\t"	      /* cc set by __exp field of x */
-	    "bne   1f\n\t"		      /* branch if normal or max __exp */
+	    "sethi %%hi(0x7ff00000),%1\n\t"	/* %1 gets 7ff00000 */
+	    "andcc %0,%1,%%g0\n\t"		/* cc set by __exp field of x */
+	    "bne   1f\n\t"			/* branch if normal or max __exp */
 	    "nop\n\t"
 	    "mov   1,%0\n\t"
-	    "ba	   2f\n\t"		      /* x is subnormal */
+	    "ba	   2f\n\t"			/* x is subnormal */
 	    "nop\n\t"
 	    "1:\n\t"
-	    "cmp   %0,%%o2\n\t"
-	    "bge   1f\n\t"		      /* branch if x is max __exp */
+	    "cmp   %0,%1\n\t"
+	    "bge   1f\n\t"			/* branch if x is max __exp */
 	    "nop\n\t"
 	    "mov   2,%0\n\t"
-	    "ba	   2f\n\t"		      /* x is normal */
+	    "ba	   2f\n\t"			/* x is normal */
 	    "nop\n\t"
 	    "1:\n\t"
-	    "andn  %0,%%o2,%0\n\t"	      /* o0 gets msw __significand field */
-	    "orcc  %0,%2,%%g0\n\t"	      /* set cc by OR __significand */
-	    "bne   1f\n\t"		      /* Branch if __nan */
+	    "andn  %0,%1,%0\n\t"		/* o0 gets msw __significand field */
+	    "orcc  %0,%3,%%g0\n\t"		/* set cc by OR __significand */
+	    "bne   1f\n\t"			/* Branch if __nan */
 	    "nop\n\t"
 	    "mov   3,%0\n\t"
-	    "ba	   2f\n\t"		      /* x is __infinity */
+	    "ba	   2f\n\t"			/* x is __infinity */
 	    "nop\n\t"
 	    "1:\n\t"
-	    "sethi %%hi(0x00080000),%%o2\n\t"
-	    "andcc %0,%%o2,%%g0\n\t"	      /* set cc by quiet/sig bit */
-	    "be	   1f\n\t"		      /* Branch if signaling */
+	    "sethi %%hi(0x00080000),%1\n\t"
+	    "andcc %0,%1,%%g0\n\t"		/* set cc by quiet/sig bit */
+	    "be	   1f\n\t"			/* Branch if signaling */
 	    "nop\n\t"
-	    "mov   4,%0\n\t"		      /* x is quiet NaN */
+	    "mov   4,%0\n\t"			/* x is quiet NaN */
 	    "ba	   2f\n\t"
 	    "nop\n\t"
 	    "1:\n\t"
-	    "mov   5,%0\n\t"		      /* x is signaling NaN */
+	    "mov   5,%0\n\t"			/* x is signaling NaN */
 	    "2:\n\t"
-	    : "=r" (ret)
-	    : "0" (_HI_WORD(d)), "r" (_LO_WORD(d))
-	    : "o2");
+	    : "=&r" (ret), "=&r" (tmp)
+	    : "r" (_HI_WORD(d)), "r" (_LO_WORD(d))
+	    : "cc");
 
 	return (ret);
 }
@@ -171,23 +174,24 @@
 {
 	int ret;
 	uint32_t fsr;
+	uint32_t tmp1, tmp2;
 
 	__asm__ __volatile__(
-	    "and  %0,0x1f,%%o1\n\t"
-	    "sll  %%o1,5,%%o1\n\t"    /*  input to aexc bit location */
+	    "and  %4,0x1f,%3\n\t"
+	    "sll  %3,5,%3\n\t"	/* shift input to aexc bit location */
 	    ".volatile\n\t"
-	    "st   %%fsr,%2\n\t"
-	    "ld   %2,%0\n\t"          /* = fsr */
-	    "andn %0,0x3e0,%%o2\n\t"
-	    "or   %%o1,%%o2,%%o1\n\t" /* o1 = new fsr */
-	    "st	  %%o1,%2\n\t"
-	    "ld	  %2,%%fsr\n\t"
+	    "st   %%fsr,%1\n\t"
+	    "ld   %1,%0\n\t"	/* %0 = fsr */
+	    "andn %0,0x3e0,%4\n\t"
+	    "or   %3,%4,%3\n\t"	/* %3 = new fsr */
+	    "st	  %3,%1\n\t"
+	    "ld	  %1,%%fsr\n\t"
 	    "srl  %0,5,%0\n\t"
 	    "and  %0,0x1f,%0\n\t"
 	    ".nonvolatile\n\t"
-	    : "=r" (ret)
-	    : "0" (i), "m" (fsr)
-	    : "o1", "o2");
+	    : "=r" (ret), "=m" (fsr), "=r" (tmp1), "=r" (tmp2)
+	    : "r" (i)
+	    : "cc");
 
 	return (ret);
 }
@@ -208,24 +212,25 @@
 {
 	enum fp_direction_type ret;
 	uint32_t fsr;
+	uint32_t tmp1, tmp2, tmp3;
 
 	__asm__ __volatile__(
-	    "and  %0,0x3,%0\n\t"
-	    "sll  %0,30,%%o1\n\t"      /* input to RD bit location */
+	    "and  %5,0x3,%0\n\t"
+	    "sll  %0,30,%2\n\t"		/* shift input to RD bit location */
 	    ".volatile\n\t"
-	    "st   %%fsr,%2\n\t"
-	    "ld	  %2,%0\n\t"           /* o0 = fsr */
-	    "set  0xc0000000,%%o4\n\t" /* mask of rounding direction bits */
-	    "andn %0,%%o4,%%o2\n\t"
-	    "or   %%o1,%%o2,%%o1\n\t"  /* o1 = new fsr */
-	    "st	  %%o1,%2\n\t"
-	    "ld	  %2,%%fsr\n\t"
+	    "st   %%fsr,%1\n\t"
+	    "ld	  %1,%0\n\t"		/* %0 = fsr */
+	    "set  0xc0000000,%4\n\t"	/* mask of rounding direction bits */
+	    "andn %0,%4,%3\n\t"
+	    "or   %2,%3,%2\n\t"		/* %2 = new fsr */
+	    "st	  %2,%1\n\t"
+	    "ld	  %1,%%fsr\n\t"
 	    "srl  %0,30,%0\n\t"
 	    "and  %0,0x3,%0\n\t"
 	    ".nonvolatile\n\t"
-	    : "=r" (ret)
-	    : "0" (d), "m" (fsr)
-	    : "o1", "o2", "o4");
+	    : "=r" (ret), "=m" (fsr), "=r" (tmp1), "=r" (tmp2), "=r" (tmp3)
+	    : "r" (d)
+	    : "cc");
 
 	return (ret);
 }
@@ -234,25 +239,25 @@
 __swapTE(int i)
 {
 	int ret;
-	uint32_t fsr;
-	
+	uint32_t fsr, tmp1, tmp2;
+
 	__asm__ __volatile__(
-	    "and  %0,0x1f,%0\n\t"
-	    "sll  %0,23,%%o1\n\t"      /* input to TEM bit location */
+	    "and  %4,0x1f,%0\n\t"
+	    "sll  %0,23,%2\n\t"		/* shift input to TEM bit location */
 	    ".volatile\n\t"
-	    "st   %%fsr,%2\n\t"
-	    "ld	  %2,%0\n\t"           /* o0 = fsr */
-	    "set  0x0f800000,%%o4\n\t" /* mask of TEM (Trap Enable Mode bits) */
-	    "andn %0,%%o4,%%o2\n\t"	  
-	    "or   %%o1,%%o2,%%o1\n\t"  /* o1 = new fsr */
-	    "st	  %%o1,%2\n\t"
-	    "ld	  %2,%%fsr\n\t"
+	    "st   %%fsr,%1\n\t"
+	    "ld	  %1,%0\n\t"		/* %0 = fsr */
+	    "set  0x0f800000,%%o4\n\t"	/* mask of TEM (Trap Enable Mode bits) */
+	    "andn %0,%%o4,%3\n\t"
+	    "or   %2,%3,%2\n\t"		/* %2 = new fsr */
+	    "st	  %2,%1\n\t"
+	    "ld	  %1,%%fsr\n\t"
 	    "srl  %0,23,%0\n\t"
 	    "and  %0,0x1f,%0\n\t"
 	    ".nonvolatile\n\t"
-	    : "=r" (ret)
-	    : "0" (i), "m" (fsr)
-	    : "o1", "o2", "o4");
+	    : "=r" (ret), "=m" (fsr), "=r" (tmp1), "=r" (tmp2)
+	    : "r" (i)
+	    : "cc");
 
 	return (ret);
 }
@@ -260,37 +265,31 @@
 extern __inline__ double
 sqrt(double d)
 {
-    double ret;
-
-    __asm__ __volatile__("fsqrtd %0,%0\n\t" : "=f" (ret) : "0" (d));
-    return (ret);
+	return (__inline_sqrt(d));
 }
 
 extern __inline__ float
 sqrtf(float f)
 {
-    float ret;
-
-    __asm__ __volatile__("fsqrts %0,%0\n\t" : "=f" (ret) : "0" (f));
-    return (ret);
+	return (__inline_sqrtf(f));
 }
 
 extern __inline__ double
 fabs(double d)
 {
-    double ret;
+	double ret;
 
-    __asm__ __volatile__("fabsd %0,%0\n\t" : "=e" (ret) : "0" (d));
-    return (ret);
+	__asm__ __volatile__("fabsd %1,%0\n\t" : "=e" (ret) : "e" (d));
+	return (ret);
 }
 
 extern __inline__ float
 fabsf(float f)
 {
-    float ret;
+	float ret;
 
-    __asm__ __volatile__("fabss %0,%0\n\t" : "=f" (ret) : "0" (f));
-    return (ret);
+	__asm__ __volatile__("fabss %1,%0\n\t" : "=f" (ret) : "f" (f));
+	return (ret);
 }
 
 #ifdef __cplusplus
--- old/usr/src/lib/libm/sparc/src/locallibm.il	2014-05-04 03:07:06.445664244 +0200
+++ new/usr/src/lib/libm/sparc/src/locallibm.il	2014-05-04 03:07:06.472946966 +0200
@@ -752,7 +752,7 @@
 
 	.inline	__swapEX,1
 	and     %o0,0x1f,%o1
-	sll     %o1,5,%o1               !  input to aexc bit location
+	sll     %o1,5,%o1               ! shift input to aexc bit location
 	.volatile
 	st      %fsr,[%sp+0x44]
 	ld      [%sp+0x44],%o0          ! o0 = fsr
@@ -777,7 +777,7 @@
 
 	.inline	__swapRD,1
 	and	%o0,0x3,%o0
-	sll     %o0,30,%o1              !  input to RD bit location
+	sll     %o0,30,%o1              ! shift input to RD bit location
 	.volatile
 	st      %fsr,[%sp+0x44]
 	ld      [%sp+0x44],%o0          ! o0 = fsr
@@ -800,7 +800,7 @@
 
 	.inline	__swapTE,1
 	and	%o0,0x1f,%o0
-	sll     %o0,23,%o1              !  input to TEM bit location
+	sll     %o0,23,%o1              ! shift input to TEM bit location
 	.volatile
 	st      %fsr,[%sp+0x44]
 	ld      [%sp+0x44],%o0            ! o0 = fsr
--- old/usr/src/lib/libm/sparcv9/src/libm_inlines.h	2014-05-04 03:07:08.017091501 +0200
+++ new/usr/src/lib/libm/sparcv9/src/libm_inlines.h	2014-05-04 03:07:08.262005716 +0200
@@ -28,7 +28,7 @@
  * Copyright 2011, Richard Lowe.
  */
 
-/* Functions in this file are duplicated in libm.m4.  Keep them in sync */
+/* Functions in this file are duplicated in locallibm.il.  Keep them in sync */
 
 #ifndef _LIBM_INLINES_H
 #define	_LIBM_INLINES_H
@@ -46,49 +46,50 @@
 fp_classf(float f)
 {
 	enum fp_class_type ret;
-	int fint;                   /* scratch for f as int */
+	int fint;		/* scratch for f as int */
+	uint64_t tmp;
 
 	__asm__ __volatile__(
-	    "fabss  %2,%2\n\t"
-	    "st	    %2,%1\n\t"
+	    "fabss  %3,%3\n\t"
+	    "st	    %3,%1\n\t"
 	    "ld	    %1,%0\n\t"
 	    "orcc   %%g0,%0,%%g0\n\t"
 	    "be,pn  %%icc,2f\n\t"
 	    "nop\n\t"
 	    "1:\n\t"
-	    "sethi  %%hi(0x7f800000),%%o1\n\t"
-	    "andcc  %0,%%o1,%%g0\n\t"
+	    "sethi  %%hi(0x7f800000),%2\n\t"
+	    "andcc  %0,%2,%%g0\n\t"
 	    "bne,pt %%icc,1f\n\t"
 	    "nop\n\t"
 	    "or	    %%g0,1,%0\n\t"
-	    "ba	    2f\n\t"
+	    "ba	    2f\n\t"	/* subnormal */
 	    "nop\n\t"
 	    "1:\n\t"
-	    "subcc  %0,%%o1,%%g0\n\t"
+	    "subcc  %0,%2,%%g0\n\t"
 	    "bge,pn %%icc,1f\n\t"
 	    "nop\n\t"
 	    "or	    %%g0,2,%0\n\t"
-	    "ba	    2f\n\t"
+	    "ba	    2f\n\t"	/* normal */
 	    "nop\n\t"
 	    "1:\n\t"
 	    "bg,pn  %%icc,1f\n\t"
 	    "nop\n\t"
 	    "or	    %%g0,3,%0\n\t"
-	    "ba	    2f\n\t"
+	    "ba	    2f\n\t"	/* infinity */
 	    "nop\n\t"
 	    "1:\n\t"
-	    "sethi  %%hi(0x00400000),%%o1\n\t"
-	    "andcc  %0,%%o1,%%g0\n\t"
+	    "sethi  %%hi(0x00400000),%2\n\t"
+	    "andcc  %0,%2,%%g0\n\t"
 	    "or	    %%g0,4,%0\n\t"
-	    "bne,pt %%icc,2f\n\t"
+	    "bne,pt %%icc,2f\n\t" /* quiet NaN */
 	    "nop\n\t"
-	    "or	    %%g0,5,%0\n\t"
+	    "or	    %%g0,5,%0\n\t" /* signalling NaN */
 	    "2:\n\t"
-	    : "=r" (ret), "=m" (fint)
+	    : "=r" (ret), "=m" (fint), "=r" (tmp)
 	    : "f" (f)
-	    : "o1");
+	    : "cc");
 
-    return (ret);
+	return (ret);
 }
 
 extern __inline__ enum fp_class_type
@@ -96,48 +97,49 @@
 {
 	enum fp_class_type ret;
 	uint64_t dint;		/* Scratch for d-as-long */
+	uint64_t tmp;
 
 	__asm__ __volatile__(
-	    "fabsd  %2,%2\n\t"
-	    "std    %2,%1\n\t"
+	    "fabsd  %3,%3\n\t"
+	    "std    %3,%1\n\t"
 	    "ldx    %1,%0\n\t"
 	    "orcc   %%g0,%0,%%g0\n\t"
 	    "be,pn  %%xcc,2f\n\t"
 	    "nop\n\t"
-	    "sethi  %%hi(0x7ff00000),%%o1\n\t"
-	    "sllx   %%o1,32,%%o1\n\t"
-	    "andcc  %0,%%o1,%%g0\n\t"
+	    "sethi  %%hi(0x7ff00000),%2\n\t"
+	    "sllx   %2,32,%2\n\t"
+	    "andcc  %0,%2,%%g0\n\t"
 	    "bne,pt %%xcc,1f\n\t"
 	    "nop\n\t"
 	    "or	    %%g0,1,%0\n\t"
 	    "ba	    2f\n\t"
 	    "nop\n\t"
 	    "1:\n\t"
-	    "subcc  %0,%%o1,%%g0\n\t"
+	    "subcc  %0,%2,%%g0\n\t"
 	    "bge,pn %%xcc,1f\n\t"
 	    "nop\n\t"
 	    "or	    %%g0,2,%0\n\t"
 	    "ba	    2f\n\t"
 	    "nop\n\t"
 	    "1:\n\t"
-	    "andncc %0,%%o1,%0\n\t"
+	    "andncc %0,%2,%0\n\t"
 	    "bne,pn %%xcc,1f\n\t"
 	    "nop\n\t"
 	    "or	    %%g0,3,%0\n\t"
 	    "ba	    2f\n\t"
 	    "nop\n\t"
 	    "1:\n\t"
-	    "sethi  %%hi(0x00080000),%%o1\n\t"
-	    "sllx   %%o1,32,%%o1\n\t"
-	    "andcc  %0,%%o1,%%g0\n\t"
+	    "sethi  %%hi(0x00080000),%2\n\t"
+	    "sllx   %2,32,%2\n\t"
+	    "andcc  %0,%2,%%g0\n\t"
 	    "or	    %%g0,4,%0\n\t"
 	    "bne,pt %%xcc,2f\n\t"
 	    "nop\n\t"
 	    "or	    %%g0,5,%0\n\t"
 	    "2:\n\t"
-	    : "=r" (ret), "=m" (dint)
+	    : "=r" (ret), "=m" (dint), "=r" (tmp)
 	    : "e" (d)
-	    : "o1");
+	    : "cc");
 
 	return (ret);
 }
@@ -147,7 +149,7 @@
 {
 	float ret;
 
-	__asm__ __volatile__("fsqrts %0,%0\n\t" : "=f" (ret) : "f" (f));
+	__asm__ __volatile__("fsqrts %1,%0\n\t" : "=f" (ret) : "f" (f));
 	return (ret);
 }
 
@@ -156,7 +158,7 @@
 {
 	double ret;
 
-	__asm__ __volatile__("fsqrtd %0,%0\n\t" : "=f" (ret) : "0" (d));
+	__asm__ __volatile__("fsqrtd %1,%0\n\t" : "=f" (ret) : "f" (d));
 	return (ret);
 }
 
@@ -165,23 +167,24 @@
 {
 	int ret;
 	uint32_t fsr;
+	uint64_t tmp1, tmp2;
 
 	__asm__ __volatile__(
-	    "and  %0,0x1f,%%o1\n\t"
-	    "sll  %%o1,5,%%o1\n\t"    /* input to aexc bit location */
+	    "and  %4,0x1f,%2\n\t"
+	    "sll  %2,5,%2\n\t"	/* shift input to aexc bit location */
 	    ".volatile\n\t"
-	    "st   %%fsr,%2\n\t"
-	    "ld	  %2,%0\n\t"	      /* = fsr */
-	    "andn %0,0x3e0,%%o2\n\t"
-	    "or   %%o1,%%o2,%%o1\n\t" /* o1 = new fsr */
-	    "st	  %%o1,%2\n\t"
-	    "ld	  %2,%%fsr\n\t"
+	    "st   %%fsr,%1\n\t"
+	    "ld	  %1,%0\n\t"	/* %0 = fsr */
+	    "andn %0,0x3e0,%3\n\t"
+	    "or   %2,%3,%2\n\t"	/* %2 = new fsr */
+	    "st	  %2,%1\n\t"
+	    "ld	  %1,%%fsr\n\t"
 	    "srl  %0,5,%0\n\t"
 	    "and  %0,0x1f,%0\n\t"
 	    ".nonvolatile\n\t"
-	    : "=r" (ret)
-	    : "0" (i), "m" (fsr)
-	    : "o1", "o2");
+	    : "=r" (ret), "=m" (fsr), "=r" (tmp1), "=r" (tmp2)
+	    : "r" (i)
+	    : "cc");
 
 	return (ret);
 }
@@ -202,24 +205,26 @@
 {
 	enum fp_direction_type ret;
 	uint32_t fsr;
+	uint64_t tmp1, tmp2, tmp3;
 
 	__asm__ __volatile__(
-	    "and   %0,0x3,%0\n\t"
-	    "sll   %0,30,%%o1\n\t"	      /* input to RD bit location */
+	    "and   %5,0x3,%0\n\t"
+	    "sll   %0,30,%2\n\t"	/* shift input to RD bit location */
 	    ".volatile\n\t"
-	    "st    %%fsr,%2\n\t"
-	    "ld	   %2,%0\n\t"                 /* o0 = fsr */
-	    "sethi %%hi(0xc0000000),%%o4\n\t" /* mask of rounding direction bits */
-	    "andn  %0,%%o4,%%o2\n\t"
-	    "or    %%o1,%%o2,%%o1\n\t"	      /* o1 = new fsr */
-	    "st	   %%o1,%2\n\t"
-	    "ld	   %2,%%fsr\n\t"
+	    "st    %%fsr,%1\n\t"
+	    "ld	   %1,%0\n\t"		/* %0 = fsr */
+	    /* mask of rounding direction bits */
+	    "sethi %%hi(0xc0000000),%4\n\t"
+	    "andn  %0,%4,%3\n\t"
+	    "or    %2,%3,%2\n\t"	/* %2 = new fsr */
+	    "st	   %2,%1\n\t"
+	    "ld	   %1,%%fsr\n\t"
 	    "srl   %0,30,%0\n\t"
 	    "and   %0,0x3,%0\n\t"
 	    ".nonvolatile\n\t"
-	    : "=r" (ret)
-	    : "0" (d), "m" (fsr)
-	    : "o1", "o2", "o4");
+	    : "=r" (ret), "=m" (fsr), "=r" (tmp1), "=r" (tmp2), "=r" (tmp3)
+	    : "r" (d)
+	    : "cc");
 
 	return (ret);
 }
@@ -229,24 +234,26 @@
 {
 	int ret;
 	uint32_t fsr;
-	
+	uint64_t tmp1, tmp2, tmp3;
+
 	__asm__ __volatile__(
-	    "and   %0,0x1f,%0\n\t"
-	    "sll   %0,23,%%o1\n\t"            /* input to TEM bit location */
+	    "and   %5,0x1f,%0\n\t"
+	    "sll   %0,23,%2\n\t"	/* shift input to TEM bit location */
 	    ".volatile\n\t"
-	    "st    %%fsr,%2\n\t"
-	    "ld	   %2,%0\n\t"                 /* o0 = fsr */
-	    "sethi %%hi(0x0f800000),%%o4\n\t" /* mask of TEM (Trap Enable Mode bits) */
-	    "andn  %0,%%o4,%%o2\n\t"	  
-	    "or    %%o1,%%o2,%%o1\n\t"        /* o1 = new fsr */
-	    "st	   %%o1,%2\n\t"
-	    "ld	   %2,%%fsr\n\t"
+	    "st    %%fsr,%1\n\t"
+	    "ld	   %1,%0\n\t"		/* %0 = fsr */
+	    /* mask of TEM (Trap Enable Mode bits) */
+	    "sethi %%hi(0x0f800000),%4\n\t"
+	    "andn  %0,%4,%3\n\t"
+	    "or    %2,%3,%2\n\t"	/* %2 = new fsr */
+	    "st	   %2,%1\n\t"
+	    "ld	   %1,%%fsr\n\t"
 	    "srl   %0,23,%0\n\t"
 	    "and   %0,0x1f,%0\n\t"
 	    ".nonvolatile\n\t"
-	    : "=r" (ret)
-	    : "0" (i), "m" (fsr)
-	    : "o1", "o2", "o4");
+	    : "=r" (ret), "=m" (fsr), "=r" (tmp1), "=r" (tmp2), "=r" (tmp3)
+	    : "r" (i)
+	    : "cc");
 
 	return (ret);
 }
@@ -255,37 +262,31 @@
 extern __inline__ double
 sqrt(double d)
 {
-    double ret;
-
-    __asm__ __volatile__("fsqrtd %0,%0\n\t" : "=f" (ret) : "0" (d));
-    return (ret);
+	return (__inline_sqrt(d));
 }
 
 extern __inline__ float
 sqrtf(float f)
 {
-    float ret;
-
-    __asm__ __volatile__("fsqrts %0,%0\n\t" : "=f" (ret) : "0" (f));
-    return (ret);
+	return (__inline_sqrtf(f));
 }
 
 extern __inline__ double
 fabs(double d)
 {
-    double ret;
+	double ret;
 
-    __asm__ __volatile__("fabsd %0,%0\n\t" : "=e" (ret) : "0" (d));
-    return (ret);
+	__asm__ __volatile__("fabsd %1,%0\n\t" : "=e" (ret) : "e" (d));
+	return (ret);
 }
 
 extern __inline__ float
 fabsf(float f)
 {
-    float ret;
+	float ret;
 
-    __asm__ __volatile__("fabss %0,%0\n\t" : "=f" (ret) : "0" (f));
-    return (ret);
+	__asm__ __volatile__("fabss %1,%0\n\t" : "=f" (ret) : "f" (f));
+	return (ret);
 }
 
 #ifdef __cplusplus
--- old/usr/src/lib/libmvec/Makefile.com	2014-05-04 03:07:10.404567035 +0200
+++ new/usr/src/lib/libmvec/Makefile.com	2014-05-04 03:07:10.434123059 +0200
@@ -170,6 +170,9 @@
 LINTERROFF	+= -erroff=E_ASSIGMENT_CAUSE_LOSS_PREC
 LINTERROFF	+= -erroff=E_FUNC_SET_NOT_USED
 
+CERRWARN	+= -_gcc=-Wno-parentheses
+CERRWARN	+= -_gcc=-Wno-unused-variable
+
 LINTFLAGS	+= $(LINTERROFF)
 LINTFLAGS64	+= $(LINTERROFF)
 LINTFLAGS64     += -errchk=longptr64
--- old/usr/src/lib/libmvec/Makefile.com	2014-05-04 03:07:11.885219122 +0200
+++ new/usr/src/lib/libmvec/Makefile.com	2014-05-04 03:07:11.918953026 +0200
@@ -170,6 +170,9 @@
 LINTERROFF	+= -erroff=E_ASSIGMENT_CAUSE_LOSS_PREC
 LINTERROFF	+= -erroff=E_FUNC_SET_NOT_USED
 
+CERRWARN	+= -_gcc=-Wno-parentheses
+CERRWARN	+= -_gcc=-Wno-unused-variable
+
 LINTFLAGS	+= $(LINTERROFF)
 LINTFLAGS64	+= $(LINTERROFF)
 LINTFLAGS64     += -errchk=longptr64
--- old/usr/src/lib/libmvec/common/__vatan.c	2014-05-04 03:07:13.001722706 +0200
+++ new/usr/src/lib/libmvec/common/__vatan.c	2014-05-04 03:07:13.035139188 +0200
@@ -47,13 +47,13 @@
 void
 __vatan( int n, double * restrict x, int stridex, double * restrict y, int stridey )
 {
-  double  f , z, ans, ansu , ansl , tmp , poly , conup , conlo , dummy;
+  double  f , z, ans = 0.0L, ansu , ansl , tmp , poly , conup , conlo , dummy;
   double  f1,   ans1, ansu1, ansl1, tmp1, poly1, conup1, conlo1;
   double  f2,   ans2, ansu2, ansl2, tmp2, poly2, conup2, conlo2;
   int index, sign, intf, intflo, intz, argcount;
-  int index1, sign1 ;
-  int index2, sign2 ;
-  double *yaddr,*yaddr1,*yaddr2;
+  int index1, sign1 = 0;
+  int index2, sign2 = 0;
+  double *yaddr,*yaddr1 = 0,*yaddr2 = 0;
   extern const double __vlibm_TBL_atan1[];
   extern double fabs( double );
 
--- old/usr/src/lib/libmvec/common/__vatan2f.c	2014-05-04 03:07:14.765435042 +0200
+++ new/usr/src/lib/libmvec/common/__vatan2f.c	2014-05-04 03:07:14.813523510 +0200
@@ -51,19 +51,19 @@
 __vatan2f( int n, float * restrict y, int stridey, float * restrict x,
 	int stridex, float * restrict z, int stridez )
 {
-	float		x0, x1, x2, y0, y1, y2, *pz0, *pz1, *pz2;
+	float		x0, x1, x2, y0, y1, y2, *pz0 = 0, *pz1, *pz2;
 	double		ah0, ah1, ah2;
 	double		t0, t1, t2;
 	double		sx0, sx1, sx2;
 	double		sign0, sign1, sign2;
-	int		i, k0, k1, k2, hx, sx, sy;
+	int		i, k0 = 0, k1, k2, hx, sx, sy;
 	int		hy0, hy1, hy2;
-	float		base0, base1, base2;
+	float		base0 = 0.0, base1, base2;
 	double		num0, num1, num2;
 	double		den0, den1, den2;
 	double		dx0, dx1, dx2;
 	double		dy0, dy1, dy2;
-	double		db0, db1, db2;		
+	double		db0, db1, db2;
 
 	do
 	{
--- old/usr/src/lib/libmvec/common/__vatanf.c	2014-05-04 03:07:16.562348580 +0200
+++ new/usr/src/lib/libmvec/common/__vatanf.c	2014-05-04 03:07:16.575360785 +0200
@@ -38,7 +38,7 @@
 {
   extern const double __vlibm_TBL_atan1[];
   double  conup0, conup1, conup2;
-  float dummy, ansf;
+  float dummy, ansf = 0.0;
   float f0, f1, f2;
   float ans0, ans1, ans2;
   float poly0, poly1, poly2;
--- old/usr/src/lib/libmvec/common/__vcos.c	2014-05-04 03:07:18.446724742 +0200
+++ new/usr/src/lib/libmvec/common/__vcos.c	2014-05-04 03:07:18.690632534 +0200
@@ -28,6 +28,7 @@
  */
 
 #include <sys/isa_defs.h>
+#include <sys/ccompile.h>
 
 #ifdef _LITTLE_ENDIAN
 #define HI(x)	*(1+(int*)x)
@@ -98,10 +99,9 @@
 {
 	double		x0_or_one[4], x1_or_one[4], x2_or_one[4];
 	double		y0_or_zero[4], y1_or_zero[4], y2_or_zero[4];
-	double		x0, x1, x2, *py0, *py1, *py2, *xsave, *ysave;
-	unsigned	hx0, hx1, hx2, xsb0, xsb1, xsb2;
-	int			i, biguns, nsave, sxsave, sysave;
-
+	double		x0, x1, x2, *py0 = 0, *py1 = 0, *py2, *xsave, *ysave;
+	unsigned	hx0, hx1, hx2, xsb0, xsb1 = 0, xsb2;
+	int		i, biguns, nsave, sxsave, sysave;
 	nsave = n;
 	xsave = x;
 	sxsave = stridex;
@@ -122,7 +122,6 @@
 		}
 		if ( hx0 < 0x3e400000 ) {
 			/* Too small.  cos x ~ 1. */
-			volatile int v = *x;
 			*y = 1.0;
 			x += stridex;
 			y += stridey;
@@ -149,7 +148,6 @@
 		}
 		if ( hx1 < 0x3e400000 )
 		{
-			volatile int v = *x;
 			*y = 1.0;
 			x += stridex;
 			y += stridey;
@@ -176,7 +174,6 @@
 		}
 		if ( hx2 < 0x3e400000 )
 		{
-			volatile int v = *x;
 			*y = 1.0;
 			x += stridex;
 			y += stridey;
--- old/usr/src/lib/libmvec/common/__vcosf.c	2014-05-04 03:07:21.296519545 +0200
+++ new/usr/src/lib/libmvec/common/__vcosf.c	2014-05-04 03:07:21.114004063 +0200
@@ -148,7 +148,7 @@
 	double		y0, y1, y2, y3;
 	double		z0, z1, z2, z3;
 	float		f0, f1, f2, f3, t;
-	int		n0, n1, n2, n3, hx, ix, medium;
+	int		n0 = 0, n1 = 0, n2 = 0, n3, hx, ix, medium;
 
 	y -= stridey;
 
--- old/usr/src/lib/libmvec/common/__vpow.c	2014-05-04 03:07:23.042825898 +0200
+++ new/usr/src/lib/libmvec/common/__vpow.c	2014-05-04 03:07:23.072569071 +0200
@@ -546,9 +546,9 @@
 yisint##I = 0;	/* Y - non-integer */								\
 exp = hy >> 20;	/* Y exponent */								\
 ull_y0 &= LMMANT;										\
-ull_x##I = ull_y0 | LDONE;									\
+ull_x##I = (ull_y0 | LDONE);									\
 x##I = *(double*)&ull_x##I;									\
-ull_ax##I = (ull_x##I + LMROUND) & LMHI20;							\
+ull_ax##I = ((ull_x##I + LMROUND) & LMHI20);							\
 ax##I = *(double*)&ull_ax##I;									\
 if ( hx >= 0x7ff00000 || exp >= 0x43e )		/* X=Inf,Nan or |Y|>2^63,Inf,Nan */		\
 {												\
@@ -619,7 +619,7 @@
 		RET_SC(I)									\
 	}											\
 }												\
-if ( sx || (hx | lx) == 0 )	/* X <= 0      */						\
+if ( (sx || (hx | lx)) == 0 )	/* X <= 0      */						\
 {												\
 	if ( exp >= 0x434 )	/* |Y| >= 2^53 */						\
 		yisint##I = 2;	/* Y - even    */						\
@@ -662,11 +662,11 @@
 {												\
 	ax##I = (double) ull_y0;								\
 	ull_ax##I = *(unsigned long long*)&ax##I;						\
-	ull_x##I = ull_ax##I & LMMANT | LDONE;							\
+	ull_x##I = ((ull_ax##I & LMMANT) | LDONE);							\
 	x##I = *(double*)&ull_x##I;								\
 	exp##I = ((unsigned int*) & ull_ax##I)[0];						\
 	exp##I = (exp##I >> 20) - (2046 + 1023 + 51);						\
-	ull_ax##I = ull_x##I + LMROUND & LMHI20;						\
+	ull_ax##I = (ull_x##I + (LMROUND & LMHI20));						\
 	ax##I = *(double*)&ull_ax##I;								\
 	ux##I = x##I + ax##I;									\
 }												\
@@ -678,19 +678,19 @@
 __vpow( int n, double * restrict px, int stridex, double * restrict py,
 	int stridey, double * restrict pz, int stridez )
 {
-	double			*py0, *py1, *py2;
-	double			*pz0, *pz1, *pz2;
-	double			y0, yd0, u0, s0, s_l0, m_h0;
-	double			y1, yd1, u1, s1, s_l1, m_h1;
+	double			*py0 = 0, *py1 = 0, *py2;
+	double			*pz0 = 0, *pz1 = 0, *pz2;
+	double			y0, yd0 = 0.0L, u0, s0, s_l0, m_h0;
+	double			y1, yd1 = 0.0L, u1, s1, s_l1, m_h1;
 	double			y2, yd2, u2, s2, s_l2, m_h2;
-	double			ax0, x0, s_h0, ux0;
-	double			ax1, x1, s_h1, ux1;
+	double			ax0 = 0.0L, x0 = 0.0L, s_h0, ux0;
+	double			ax1 = 0.0L, x1 = 0.0L, s_h1, ux1;
 	double			ax2, x2, s_h2, ux2;
 	int			eflag0, gflag0, ind0, i0;
 	int			eflag1, gflag1, ind1, i1;
 	int			eflag2, gflag2, ind2, i2;
-	int			hx0, yisint0, exp0;
-	int			hx1, yisint1, exp1;
+	int			hx0 = 0, yisint0 = 0, exp0 = 0;
+	int			hx1 = 0, yisint1 = 0, exp1 = 0;
 	int			hx2, yisint2, exp2;
 	int			exp, i = 0;
 	unsigned		hx, lx, sx, hy, ly, sy;
@@ -1129,8 +1129,8 @@
 __vpowx( int n, double * restrict px, double * restrict py,
 	int stridey, double * restrict pz, int stridez )
 {
-	double			*py0, *py1, *py2;
-	double			*pz0, *pz1, *pz2;
+	double			*py0, *py1 = 0, *py2;
+	double			*pz0, *pz1 = 0, *pz2;
 	double			ux0, y0, yd0, u0, s0;
 	double			y1, yd1, u1, s1;
 	double			y2, yd2, u2, s2;
@@ -1155,10 +1155,10 @@
 	/* perform s_h + yr = 256*log2(x) */
 	ull_y0 = *(unsigned long long*)px;
 	hx = HI(px);
-	ull_x0 = ull_y0 & LMMANT | LDONE;
+	ull_x0 = (ull_y0 & LMMANT) | LDONE;
 	x0 = *(double*)&ull_x0;
 	exp0 = (hx >> 20) - 2046;
-	ull_ax0 = ull_x0 + LMROUND & LMHI20;
+	ull_ax0 = ull_x0 + (LMROUND & LMHI20);
 	ax0 = *(double*)&ull_ax0;
 	hx0 = HI(&ax0);
 	ux0 = x0 + ax0;
--- old/usr/src/lib/libmvec/common/__vrhypot.c	2014-05-04 03:07:25.288299367 +0200
+++ new/usr/src/lib/libmvec/common/__vrhypot.c	2014-05-04 03:07:25.317992583 +0200
@@ -217,7 +217,7 @@
 	double		x0, y0, res0, dd0;
 	double		res0_hi,res0_lo, dres0;
 	double		x_hi1, x_lo1, y_hi1, y_lo1, scl1 = 0;
-	double		x1, y1, res1, dd1;
+	double		x1 = 0.0L, y1 = 0.0L, res1, dd1;
 	double		res1_hi,res1_lo, dres1;
 	double		x_hi2, x_lo2, y_hi2, y_lo2, scl2 = 0;
 	double		x2, y2, res2, dd2;
@@ -238,7 +238,7 @@
 	double		D2ON1022 = ((double*)LCONST)[3];
 	double		D2ONM52 = ((double*)LCONST)[4];
 
-	double		*pz0, *pz1, *pz2;
+	double		*pz0, *pz1 = 0, *pz2;
 
 	do
 	{
--- old/usr/src/lib/libmvec/common/__vsin.c	2014-05-04 03:07:26.759198297 +0200
+++ new/usr/src/lib/libmvec/common/__vsin.c	2014-05-04 03:07:26.980312287 +0200
@@ -28,6 +28,7 @@
  */
 
 #include <sys/isa_defs.h>
+#include <sys/ccompile.h>
 
 #ifdef _LITTLE_ENDIAN
 #define HI(x)	*(1+(int*)x)
@@ -78,10 +79,9 @@
 {
 	double		x0_or_one[4], x1_or_one[4], x2_or_one[4];
 	double		y0_or_zero[4], y1_or_zero[4], y2_or_zero[4];
-	double		x0, x1, x2, *py0, *py1, *py2, *xsave, *ysave;
-	unsigned	hx0, hx1, hx2, xsb0, xsb1, xsb2;
-	int			i, biguns, nsave, sxsave, sysave;
-
+	double		x0, x1, x2, *py0 = 0, *py1 = 0, *py2, *xsave, *ysave;
+	unsigned	hx0, hx1, hx2, xsb0, xsb1 = 0, xsb2;
+	int		i, biguns, nsave, sxsave, sysave;
 	nsave = n;
 	xsave = x;
 	sxsave = stridex;
@@ -101,7 +101,6 @@
 		}
 		if ( hx0 < 0x3e400000 )
 		{
-			volatile int v = *x;
 			*y = *x;
 			x += stridex;
 			y += stridey;
@@ -128,7 +127,6 @@
 		}
 		if ( hx1 < 0x3e400000 )
 		{
-			volatile int v = *x;
 			*y = *x;
 			x += stridex;
 			y += stridey;
@@ -155,7 +153,6 @@
 		}
 		if ( hx2 < 0x3e400000 )
 		{
-			volatile int v = *x;
 			*y = *x;
 			x += stridex;
 			y += stridey;
@@ -510,7 +507,7 @@
 	{
 		double		fn0, fn1, fn2, a0, a1, a2, w0, w1, w2, y0, y1, y2;
 		unsigned	hx;
-		int			n0, n1, n2;
+		int		n0, n1, n2;
 
 loop0:
 		hx = HI(x);
@@ -518,7 +515,6 @@
 		hx &= ~0x80000000;
 		if ( hx < 0x3e400000 )
 		{
-			volatile int v = *x;
 			*y = *x;
 			x += stridex;
 			y += stridey;
@@ -557,7 +553,6 @@
 		hx &= ~0x80000000;
 		if ( hx < 0x3e400000 )
 		{
-			volatile int v = *x;
 			*y = *x;
 			x += stridex;
 			y += stridey;
@@ -596,7 +591,6 @@
 		hx &= ~0x80000000;
 		if ( hx < 0x3e400000 )
 		{
-			volatile int v = *x;
 			*y = *x;
 			x += stridex;
 			y += stridey;
--- old/usr/src/lib/libmvec/common/__vsincos.c	2014-05-04 03:07:29.153018719 +0200
+++ new/usr/src/lib/libmvec/common/__vsincos.c	2014-05-04 03:07:29.396341229 +0200
@@ -28,6 +28,7 @@
  */
 
 #include <sys/isa_defs.h>
+#include <sys/ccompile.h>
 
 #ifdef _LITTLE_ENDIAN
 #define HI(x)	*(1+(int*)x)
@@ -93,12 +94,11 @@
 	double		x0_or_one[4], x1_or_one[4], x2_or_one[4];
 	double		y0_or_zero[4], y1_or_zero[4], y2_or_zero[4];
 	double		x0, x1, x2,
-				*py0, *py1, *py2,
-				*pc0, *pc1, *pc2,
-				*xsave, *ysave, *csave;
+			*py0, *py1, *py2,
+			*pc0, *pc1, *pc2,
+			*xsave, *ysave, *csave;
 	unsigned	hx0, hx1, hx2, xsb0, xsb1, xsb2;
-	int			i, biguns, nsave, sxsave, sysave, scsave;
-
+	int		i, biguns, nsave, sxsave, sysave, scsave;
 	nsave = n;
 	xsave = x;
 	sxsave = stridex;
@@ -128,7 +128,6 @@
 		}
 		if ( hx0 < 0x3e400000 ) {
 			/* Too small.  cos x ~ 1, sin x ~ x. */
-			volatile int v = *x;
 			*c = 1.0;
 			*y = *x;
 			x += stridex;
@@ -165,7 +164,6 @@
 		}
 		if ( hx1 < 0x3e400000 )
 		{
-			volatile int v = *x;
 			*c = 1.0;
 			*y = *x;
 			x += stridex;
@@ -202,7 +200,6 @@
 		}
 		if ( hx2 < 0x3e400000 )
 		{
-			volatile int v = *x;
 			*c = 1.0;
 			*y = *x;
 			x += stridex;
--- old/usr/src/lib/libmvec/common/__vsincosf.c	2014-05-04 03:07:30.377071861 +0200
+++ new/usr/src/lib/libmvec/common/__vsincosf.c	2014-05-04 03:07:30.406873425 +0200
@@ -168,7 +168,7 @@
 	double		z0, z1, z2, z3;
 	float		f0, f1, f2, f3, t;
 	float		g0, g1, g2, g3;
-	int		n0, n1, n2, n3, hx, ix, medium;
+	int		n0 = 0, n1 = 0, n2 = 0, n3, hx, ix, medium;
 
 	s -= strides;
 	c -= stridec;
--- old/usr/src/lib/libmvec/common/__vsinf.c	2014-05-04 03:07:31.406673400 +0200
+++ new/usr/src/lib/libmvec/common/__vsinf.c	2014-05-04 03:07:31.436716642 +0200
@@ -152,7 +152,7 @@
 	double		y0, y1, y2, y3;
 	double		z0, z1, z2, z3;
 	float		f0, f1, f2, f3, t;
-	int		n0, n1, n2, n3, hx, ix, medium;
+	int		n0 = 0, n1 = 0, n2 = 0, n3, hx, ix, medium;
 
 	y -= stridey;
 
--- old/usr/src/man/Makefile	2014-05-04 03:07:33.370616618 +0200
+++ new/usr/src/man/Makefile	2014-05-04 03:07:33.402923655 +0200
@@ -11,6 +11,7 @@
 
 #
 # Copyright 2011, Richard Lowe
+# Copyright (c) 2012, Igor Kozhukhov <ikozhukhov@gmail.com>
 # Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
 #
 
@@ -48,10 +49,12 @@
 		man3ldap	\
 		man3lgrp	\
 		man3lib		\
+		man3m		\
 		man3mail	\
 		man3malloc	\
 		man3mp		\
 		man3mpapi	\
+		man3mvec	\
 		man3nsl		\
 		man3nvpair	\
 		man3pam		\
--- old/usr/src/pkg/manifests/SUNWlibm.mf	2014-05-04 03:07:34.901633131 +0200
+++ new/usr/src/pkg/manifests/SUNWlibm.mf	2014-05-04 03:07:35.145057357 +0200
@@ -13,12 +13,17 @@
 # Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
 #
 
-# was renamed to system/library/math/header-math
-# both obsolete now
 set name=pkg.fmri value=pkg:/SUNWlibm@0.5.11,5.11-0.132
-set name=pkg.description value="Math Library Headers & Lint Files"
-set name=pkg.obsolete value=true
-set name=pkg.summary value="Math Library Headers & Lint Files"
+set name=pkg.description \
+    value="Math & Microtasking Library Headers & Lint Files"
+# license license=SUNWlibm.copyright
+# license license=SUNWlibmr.copyright
+set name=pkg.renamed value=true
+# set name=pkg.renamed value=true
+set name=pkg.summary value="Math & Microtasking Library Headers & Lint Files"
 set name=info.classification \
     value=org.opensolaris.category.2008:System/Libraries
+# set name=org.opensolaris.consolidation value=sunpro
 set name=variant.arch value=$(ARCH)
+set name=variant.opensolaris.zone value=global value=nonglobal
+depend fmri=pkg:/system/library/math/header-math@$(PKGVERS) type=require
--- old/usr/src/pkg/manifests/SUNWlibms.mf	2014-05-04 03:07:37.212270646 +0200
+++ new/usr/src/pkg/manifests/SUNWlibms.mf	2014-05-04 03:07:37.234680432 +0200
@@ -14,13 +14,13 @@
 #
 
 set name=pkg.fmri value=pkg:/SUNWlibms@0.5.11,5.11-0.132
-set name=pkg.description value="Math Libraries"
+set name=pkg.description value="Math & Microtasking Libraries"
 # license license=SUNWlibms.copyright
 # license license=SUNWlibmsr.copyright
 set name=pkg.renamed value=true
 # set name=pkg.renamed value=true
-set name=pkg.summary value="Math Libraries"
-set name=description value="Math Libraries"
+set name=pkg.summary value="Math & Microtasking Libraries"
+set name=description value="Math & Microtasking Libraries"
 set name=info.classification \
     value=org.opensolaris.category.2008:System/Libraries
 set name=variant.arch value=$(ARCH)
--- old/usr/src/tools/aw/aw.c	2014-05-04 03:07:39.759334274 +0200
+++ new/usr/src/tools/aw/aw.c	2014-05-04 03:07:39.789393279 +0200
@@ -571,9 +571,9 @@
 			 * preprocessor, if present, or to gas if not.
 			 */
 			filename = arg;
-			if (arglen > 2 &&
-			    (strcmp(arg + arglen - 2, ".s") == 0) ||
-			    (strcmp(arg + arglen - 2, ".S") == 0)) {
+			if ((arglen > 2) &&
+			    ((strcmp(arg + arglen - 2, ".s") == 0) ||
+			    (strcmp(arg + arglen - 2, ".S") == 0))) {
 				/*
 				 * Though 'as' allows multiple assembler
 				 * files to be processed in one invocation
--- old/usr/src/tools/cw/cw.c	2014-05-04 03:07:41.615736743 +0200
+++ new/usr/src/tools/cw/cw.c	2014-05-04 03:07:41.842270361 +0200
@@ -20,9 +20,6 @@
  */
 
 /*
-* Copyright 2011, Richard Lowe.
-*/
-/*
  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
@@ -36,7 +33,7 @@
  */
 
 /* If you modify this file, you must increment CW_VERSION */
-#define	CW_VERSION	"1.30"
+#define	CW_VERSION	"1.29"
 
 /*
  * -#		Verbose mode
