/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 1994-1997, by Sun Microsystems, Inc.
* All rights reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include "quad.h"
#ifdef __sparcv9
#endif
/*
* _Q_qtos(x) returns (float)*x.
*/
float
{
union {
float f;
unsigned int l;
} u;
int subnormal, e;
/* get the rounding mode, fudging directed rounding modes */
/* as though the result were positive */
if (x->l.msw & 0x80000000)
/* handle nan, inf, and out-of-range cases */
if (xm >= 0x407f0000) {
if (xm >= 0x7fff0000) {
x->l.frac4) {
/* x is nan */
(x->l.frac2 >> 25);
if (!(xm & 0x8000)) {
/* snan, signal invalid */
__quad_fqtos(x, &u.f);
} else {
}
}
return (u.f);
}
/* x is inf */
return (u.f);
}
/* x is too big, overflow */
u.l = 0x7f800000;
else
u.l = 0x7f7fffff;
u.l |= (x->l.msw & 0x80000000);
__quad_fqtos(x, &u.f);
} else {
}
return (u.f);
}
subnormal = 0;
if (xm < 0x3f810000) {
if (xm < 0x3f690000) {
if (QUAD_ISZERO(*x)) {
u.l = (x->l.msw & 0x80000000);
return (u.f);
}
/* x is too small, underflow */
u.l |= (x->l.msw & 0x80000000);
__quad_fqtos(x, &u.f);
} else {
}
return (u.f);
}
/* x is in the subnormal range for single */
subnormal = 1;
round = u.l & (1 << e);
u.l >>= e + 1;
} else {
/* x is in the normal range for single */
}
/* see if we need to round */
if (subnormal)
/* round up if necessary */
(u.l & 1)))) {
/* round up and check for overflow */
if (++u.l >= 0x7f800000)
}
}
/* if result is exact and subnormal but underflow trapping is */
/* enabled, signal underflow */
/* attach the sign and raise exceptions as need be */
u.l |= (x->l.msw & 0x80000000);
__quad_fqtos(x, &u.f);
} else {
}
return (u.f);
}