ieeefp.h revision 118798
192108Sphk/*-
292108Sphk * Copyright (c) 2001 Doug Rabson
392108Sphk * All rights reserved.
492108Sphk *
592108Sphk * Redistribution and use in source and binary forms, with or without
692108Sphk * modification, are permitted provided that the following conditions
792108Sphk * are met:
892108Sphk * 1. Redistributions of source code must retain the above copyright
992108Sphk *    notice, this list of conditions and the following disclaimer.
1092108Sphk * 2. Redistributions in binary form must reproduce the above copyright
1192108Sphk *    notice, this list of conditions and the following disclaimer in the
1292108Sphk *    documentation and/or other materials provided with the distribution.
1392108Sphk *
1492108Sphk * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1592108Sphk * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1692108Sphk * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1792108Sphk * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
1892108Sphk * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1992108Sphk * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2092108Sphk * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2192108Sphk * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2292108Sphk * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2392108Sphk * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2492108Sphk * SUCH DAMAGE.
2592108Sphk *
2692108Sphk * $FreeBSD: head/sys/ia64/include/ieeefp.h 118798 2003-08-11 21:25:19Z marcel $
2792108Sphk */
2892108Sphk
2992108Sphk#ifndef _MACHINE_IEEEFP_H_
3092108Sphk#define _MACHINE_IEEEFP_H_
3192108Sphk
3292108Sphk#include <machine/fpu.h>
3392108Sphk
3492108Sphktypedef int fp_except_t;
3592108Sphk#define	FP_X_INV	IA64_FPSR_TRAP_VD /* invalid operation exception */
3692108Sphk#define	FP_X_DZ		IA64_FPSR_TRAP_ZD /* divide-by-zero exception */
3792108Sphk#define	FP_X_OFL	IA64_FPSR_TRAP_OD /* overflow exception */
38104519Sphk#define	FP_X_UFL	IA64_FPSR_TRAP_UD /* underflow exception */
39104519Sphk#define	FP_X_IMP	IA64_FPSR_TRAP_ID /* imprecise(inexact) exception */
40104519Sphk
4192108Sphktypedef enum {
4292108Sphk	FP_RZ=0,		/* round to zero (truncate) */
4392108Sphk	FP_RM=1,		/* round toward negative infinity */
4492108Sphk	FP_RN=2,		/* round to nearest representable number */
4592108Sphk	FP_RP=3			/* round toward positive infinity */
4692108Sphk} fp_rnd_t;
4792108Sphk
48103714Sphk#endif /* _MACHINE_IEEEFP_H_ */
4992108Sphk