ieeefp.h revision 1.2
11.2Sskrll/* $NetBSD: ieeefp.h,v 1.2 2020/03/14 16:12:16 skrll Exp $ */ 21.1Smatt 31.2Sskrll/* 41.1Smatt * Based on ieeefp.h written by J.T. Conklin, Apr 28, 1995 51.1Smatt * Public domain. 61.1Smatt */ 71.1Smatt 81.1Smatt#ifndef _RISCV_IEEEFP_H_ 91.1Smatt#define _RISCV_IEEEFP_H_ 101.1Smatt 111.1Smatt#include <sys/featuretest.h> 121.1Smatt 131.1Smatt#if defined(_NETBSD_SOURCE) || defined(_ISOC99_SOURCE) 141.1Smatt 151.1Smatt#include <riscv/fenv.h> 161.1Smatt 171.1Smatt#if !defined(_ISOC99_SOURCE) 181.1Smatt 191.1Smatt/* Exception type (used by fpsetmask() et al.) */ 201.1Smatt 211.1Smatttypedef int fp_except; 221.1Smatt 231.1Smatt/* Bit defines for fp_except */ 241.1Smatt 251.1Smatt#define FP_X_INV FE_INVALID /* invalid operation exception */ 261.1Smatt#define FP_X_DZ FE_DIVBYZERO /* divide-by-zero exception */ 271.1Smatt#define FP_X_OFL FE_OVERFLOW /* overflow exception */ 281.1Smatt#define FP_X_UFL FE_UNDERFLOW /* underflow exception */ 291.1Smatt#define FP_X_IMP FE_INEXACT /* imprecise (prec. loss; "inexact") */ 301.1Smatt 311.1Smatt/* Rounding modes */ 321.1Smatt 331.1Smatttypedef enum { 341.1Smatt FP_RN=FE_TONEAREST, /* round to nearest representable number */ 351.1Smatt FP_RP=FE_UPWARD, /* round toward positive infinity */ 361.1Smatt FP_RM=FE_DOWNWARD, /* round toward negative infinity */ 371.1Smatt FP_RZ=FE_TOWARDZERO /* round to zero (truncate) */ 381.1Smatt} fp_rnd; 391.1Smatt 401.1Smatt#endif /* !_ISOC99_SOURCE */ 411.1Smatt 421.1Smatt#endif /* _NETBSD_SOURCE || _ISOC99_SOURCE */ 431.1Smatt 441.1Smatt#endif /* _RISCV_IEEEFP_H_ */ 45