Module Name: src Committed By: nros Date: Sat Dec 12 19:05:45 UTC 2015
Modified Files: src/distrib/sets/lists/comp: mi src/lib/libm: Makefile Added Files: src/lib/libm/man: fma.3 Log Message: Add manpage to the fma function in libm. The manpage is taken from the FreeBSD project since the fma implementation is based on the one in FreeBSD. To generate a diff of this commit: cvs rdiff -u -r1.2008 -r1.2009 src/distrib/sets/lists/comp/mi cvs rdiff -u -r1.170 -r1.171 src/lib/libm/Makefile cvs rdiff -u -r0 -r1.1 src/lib/libm/man/fma.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/distrib/sets/lists/comp/mi diff -u src/distrib/sets/lists/comp/mi:1.2008 src/distrib/sets/lists/comp/mi:1.2009 --- src/distrib/sets/lists/comp/mi:1.2008 Sun Nov 29 06:10:01 2015 +++ src/distrib/sets/lists/comp/mi Sat Dec 12 19:05:45 2015 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.2008 2015/11/29 06:10:01 pgoyette Exp $ +# $NetBSD: mi,v 1.2009 2015/12/12 19:05:45 nros Exp $ # # Note: don't delete entries from here - mark them as "obsolete" instead. ./etc/mtree/set.comp comp-sys-root @@ -6231,6 +6231,9 @@ ./usr/share/man/cat3/fls64.0 comp-c-catman .cat ./usr/share/man/cat3/flushinp.0 comp-c-catman .cat ./usr/share/man/cat3/flushok.0 comp-c-catman .cat +./usr/share/man/cat3/fma.0 comp-c-catman .cat +./usr/share/man/cat3/fmaf.0 comp-c-catman .cat +./usr/share/man/cat3/fmal.0 comp-c-catman .cat ./usr/share/man/cat3/fmax.0 comp-c-catman .cat ./usr/share/man/cat3/fmaxf.0 comp-c-catman .cat ./usr/share/man/cat3/fmaxl.0 comp-c-catman .cat @@ -13208,6 +13211,9 @@ ./usr/share/man/html3/fls64.html comp-c-htmlman html ./usr/share/man/html3/flushinp.html comp-c-htmlman html ./usr/share/man/html3/flushok.html comp-c-htmlman html +./usr/share/man/html3/fma.html comp-c-htmlman html +./usr/share/man/html3/fmaf.html comp-c-htmlman html +./usr/share/man/html3/fmal.html comp-c-htmlman html ./usr/share/man/html3/fmax.html comp-c-htmlman html ./usr/share/man/html3/fmaxf.html comp-c-htmlman html ./usr/share/man/html3/fmaxl.html comp-c-htmlman html @@ -20096,6 +20102,9 @@ ./usr/share/man/man3/fls64.3 comp-c-man .man ./usr/share/man/man3/flushinp.3 comp-c-man .man ./usr/share/man/man3/flushok.3 comp-c-man .man +./usr/share/man/man3/fma.3 comp-c-man .man +./usr/share/man/man3/fmaf.3 comp-c-man .man +./usr/share/man/man3/fmal.3 comp-c-man .man ./usr/share/man/man3/fmax.3 comp-c-man .man ./usr/share/man/man3/fmaxf.3 comp-c-man .man ./usr/share/man/man3/fmaxl.3 comp-c-man .man Index: src/lib/libm/Makefile diff -u src/lib/libm/Makefile:1.170 src/lib/libm/Makefile:1.171 --- src/lib/libm/Makefile:1.170 Sun Sep 13 10:58:30 2015 +++ src/lib/libm/Makefile Sat Dec 12 19:05:45 2015 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.170 2015/09/13 10:58:30 he Exp $ +# $NetBSD: Makefile,v 1.171 2015/12/12 19:05:45 nros Exp $ # # @(#)Makefile 5.1beta 93/09/24 # @@ -278,7 +278,7 @@ COPTS.s_tanh.c+= -O0 MAN+= acos.3 acosh.3 asin.3 asinh.3 atan.3 atan2.3 atanh.3 \ ceil.3 copysign.3 cos.3 cosh.3 \ erf.3 exp.3 \ - fabs.3 finite.3 fmod.3 frexp.3 hypot.3 \ + fabs.3 finite.3 fma.3 fmod.3 frexp.3 hypot.3 \ ieee_test.3 ilogb.3 isinff.3 j0.3 ldexp.3 lgamma.3 log.3 lrint.3 \ math.3 modf.3 nextafter.3 pow.3 \ remainder.3 rint.3 round.3 \ @@ -378,6 +378,8 @@ MLINKS+=fmax.3 fminl.3 MLINKS+=fmax.3 fminf.3 MLINKS+=fdim.3 fdiml.3 MLINKS+=fdim.3 fdimf.3 +MLINKS+=fma.3 fmaf.3 \ + fma.3 fmal.3 .if (${MKCOMPLEX} != "no") .include "${.CURDIR}/complex/Makefile.inc" Added files: Index: src/lib/libm/man/fma.3 diff -u /dev/null src/lib/libm/man/fma.3:1.1 --- /dev/null Sat Dec 12 19:05:45 2015 +++ src/lib/libm/man/fma.3 Sat Dec 12 19:05:45 2015 @@ -0,0 +1,126 @@ +.\" $NetBSD: fma.3,v 1.1 2015/12/12 19:05:45 nros Exp $ +.\" Copyright (c) 2005 David Schultz <d...@freebsd.org> +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD: head/lib/msun/man/fma.3 152755 2005-11-24 09:25:10Z joel $ +.\" +.Dd November 23, 2015 +.Dt FMA 3 +.Os +.Sh NAME +.Nm fma , +.Nm fmaf , +.Nm fmal +.Nd fused multiply-add +.Sh LIBRARY +.Lb libm +.Sh SYNOPSIS +.In math.h +.Ft double +.Fn fma "double x" "double y" "double z" +.Ft float +.Fn fmaf "float x" "float y" "float z" +.Ft long double +.Fn fmal "long double x" "long double y" "long double z" +.Sh DESCRIPTION +The +.Fn fma , +.Fn fmaf , +and +.Fn fmal +functions return +.No "(x * y) + z" , +computed with only one rounding error. +Using the ordinary multiplication and addition operators, by contrast, +results in two roundings: one for the intermediate product and one for +the final result. +.Pp +For instance, the expression +.No "1.2e100 * 2.0e208 - 1.4e308" +produces \*(If due to overflow in the intermediate product, whereas +.No "fma(1.2e100, 2.0e208, -1.4e308)" +returns approximately 1.0e308. +.Pp +The fused multiply-add operation is often used to improve the +accuracy of calculations such as dot products. +It may also be used to improve performance on machines that implement +it natively. +The macros +.Dv FP_FAST_FMA , +.Dv FP_FAST_FMAF +and +.Dv FP_FAST_FMAL +may be defined in +.In math.h +to indicate that +.Fn fma , +.Fn fmaf , +and +.Fn fmal +(respectively) have comparable or faster speed than a multiply +operation followed by an add operation. +.Sh IMPLEMENTATION NOTES +In general, these routines will behave as one would expect if +.No "x * y + z" +were computed with unbounded precision and range, +then rounded to the precision of the return type. +However, on some platforms, if +.Fa z +is \*(Na, these functions may not raise an exception even +when the computation of +.No "x * y" +would have otherwise generated an invalid exception. +.Sh SEE ALSO +.Xr fenv 3 , +.Xr math 3 +.Sh STANDARDS +The +.Fn fma , +.Fn fmaf , +and +.Fn fmal +functions conform to +.St -isoC-99 . +A fused multiply-add operation with virtually identical +characteristics appears in IEEE draft standard 754R. +.Sh HISTORY +The +.Fn fma +and +.Fn fmaf +routines first appeared in +.Fx 5.4 , +and +.Fn fmal +appeared in +.Fx 6.0 . +The +.Fn fma , +.Fn fmaf +and +.Fn fmal +routines where imported into +.Nx +in +.Nx 7.0 .