ieeefp.h revision 13765
11834Swollman/*-
21834Swollman * Copyright (c) 1990 Andrew Moore, Talke Studio
31834Swollman * All rights reserved.
41834Swollman *
51834Swollman * Redistribution and use in source and binary forms, with or without
61834Swollman * modification, are permitted provided that the following conditions
71834Swollman * are met:
81834Swollman * 1. Redistributions of source code must retain the above copyright
91834Swollman *    notice, this list of conditions and the following disclaimer.
101834Swollman * 2. Redistributions in binary form must reproduce the above copyright
111834Swollman *    notice, this list of conditions and the following disclaimer in the
121834Swollman *    documentation and/or other materials provided with the distribution.
131834Swollman * 3. All advertising materials mentioning features or use of this software
141834Swollman *    must display the following acknowledgement:
151834Swollman *	This product includes software developed by the University of
161834Swollman *	California, Berkeley and its contributors.
171834Swollman * 4. Neither the name of the University nor the names of its contributors
181834Swollman *    may be used to endorse or promote products derived from this software
191834Swollman *    without specific prior written permission.
201834Swollman *
211834Swollman * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
221834Swollman * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
231834Swollman * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
241834Swollman * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
251834Swollman * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
261834Swollman * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
271834Swollman * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
281834Swollman * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
291834Swollman * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
301834Swollman * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
311834Swollman * SUCH DAMAGE.
321834Swollman *
331834Swollman * 	from: @(#) ieeefp.h 	1.0 (Berkeley) 9/23/93
3413765Smpp *	$Id: ieeefp.h,v 1.2 1994/08/05 14:36:04 wollman Exp $
351834Swollman */
361834Swollman
371834Swollman/*
381834Swollman *	IEEE floating point type and constant definitions.
391834Swollman */
401834Swollman
411862Swollman#ifndef _MACHINE_IEEEFP_H_
421862Swollman#define _MACHINE_IEEEFP_H_
431834Swollman
441834Swollman/*
451834Swollman * FP rounding modes
461834Swollman */
471834Swollmantypedef enum {
481834Swollman	FP_RN=0,	/* round to nearest */
491834Swollman	FP_RM,		/* round down to minus infinity */
501834Swollman	FP_RP,		/* round up to plus infinity */
511834Swollman	FP_RZ		/* truncate */
521834Swollman} fp_rnd_t;
531834Swollman
541834Swollman/*
5513765Smpp * FP precision modes
561834Swollman */
571834Swollmantypedef enum {
5813765Smpp	FP_PS=0,	/* 24 bit (single-precision) */
591834Swollman	FP_PRS,		/* reserved */
601834Swollman	FP_PD,		/* 53 bit (double-precision) */
6113765Smpp	FP_PE		/* 64 bit (extended-precision) */
621834Swollman} fp_prec_t;
631834Swollman
641834Swollman#define fp_except_t	int
651834Swollman
661834Swollman/*
671834Swollman * FP exception masks
681834Swollman */
691834Swollman#define FP_X_INV	0x01	/* invalid operation */
701834Swollman#define FP_X_DNML	0x02	/* denormal */
711834Swollman#define FP_X_DZ		0x04	/* zero divide */
721834Swollman#define FP_X_OFL	0x08	/* overflow */
731834Swollman#define FP_X_UFL	0x10	/* underflow */
741834Swollman#define FP_X_IMP	0x20	/* (im)precision */
751834Swollman
761834Swollman/*
771834Swollman * FP registers
781834Swollman */
791834Swollman#define FP_MSKS_REG	0	/* exception masks */
801834Swollman#define FP_PRC_REG	0	/* precision */
811834Swollman#define FP_RND_REG	0	/* direction */
821834Swollman#define FP_STKY_REG	1	/* sticky flags */
831834Swollman
841834Swollman/*
851834Swollman * FP register bit field masks
861834Swollman */
871834Swollman#define FP_MSKS_FLD	0x3f	/* exception masks field */
881834Swollman#define FP_PRC_FLD	0x300	/* precision control field */
891834Swollman#define FP_RND_FLD	0xc00	/* round control field */
901834Swollman#define FP_STKY_FLD	0x3f	/* sticky flags field */
911834Swollman
921834Swollman/*
931834Swollman * FP register bit field offsets
941834Swollman */
951834Swollman#define FP_MSKS_OFF	0	/* exception masks offset */
961834Swollman#define FP_PRC_OFF	8	/* precision control offset */
971834Swollman#define FP_RND_OFF	10	/* round control offset */
981834Swollman#define FP_STKY_OFF	0	/* sticky flags offset */
991834Swollman
1001862Swollman#endif /* !_MACHINE_IEEEFP_H_ */
101