/*
* 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 1988 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include "base_conversion.h"
/* Normalize a number. Does not affect zeros, infs, or NaNs. */
void
{
int i;
long unsigned t;
if (nlzwords >= UNPACKED_SIZE) {
return;
}
if (nlzwords > 0) {
for (i = 0; i < UNPACKED_SIZE - nlzwords; i++)
for (; i < UNPACKED_SIZE; i++)
pu->significand[i] = 0;
}
/* nlzwords is now the count of trailing zero words. */
nlzbits = 0;
t = pu->significand[0];
/* TESTS to determine normalize count. */
SHIFTMACRO(16);
SHIFTMACRO(8);
SHIFTMACRO(4);
SHIFTMACRO(2);
SHIFTMACRO(1);
}
}
}
}
/* Set the exception bit in the current exception register. */
void
{
}
enum fp_class_type
_class_double(double *x)
{
kluge.x = *x;
return fp_zero;
else
return fp_subnormal;
return fp_infinity;
return fp_quiet;
else
return fp_signaling;
} else
return fp_normal;
}
/* Left shift significand by 11 <= n <= 16 bits. Affect all classes. */
void
{
int i;
for (i = UNPACKED_SIZE - 1; i >= 0; i--) {
}
}
void
{
int i;
x.x = *px;
for (i = 2; i < UNPACKED_SIZE; i++)
pu->significand[i] = 0;
return;
} else { /* subnormal */
return;
}
return;
} else { /* nan */
} else {/* signaling */
}
return;
}
}
}
enum fp_class_type
{
int i;
for (i = 0; i < 4; i++)
#ifdef __STDC__
kluge.x = *x;
#else
kluge.x.u[i] = x->u[i];
#endif
if ((kluge.f.msw.significand == 0) && (kluge.f.significand2 == 0) && (kluge.f.significand3 == 0) && (kluge.f.significand4 == 0))
return fp_zero;
else
return fp_subnormal;
if ((kluge.f.msw.significand == 0) && (kluge.f.significand2 == 0) && (kluge.f.significand3 == 0) && (kluge.f.significand4 == 0))
return fp_infinity;
return fp_quiet;
else
return fp_signaling;
} else
return fp_normal;
}
void
{
int i;
for (i = 0; i < 4; i++)
#ifdef __STDC__
x.x = *px;
#else
x.x.u[i] = px->u[i];
#endif
for (i = 4; i < UNPACKED_SIZE; i++)
pu->significand[i] = 0;
if ((x.f.msw.significand | x.f.significand2 | x.f.significand3 | x.f.significand4) == 0) { /* zero */
goto ret;
} else { /* subnormal */
goto ret;
}
if ((x.f.msw.significand | x.f.significand2 | x.f.significand3 | x.f.significand4) == 0) { /* inf */
goto ret;
} else { /* nan */
} else {/* signaling */
}
goto ret;
}
}
ret:
/*
* printf("/n _unpack_quadruple ") ; _display_unpacked(pu);
*/
return;
}