/*
* 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,1995-1996,2003 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/* Pack procedures for Sparc FPU simulator. */
/*
* Returns 1 if overflow should go to infinity, 0 if to max finite.
*/
static int
int sign) /* negative or positive */
{
int inf;
switch (pfpsd->fp_direction) {
case fp_nearest:
inf = 1;
break;
case fp_tozero:
inf = 0;
break;
case fp_positive:
break;
case fp_negative:
break;
}
return (inf);
}
/*
* Round according to current rounding mode.
*/
static void
{
int sr;
if (sr == 0)
return;
switch (pfpsd->fp_direction) {
case fp_nearest:
break;
case fp_tozero:
increment = 0;
break;
case fp_positive:
break;
case fp_negative:
break;
}
if (increment) {
}
}
}
}
}
}
}
static void
{
case fp_zero:
*px = 0;
break;
case fp_normal:
goto overflow;
goto overflow;
break;
case fp_infinity:
case fp_quiet:
case fp_signaling:
*px = 0x80000000;
else
*px = 0x7fffffff;
break;
}
}
static void
{
union {
uint32_t i[2];
} x;
case fp_zero:
*px = 0;
break;
case fp_normal:
goto overflow;
goto overflow;
break;
case fp_infinity:
case fp_quiet:
case fp_signaling:
else
break;
}
}
static void
{
case fp_zero:
px->significand = 0;
break;
case fp_infinity:
px->significand = 0;
break;
case fp_quiet:
case fp_signaling:
break;
case fp_normal:
/*
* rounded
* back up to
* normal
*/
px->significand = 0;
} else
~(1 << (int)fp_inexact);
}
return;
}
}
~(1 << (int)fp_inexact);
}
goto infinity;
return;
}
}
}
static void
{
case fp_zero:
px->significand = 0;
*py = 0;
break;
case fp_infinity:
px->significand = 0;
*py = 0;
break;
case fp_quiet:
case fp_signaling:
break;
case fp_normal:
/*
* rounded
* back up to
* normal
*/
px->significand = 0;
*py = 0;
} else {
}
~(1 << (int)fp_inexact);
}
return;
}
}
~(1 << (int)fp_inexact);
}
goto infinity;
*py = 0xffffffffU;
return;
}
break;
}
}
static void
{
case fp_zero:
px->significand = 0;
*pz = 0;
*py = 0;
*pw = 0;
break;
case fp_infinity:
px->significand = 0;
*pz = 0;
*py = 0;
*pw = 0;
break;
case fp_quiet:
case fp_signaling:
/*
* Insure quiet
* nan.
*/
break;
case fp_normal:
/*
* not rounded
* back up
* to normal
*/
} else {
}
~(1 << (int)fp_inexact);
}
return;
}
~(1 << (int)fp_inexact);
}
goto infinity;
*py = 0xffffffffU;
*pz = 0xffffffffU;
*pw = 0xffffffffU;
return;
}
break;
}
}
void
uint_t n, /* register where datum starts */
{
switch (type) {
case fp_op_int32:
{
int32_t x;
break;
}
case fp_op_int64:
{
int64_t x;
if ((n & 0x1) == 1) /* fix register encoding */
n = (n & 0x1e) | 0x20;
break;
}
case fp_op_single:
{
single_type x;
break;
}
case fp_op_double:
{
union {
double_type x[2];
uint32_t y[2];
} db;
if (!(pfpsd->fp_current_exceptions &
if ((n & 0x1) == 1) /* fix register encoding */
n = (n & 0x1e) | 0x20;
pfpsd);
}
break;
}
case fp_op_extended:
{
union {
uint32_t y[4];
} ex;
unpacked U;
int k;
switch (pfpsd->fp_precision) {
/*
* Implement extended
* rounding precision
* mode.
*/
case fp_single:
{
pu = &U;
break;
}
case fp_double:
{
pu = &U;
break;
}
case fp_precision_3: /* rounded to 64 bits */
{
if (k >= 0) k = 113-64;
else k = 113-64-k;
break;
}
}
if (!(pfpsd->fp_current_exceptions &
if ((n & 0x1) == 1) /* fix register encoding */
n = (n & 0x1e) | 0x20;
}
break;
}
}
}
void
uint_t n) /* register where datum starts */
{
}
void
uint_t n) /* register where datum starts */
{
if ((n & 1) == 1) /* fix register encoding */
n = (n & 0x1e) | 0x20;
}