Print this page
5261 libm should stop using synonyms.h
5298 fabs is 0-sized, confuses dis(1) and others
Reviewed by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
Approved by: Gordon Ross <gwr@nexenta.com>
5262 libm needs to be carefully unifdef'd
5268 libm doesn't need to hide symbols which are already local
Reviewed by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
Reviewed by: Gordon Ross <gwr@nexenta.com>
Approved by: Gordon Ross <gwr@nexenta.com>
*** 25,42 ****
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
! #if defined(ELFOBJ)
! #pragma weak ilogb = __ilogb
! #endif
#include "libm.h"
#include "xpg6.h" /* __xpg6 */
! #if defined(USE_FPSCALE) || defined(__x86)
static const double two52 = 4503599627370496.0;
#else
/*
* v: high part of a non-zero subnormal |x|; w: low part of |x|
*/
--- 25,40 ----
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
! #pragma weak __ilogb = ilogb
#include "libm.h"
#include "xpg6.h" /* __xpg6 */
! #if defined(__x86)
static const double two52 = 4503599627370496.0;
#else
/*
* v: high part of a non-zero subnormal |x|; w: low part of |x|
*/
*** 55,65 ****
if (v & 0xf0)
r += 4, v >>= 4;
v <<= 1;
return (r + ((0xffffaa50 >> v) & 0x3));
}
! #endif /* defined(USE_FPSCALE) */
static int
raise_invalid(int v) { /* SUSv3 requires ilogb(0,+/-Inf,NaN) raise invalid */
#ifndef lint
if ((__xpg6 & _C99SUSv3_ilogb_0InfNaN_raises_invalid) != 0) {
--- 53,63 ----
if (v & 0xf0)
r += 4, v >>= 4;
v <<= 1;
return (r + ((0xffffaa50 >> v) & 0x3));
}
! #endif /* defined(__x86) */
static int
raise_invalid(int v) { /* SUSv3 requires ilogb(0,+/-Inf,NaN) raise invalid */
#ifndef lint
if ((__xpg6 & _C99SUSv3_ilogb_0InfNaN_raises_invalid) != 0) {
*** 78,88 ****
if (k < 0x00100000) {
if ((px[LOWORD] | k) == 0)
return (raise_invalid(0x80000001));
else {
! #if defined(USE_FPSCALE) || defined(__x86)
x *= two52;
return (((px[HIWORD] & 0x7ff00000) >> 20) - 1075);
#else
return (ilogb_subnormal(k, px[LOWORD]));
#endif
--- 76,86 ----
if (k < 0x00100000) {
if ((px[LOWORD] | k) == 0)
return (raise_invalid(0x80000001));
else {
! #if defined(__x86)
x *= two52;
return (((px[HIWORD] & 0x7ff00000) >> 20) - 1075);
#else
return (ilogb_subnormal(k, px[LOWORD]));
#endif