1 .\" $NetBSD: fpgetmask.3,v 1.9 2004/04/04 23:41:23 wiz Exp $
3 .\" Copyright (c) 1999 The NetBSD Foundation, Inc.
4 .\" All rights reserved.
6 .\" This code is derived from software contributed to The NetBSD Foundation
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\" notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\" notice, this list of conditions and the following disclaimer in the
16 .\" documentation and/or other materials provided with the distribution.
18 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20 .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21 .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22 .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 .\" POSSIBILITY OF SUCH DAMAGE.
40 .Nd IEEE FP mode control
52 .Fn fpsetmask fp_except\ mask
54 .Fn fpsetround fp_rnd\ rnd_dir
56 .Fn fpsetsticky fp_except\ sticky
58 A rounding mode is one of
59 .Dv FP_RZ , FP_RM , FP_RN ,
62 for rounding towards zero, rounding
74 value is a bitmask specifying an exception type and containing any of
75 the values listed below.
76 .Bl -column -offset indent FP_X_UFLxx
77 .It Dv FP_X_INV Ta Invalid\ Operation
78 .It Dv FP_X_DZ Ta Division\ by\ zero
79 .It Dv FP_X_OFL Ta Overflow
80 .It Dv FP_X_UFL Ta Underflow
81 .It Dv FP_X_IMP Ta Imprecision (inexact)
82 .It Dv FP_X_IOV Ta Integer\ Overflow
87 function will set the current exception mask, i.e., it will cause
88 future operations with the specified result status to raise the
93 function will return the current exception mask.
97 function will cause future operations to use the specified dynamic
101 function will return the current rounding mode.
102 .Bl -tag -width Note:x
104 On some architectures, instructions can optionally specify static
105 rounding modes and exception enables that will supersede the specified
107 On other architectures, these features may not be fully supported.
112 status word may be maintained in which a bit is set every time an
113 exceptional floating point condition is encountered, whether or not a
118 function will set or clear the specified exception history bits.
121 function will return the exception history bits.
138 exception mask and exception history bits.