1 .\" $NetBSD: fpgetmask.3,v 1.12 2011/03/27 22:55:07 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.
42 .Nd IEEE FP mode control
56 .Fn fpsetmask "fp_except_t mask"
58 .Fn fpsetprec "fp_prec_t prec"
60 .Fn fpsetround "fp_rnd_t rnd_dir"
62 .Fn fpsetsticky "fp_except_t sticky"
67 .Bl -column -offset indent FP_RZ
68 .It Dv FP_RZ Ta rounding towards Em zero
69 .It Dv FP_RM Ta rounding down to Pq Em Minus infinity
70 .It Dv FP_RN Ta rounding to Em nearest
71 .It Dv FP_RP Ta rounding down to Pq Em Plus infinity
78 value is a bitmask specifying an exception type and containing any of
79 the values listed below.
80 .Bl -column -offset indent FP_X_UFLxx
81 .It Dv FP_X_INV Ta Invalid\ Operation
82 .It Dv FP_X_DZ Ta Division\ by\ zero
83 .It Dv FP_X_OFL Ta Overflow
84 .It Dv FP_X_UFL Ta Underflow
85 .It Dv FP_X_IMP Ta Imprecision (inexact)
86 .It Dv FP_X_IOV Ta Integer\ Overflow
91 specifies the precision of the floating point operations listed below.
92 .Bl -column -offset indent FP_RPS
93 .It Dv FP_PS Ta Dv 24 bit (single-precision)
94 .It Dv FP_PRS Ta reserved
95 .It Dv FP_PD Ta Dv 53 bit (double-precision)
96 .It Dv FP_PE Ta Dv 64 bit (extended-precision)
101 function will set the current exception mask, i.e., it will cause
102 future operations with the specified result status to raise the
107 function will return the current exception mask.
111 function will return the current floating point precision.
114 function will set the floating point precision and will return
115 the previous precision.
119 function will cause future operations to use the specified dynamic
123 function will return the current rounding mode.
124 .Bl -tag -width Note:x
126 On some architectures, instructions can optionally specify static
127 rounding modes and exception enables that will supersede the specified
129 On other architectures, these features may not be fully supported.
134 status word may be maintained in which a bit is set every time an
135 exceptional floating point condition is encountered, whether or not a
140 function will set or clear the specified exception history bits.
143 function will return the exception history bits.
160 exception mask and exception history bits.
165 There is no way to return an unsupported value.
166 Not all processors support all the modes.
167 These interfaces are deprecated and the ones
170 should be used, although the interfaces in
172 don't support getting or setting the precision.