4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 1988 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
30 #pragma ident "%Z%%M% %I% %E% SMI"
32 /* Sparc floating-point simulator PRIVATE include file. */
34 /* PRIVATE CONSTANTS */
35 #define INTEGER_BIAS 31
36 #define SINGLE_BIAS 127
37 #define DOUBLE_BIAS 1023
38 #define EXTENDED_BIAS 16383
44 #define PRIVATE static
49 enum fp_class_type fpclass
;
50 int exponent
; /* Unbiased exponent. */
51 unsigned significand
[4] ; /* Four significand word . */
52 int rounded
; /* rounded bit */
53 int sticky
; /* stick bit */
56 /* PRIVATE GLOBAL VARIABLES */
58 enum fp_direction_type fp_direction
; /* Current rounding direction. */
59 enum fp_precision_type fp_precision
; /* Current extended rounding precision. */
61 unsigned _fp_current_exceptions
; /* Current floating-point exceptions. */
63 extern void _fp_unpack(unpacked
*, int *, enum fp_op_type
);
64 /* unpacked *pu ; */ /* unpacked result */
65 /* int *n ; */ /* register where data starts */
66 /* fp_op_type type ;*/ /* type of datum */
68 extern void _fp_pack(unpacked
*, int *, enum fp_op_type
);
69 /* unpacked *pu ; */ /* unpacked result */
70 /* int *n ; */ /* register where data starts */
71 /* fp_op_type type ; */ /* type of datum */
73 extern void fpu_normalize(unpacked
*);
74 /* unpacked *pu ; */ /* unpacked operand and result */
76 extern void fpu_rightshift(unpacked
*, int);
77 /* unpacked *pu ; unsigned n ; */
78 /* Right shift significand sticky by n bits. */
80 extern unsigned fpu_add3wc(unsigned *, unsigned, unsigned, unsigned);
81 /* unsigned *z,x,y,c; */ /* *z = x+y+carry; return new carry */
83 extern unsigned fpu_sub3wc(unsigned *, unsigned, unsigned, unsigned);
84 /* unsigned *z,x,y,c; */ /* *z = x-y-carry; return new carry */
86 extern unsigned fpu_neg2wc(unsigned *, unsigned, unsigned);
87 /* unsigned *z,x,c; */ /* *z = 0-x-carry; return new carry */
89 extern int fpu_cmpli(unsigned [], unsigned [], int);
90 /* unsigned x[],y[],n; */ /* n-word compare */
92 extern void fpu_set_exception(enum fp_exception_type
);
93 /* enum fp_exception_type ex ; */ /* exception to be set in curexcep */
95 extern void fpu_error_nan(unpacked
*);
96 /* unpacked *pu ; */ /* Set invalid exception and error nan in *pu */
98 extern void unpacksingle(unpacked
*, single_type
);
99 /* unpacked *pu; */ /* packed result */
100 /* single_type x; */ /* packed single */
102 extern void unpackdouble(unpacked
*, double_type
, unsigned);
103 /* unpacked *pu; */ /* unpacked result */
104 /* double_type x; */ /* packed double */
107 extern enum fcc_type
_fp_compare(unpacked
*, unpacked
*, int);
109 extern void _fp_add(unpacked
*, unpacked
*, unpacked
*);
110 extern void _fp_sub(unpacked
*, unpacked
*, unpacked
*);
111 extern void _fp_mul(unpacked
*, unpacked
*, unpacked
*);
112 extern void _fp_div(unpacked
*, unpacked
*, unpacked
*);
113 extern void _fp_sqrt(unpacked
*, unpacked
*);
115 #endif /* _qglobals_h */