xref: /onnv-gate/usr/src/uts/common/sys/ieeefp.h (revision 641:057d58d31499)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
50Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
60Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
70Sstevel@tonic-gate  * with the License.
80Sstevel@tonic-gate  *
90Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
100Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
110Sstevel@tonic-gate  * See the License for the specific language governing permissions
120Sstevel@tonic-gate  * and limitations under the License.
130Sstevel@tonic-gate  *
140Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
150Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
160Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
170Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
180Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
190Sstevel@tonic-gate  *
200Sstevel@tonic-gate  * CDDL HEADER END
210Sstevel@tonic-gate  */
220Sstevel@tonic-gate /*
23*641Skalai  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
240Sstevel@tonic-gate  * Use is subject to license terms.
250Sstevel@tonic-gate  */
260Sstevel@tonic-gate 
270Sstevel@tonic-gate #ifndef _SYS_IEEEFP_H
280Sstevel@tonic-gate #define	_SYS_IEEEFP_H
290Sstevel@tonic-gate 
300Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"	/* SunOS4.0 1.6	*/
310Sstevel@tonic-gate 
320Sstevel@tonic-gate #ifdef	__cplusplus
330Sstevel@tonic-gate extern "C" {
340Sstevel@tonic-gate #endif
350Sstevel@tonic-gate 
360Sstevel@tonic-gate /*
370Sstevel@tonic-gate  * Sun types for IEEE floating point.
380Sstevel@tonic-gate  */
390Sstevel@tonic-gate 
400Sstevel@tonic-gate #if defined(__sparc)
410Sstevel@tonic-gate 
420Sstevel@tonic-gate enum fp_direction_type {	/* rounding direction */
430Sstevel@tonic-gate 	fp_nearest	= 0,
440Sstevel@tonic-gate 	fp_tozero	= 1,
450Sstevel@tonic-gate 	fp_positive	= 2,
460Sstevel@tonic-gate 	fp_negative	= 3
470Sstevel@tonic-gate };
480Sstevel@tonic-gate 
490Sstevel@tonic-gate enum fp_precision_type {	/* extended rounding precision */
500Sstevel@tonic-gate 	fp_extended	= 0,
510Sstevel@tonic-gate 	fp_single	= 1,
520Sstevel@tonic-gate 	fp_double	= 2,
530Sstevel@tonic-gate 	fp_precision_3	= 3
540Sstevel@tonic-gate };
550Sstevel@tonic-gate 
560Sstevel@tonic-gate enum fp_exception_type {	/* exceptions according to bit number */
570Sstevel@tonic-gate 	fp_inexact	= 0,
580Sstevel@tonic-gate 	fp_division	= 1,
590Sstevel@tonic-gate 	fp_underflow	= 2,
600Sstevel@tonic-gate 	fp_overflow	= 3,
610Sstevel@tonic-gate 	fp_invalid	= 4
620Sstevel@tonic-gate };
630Sstevel@tonic-gate 
640Sstevel@tonic-gate enum fp_trap_enable_type {	/* trap enable bits according to bit number */
650Sstevel@tonic-gate 	fp_trap_inexact	= 0,
660Sstevel@tonic-gate 	fp_trap_division	= 1,
670Sstevel@tonic-gate 	fp_trap_underflow	= 2,
680Sstevel@tonic-gate 	fp_trap_overflow	= 3,
690Sstevel@tonic-gate 	fp_trap_invalid	= 4
700Sstevel@tonic-gate };
710Sstevel@tonic-gate 
720Sstevel@tonic-gate #elif defined(__i386) || defined(__amd64)
730Sstevel@tonic-gate 
740Sstevel@tonic-gate enum fp_direction_type {	/* rounding direction */
750Sstevel@tonic-gate 	fp_nearest	= 0,
760Sstevel@tonic-gate 	fp_negative	= 1,
770Sstevel@tonic-gate 	fp_positive	= 2,
780Sstevel@tonic-gate 	fp_tozero	= 3
790Sstevel@tonic-gate };
800Sstevel@tonic-gate 
810Sstevel@tonic-gate enum fp_precision_type {	/* extended rounding precision */
820Sstevel@tonic-gate 	fp_single	= 0,
830Sstevel@tonic-gate 	fp_precision_3	= 1,
840Sstevel@tonic-gate 	fp_double	= 2,
850Sstevel@tonic-gate 	fp_extended	= 3
860Sstevel@tonic-gate };
870Sstevel@tonic-gate 
880Sstevel@tonic-gate enum fp_exception_type {	/* exceptions according to bit number */
890Sstevel@tonic-gate 	fp_invalid	= 0,
900Sstevel@tonic-gate 	fp_denormalized	= 1,
910Sstevel@tonic-gate 	fp_division	= 2,
920Sstevel@tonic-gate 	fp_overflow	= 3,
930Sstevel@tonic-gate 	fp_underflow	= 4,
940Sstevel@tonic-gate 	fp_inexact	= 5
950Sstevel@tonic-gate };
960Sstevel@tonic-gate 
970Sstevel@tonic-gate enum fp_trap_enable_type {	/* trap enable bits according to bit number */
980Sstevel@tonic-gate 	fp_trap_invalid	= 0,
990Sstevel@tonic-gate 	fp_trap_denormalized	= 1,
1000Sstevel@tonic-gate 	fp_trap_division	= 2,
1010Sstevel@tonic-gate 	fp_trap_overflow	= 3,
1020Sstevel@tonic-gate 	fp_trap_underflow	= 4,
1030Sstevel@tonic-gate 	fp_trap_inexact	= 5
1040Sstevel@tonic-gate };
1050Sstevel@tonic-gate 
106*641Skalai #endif	/* __i386 || __amd64 */
1070Sstevel@tonic-gate 
1080Sstevel@tonic-gate enum fp_class_type {		/* floating-point classes */
1090Sstevel@tonic-gate 	fp_zero		= 0,
1100Sstevel@tonic-gate 	fp_subnormal	= 1,
1110Sstevel@tonic-gate 	fp_normal	= 2,
1120Sstevel@tonic-gate 	fp_infinity   	= 3,
1130Sstevel@tonic-gate 	fp_quiet	= 4,
1140Sstevel@tonic-gate 	fp_signaling	= 5
1150Sstevel@tonic-gate };
1160Sstevel@tonic-gate 
1170Sstevel@tonic-gate #ifdef	__cplusplus
1180Sstevel@tonic-gate }
1190Sstevel@tonic-gate #endif
1200Sstevel@tonic-gate 
1210Sstevel@tonic-gate #endif	/* _SYS_IEEEFP_H */
122