diff options
author | John Hauser <jhauser@eecs.berkeley.edu> | 2018-01-26 12:51:15 -0800 |
---|---|---|
committer | John Hauser <jhauser@eecs.berkeley.edu> | 2018-01-26 12:51:15 -0800 |
commit | f74b1e48110ac3a27dd49b787d164e55e42d81d1 (patch) | |
tree | 036feef8d982dff57c2f7fd6688deb4790865b10 /doc | |
parent | 63d601476b7b2eefe72b1705b942eaa65db8c0bf (diff) | |
download | berkeley-softfloat-3-f74b1e48110ac3a27dd49b787d164e55e42d81d1.zip berkeley-softfloat-3-f74b1e48110ac3a27dd49b787d164e55e42d81d1.tar.gz berkeley-softfloat-3-f74b1e48110ac3a27dd49b787d164e55e42d81d1.tar.bz2 |
Release 3e. See "doc/SoftFloat-history.html".
Diffstat (limited to 'doc')
-rw-r--r-- | doc/SoftFloat-history.html | 47 | ||||
-rw-r--r-- | doc/SoftFloat-source.html | 109 | ||||
-rw-r--r-- | doc/SoftFloat.html | 71 |
3 files changed, 156 insertions, 71 deletions
diff --git a/doc/SoftFloat-history.html b/doc/SoftFloat-history.html index e7d791b..d81c6bc 100644 --- a/doc/SoftFloat-history.html +++ b/doc/SoftFloat-history.html @@ -7,14 +7,57 @@ <BODY> -<H1>History of Berkeley SoftFloat, to Release 3d</H1> +<H1>History of Berkeley SoftFloat, to Release 3e</H1> <P> John R. Hauser<BR> -2017 August 10<BR> +2018 January 20<BR> </P> +<H3>Release 3e (2018 January)</H3> + +<UL> + +<LI> +Changed the default numeric code for optional rounding mode <CODE>odd</CODE> +(round to odd, also known as <EM>jamming</EM>) from 5 to 6. + +<LI> +Modified the behavior of rounding mode <CODE>odd</CODE> when rounding to an +integer value (either conversion to an integer format or a +‘<CODE>roundToInt</CODE>’ function). +Previously, for those cases only, rounding mode <CODE>odd</CODE> acted the same +as rounding to minimum magnitude. +Now all operations are rounded consistently. + +<LI> +Fixed some errors in the specialization code modeling Intel x86 floating-point, +specifically the integers returned on invalid operations and the propagation of +NaN payloads in a few rare cases. + +<LI> +Added specialization code modeling ARM floating-point, conforming to VFPv2 or +later. + +<LI> +Added an example target for ARM processors. + +<LI> +Fixed a minor bug whereby function <CODE>f16_to_ui64</CODE> might return a +different integer than expected in the case that the floating-point operand is +negative. + +<LI> +Added example target-specific optimization for GCC, employing GCC instrinsics +and support for <NOBR>128-bit</NOBR> integer arithmetic. + +<LI> +Made other minor improvements. + +</UL> + + <H3>Release 3d (2017 August)</H3> <UL> diff --git a/doc/SoftFloat-source.html b/doc/SoftFloat-source.html index 8001964..4ff9d4c 100644 --- a/doc/SoftFloat-source.html +++ b/doc/SoftFloat-source.html @@ -7,11 +7,11 @@ <BODY> -<H1>Berkeley SoftFloat Release 3d: Source Documentation</H1> +<H1>Berkeley SoftFloat Release 3e: Source Documentation</H1> <P> John R. Hauser<BR> -2017 August 10<BR> +2018 January 20<BR> </P> @@ -69,7 +69,7 @@ SoftFloat has been successfully compiled with the GNU C Compiler <NOBR>Release 2</NOBR> or earlier. Changes to the interface of SoftFloat functions are documented in <A HREF="SoftFloat.html"><NOBR><CODE>SoftFloat.html</CODE></NOBR></A>. -The current version of SoftFloat is <NOBR>Release 3d</NOBR>. +The current version of SoftFloat is <NOBR>Release 3e</NOBR>. </P> @@ -114,7 +114,7 @@ and <CODE><stdint.h></CODE></I>. The SoftFloat package was written by me, <NOBR>John R.</NOBR> Hauser. <NOBR>Release 3</NOBR> of SoftFloat was a completely new implementation supplanting earlier releases. -The project to create <NOBR>Release 3</NOBR> (now <NOBR>through 3d</NOBR>) was +The project to create <NOBR>Release 3</NOBR> (now <NOBR>through 3e</NOBR>) was done in the employ of the University of California, Berkeley, within the Department of Electrical Engineering and Computer Sciences, first for the Parallel Computing Laboratory (Par Lab) and then for the ASPIRE Lab. @@ -148,12 +148,12 @@ Oracle, and Samsung. </P> <P> -The following applies to the whole of SoftFloat <NOBR>Release 3d</NOBR> as well +The following applies to the whole of SoftFloat <NOBR>Release 3e</NOBR> as well as to each source file individually. </P> <P> -Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017 The Regents of the +Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 The Regents of the University of California. All rights reserved. </P> @@ -215,12 +215,15 @@ source include 8086 8086-SSE + ARM-VFPv2 + ARM-VFPv2-defaultNaN build template-FAST_INT64 template-not-FAST_INT64 Linux-386-GCC Linux-386-SSE2-GCC Linux-x86_64-GCC + Linux-ARM-VFPv2-GCC Win32-MinGW Win32-SSE2-MinGW Win64-MinGW-w64 @@ -228,20 +231,37 @@ build </BLOCKQUOTE> The majority of the SoftFloat sources are provided in the <CODE>source</CODE> directory. -The <CODE>include</CODE> subdirectory of <CODE>source</CODE> contains several -header files (unsurprisingly), while the <CODE>8086</CODE> and -<NOBR><CODE>8086-SSE</CODE></NOBR> subdirectories contain source files that -specialize the floating-point behavior to match the Intel x86 line of -processors. -The files in directory <CODE>8086</CODE> give floating-point behavior -consistent solely with Intel’s older, 8087-derived floating-point, while -those in <NOBR><CODE>8086-SSE</CODE></NOBR> update the behavior of the -non-extended formats (<CODE>float16_t</CODE>, <CODE>float32_t</CODE>, -<CODE>float64_t</CODE>, and <CODE>float128_t</CODE>) to mirror Intel’s -more recent Streaming SIMD Extensions (SSE) and other compatible extensions. +The <CODE>include</CODE> subdirectory contains several header files +(unsurprisingly), while the other subdirectories of <CODE>source</CODE> contain +source files that specialize the floating-point behavior to match particular +processor families: +<BLOCKQUOTE> +<DL> +<DT><CODE>8086</CODE></DT> +<DD> +Intel’s older, 8087-derived floating-point, extended to all supported +floating-point types +</DD> +<DT><CODE>8086-SSE</CODE></DT> +<DD> +Intel’s x86 processors with Streaming SIMD Extensions (SSE) and later +compatible extensions, having 8087 behavior for <NOBR>80-bit</NOBR> +double-extended-precision (<CODE>extFloat80_t</CODE>) and SSE behavior for +other floating-point types +</DD> +<DT><CODE>ARM-VFPv2</CODE></DT> +<DD> +ARM’s VFPv2 or later floating-point, with NaN payload propagation +</DD> +<DT><CODE>ARM-VFPv2-defaultNaN</CODE></DT> +<DD> +ARM’s VFPv2 or later floating-point, with the “default NaN” +option +</DD> +</DL> +</BLOCKQUOTE> If other specializations are attempted, these would be expected to be other -subdirectories of <CODE>source</CODE> alongside <CODE>8086</CODE> and -<NOBR><CODE>8086-SSE</CODE></NOBR>. +subdirectories of <CODE>source</CODE> alongside the ones listed above. Specialization is covered later, in <NOBR>section 5.2</NOBR>, <I>Specializing Floating-Point Behavior</I>. </P> @@ -264,19 +284,20 @@ are intended to follow a naming system of For the example targets, <NOBR><CODE><<I>execution-environment</I>></CODE></NOBR> is <NOBR><CODE>Linux-386</CODE></NOBR>, <NOBR><CODE>Linux-386-SSE2</CODE></NOBR>, -<NOBR><CODE>Linux-x86_64</CODE></NOBR>, <CODE>Win32</CODE>, +<NOBR><CODE>Linux-x86_64</CODE></NOBR>, +<NOBR><CODE>Linux-ARM-VFPv2</CODE></NOBR>, <CODE>Win32</CODE>, <NOBR><CODE>Win32-SSE2</CODE></NOBR>, or <CODE>Win64</CODE>, and <NOBR><CODE><<I>compiler</I>></CODE></NOBR> is <CODE>GCC</CODE>, <CODE>MinGW</CODE>, or <NOBR><CODE>MinGW-w64</CODE></NOBR>. </P> <P> -At the current time, all of the supplied target directories are merely examples -that may or may not be correct for compiling on any particular system. +All of the supplied target directories are merely examples that may or may not +be correct for compiling on any particular system. Despite requests, there are currently no plans to include and maintain in the SoftFloat package the build files needed for a great many users’ -compilation environments, which after all can span a broad range of operating -systems, compilers, and other tools. +compilation environments, which can span a huge range of operating systems, +compilers, and other tools. </P> <P> @@ -402,8 +423,8 @@ A new build target may use an existing specialization, such as the ones provided by the <CODE>8086</CODE> and <NOBR><CODE>8086-SSE</CODE></NOBR> subdirectories. If a build target needs a new specialization, different from any existing ones, -it is recommended that a new specialization subdirectory be created in the -<CODE>source</CODE> directory for this purpose. +it is recommended that a new specialization directory be created for this +purpose. The <CODE>specialize.h</CODE> header file from any of the provided specialization subdirectories can be used as a model for what definitions are needed. @@ -577,8 +598,40 @@ function. This technically defines <NOBR><CODE><<I>function-name</I>></CODE></NOBR> as a macro, but one that resolves to the same name, which may then be a function. -(A preprocessor that conforms to the C Standard must limit recursive macro -expansion from being applied more than once.) +(A preprocessor that conforms to the C Standard is required to limit recursive +macro expansion from being applied more than once.) +</P> + +<P> +The supplied header file <CODE>opts-GCC.h</CODE> (in directory +<CODE>source/include</CODE>) provides an example of target-specific +optimization for the GCC compiler. +Each GCC target example in the <CODE>build</CODE> directory has +<BLOCKQUOTE> +<CODE>#include "opts-GCC.h"</CODE> +</BLOCKQUOTE> +in its <CODE>platform.h</CODE> header file. +Before <CODE>opts-GCC.h</CODE> is included, the following macros must be +defined (or not) to control which features are invoked: +<BLOCKQUOTE> +<DL> +<DT><CODE>SOFTFLOAT_BUILTIN_CLZ</CODE></DT> +<DD> +If defined, SoftFloat’s internal +‘<CODE>countLeadingZeros</CODE>’ functions use intrinsics +<CODE>__builtin_clz</CODE> and <CODE>__builtin_clzll</CODE>. +</DD> +<DT><CODE>SOFTFLOAT_INTRINSIC_INT128</CODE></DT> +<DD> +If defined, SoftFloat makes use of GCC’s nonstandard <NOBR>128-bit</NOBR> +integer type <CODE>__int128</CODE>. +</DD> +</DL> +</BLOCKQUOTE> +On some machines, these improvements are observed to increase the speeds of +<CODE>f64_mul</CODE> and <CODE>f128_mul</CODE> by around 20 to 25%, although +other functions receive less dramatic boosts, or none at all. +Results can vary greatly across different platforms. </P> diff --git a/doc/SoftFloat.html b/doc/SoftFloat.html index 8953d68..b72b407 100644 --- a/doc/SoftFloat.html +++ b/doc/SoftFloat.html @@ -7,11 +7,11 @@ <BODY> -<H1>Berkeley SoftFloat Release 3d: Library Interface</H1> +<H1>Berkeley SoftFloat Release 3e: Library Interface</H1> <P> John R. Hauser<BR> -2017 August 10<BR> +2018 January 20<BR> </P> @@ -106,13 +106,20 @@ Information about the standard is available elsewhere. </P> <P> -The current version of SoftFloat is <NOBR>Release 3d</NOBR>. -This release fixes bugs that were found in the square root functions for the -<NOBR>64-bit</NOBR>, <NOBR>80-bit</NOBR>, and <NOBR>128-bit</NOBR> -floating-point formats. +The current version of SoftFloat is <NOBR>Release 3e</NOBR>. +This release modifies the behavior of the rarely used <I>odd</I> rounding mode +(<I>round to odd</I>, also known as <I>jamming</I>), and also adds some new +specialization and optimization examples for those compiling SoftFloat. +</P> + +<P> +The previous <NOBR>Release 3d</NOBR> fixed bugs that were found in the square +root functions for the <NOBR>64-bit</NOBR>, <NOBR>80-bit</NOBR>, and +<NOBR>128-bit</NOBR> floating-point formats. (Thanks to Alexei Sibidanov at the University of Victoria for reporting an incorrect result.) -The bugs affected all prior <NOBR>Release-3</NOBR> versions of SoftFloat. +The bugs affected all prior <NOBR>Release-3</NOBR> versions of SoftFloat +<NOBR>through 3c</NOBR>. The flaw in the <NOBR>64-bit</NOBR> floating-point square root function was of very minor impact, causing a <NOBR>1-ulp</NOBR> error (<NOBR>1 unit</NOBR> in the last place) a few times out of a billion. @@ -124,13 +131,8 @@ wrong. </P> <P> -<NOBR>Release 3d</NOBR> makes no changes to the SoftFloat library interface -compared to the previous <NOBR>Release 3c</NOBR>. -Since the original <NOBR>Release 3</NOBR>, the main changes to the interface -have been that <NOBR>Release 3b</NOBR> added support for the -<NOBR>16-bit</NOBR> half-precision format, and <NOBR>Release 3c</NOBR> added -optional support for a rarely used rounding mode, <I>round to odd</I>, also -known as <I>jamming</I>. +Among earlier releases, 3b was notable for adding support for the +<NOBR>16-bit</NOBR> half-precision format. For more about the evolution of SoftFloat releases, see <A HREF="SoftFloat-history.html"><NOBR><CODE>SoftFloat-history.html</CODE></NOBR></A>. </P> @@ -169,7 +171,7 @@ strictly required. <P> Most operations not required by the original 1985 version of the IEEE Floating-Point Standard but added in the 2008 version are not yet supported in -SoftFloat <NOBR>Release 3d</NOBR>. +SoftFloat <NOBR>Release 3e</NOBR>. </P> @@ -179,7 +181,7 @@ SoftFloat <NOBR>Release 3d</NOBR>. The SoftFloat package was written by me, <NOBR>John R.</NOBR> Hauser. <NOBR>Release 3</NOBR> of SoftFloat was a completely new implementation supplanting earlier releases. -The project to create <NOBR>Release 3</NOBR> (now <NOBR>through 3d</NOBR>) was +The project to create <NOBR>Release 3</NOBR> (now <NOBR>through 3e</NOBR>) was done in the employ of the University of California, Berkeley, within the Department of Electrical Engineering and Computer Sciences, first for the Parallel Computing Laboratory (Par Lab) and then for the ASPIRE Lab. @@ -213,12 +215,12 @@ Oracle, and Samsung. </P> <P> -The following applies to the whole of SoftFloat <NOBR>Release 3d</NOBR> as well +The following applies to the whole of SoftFloat <NOBR>Release 3e</NOBR> as well as to each source file individually. </P> <P> -Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017 The Regents of the +Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 The Regents of the University of California. All rights reserved. </P> @@ -395,7 +397,7 @@ comparisons between two values in the same floating-point format. <P> The following operations required by the 2008 IEEE Floating-Point Standard are -not supported in SoftFloat <NOBR>Release 3d</NOBR>: +not supported in SoftFloat <NOBR>Release 3e</NOBR>: <UL> <LI> <B>nextUp</B>, <B>nextDown</B>, <B>minNum</B>, <B>maxNum</B>, <B>minNumMag</B>, @@ -445,8 +447,8 @@ exponent must both be zero. </P> <P> -SoftFloat's functions are not guaranteed to operate as expected when inputs of -type <CODE>extFloat80_t</CODE> are non-canonical. +SoftFloat’s functions are not guaranteed to operate as expected when +inputs of type <CODE>extFloat80_t</CODE> are non-canonical. Assuming all of a function’s <CODE>extFloat80_t</CODE> inputs (if any) are canonical, function outputs of type <CODE>extFloat80_t</CODE> will always be canonical. @@ -591,16 +593,15 @@ Variable <CODE>softfloat_roundingMode</CODE> is initialized to </P> <P> -If supported, mode <CODE>softfloat_round_odd</CODE> first rounds a -floating-point result to minimum magnitude, the same as +When <CODE>softfloat_round_odd</CODE> is the rounding mode for a function that +rounds to an integer value (either conversion to an integer format or a +‘<CODE>roundToInt</CODE>’ function), if the input is not already an +integer, the rounded result is the closest <EM>odd</EM> integer. +For other operations, this rounding mode acts as though the floating-point +result is first rounded to minimum magnitude, the same as <CODE>softfloat_round_minMag</CODE>, and then, if the result is inexact, the least-significant bit of the result is set <NOBR>to 1</NOBR>. -This rounding mode is also known as <EM>jamming</EM>. -As a special case, when <CODE>softfloat_round_odd</CODE> is the rounding mode -for a function that rounds to an integer value (either conversion to an integer -format or a ‘<CODE>roundToInt</CODE>’ function), rounding is the -same as <CODE>softfloat_round_minMag</CODE>, without any change to the -least-significant integer bit. +Rounding to odd is also known as <EM>jamming</EM>. </P> <H3>6.2. Underflow Detection</H3> @@ -820,12 +821,6 @@ The <CODE><I>roundingMode</I></CODE> argument specifies the rounding mode for the conversion. The variable that usually indicates rounding mode, <CODE>softfloat_roundingMode</CODE>, is ignored. -If <CODE><I>roundingMode</I></CODE> is <CODE>softfloat_round_odd</CODE>, -rounding is to minimum magnitude, the same as -<CODE>softfloat_round_minMag</CODE>, rather than to an odd integer. -</P> - -<P> Argument <CODE><I>exact</I></CODE> determines whether the <I>inexact</I> exception flag is raised if the conversion is not exact. If <CODE><I>exact</I></CODE> is <CODE>true</CODE>, the <I>inexact</I> flag may @@ -1087,12 +1082,6 @@ The <CODE><I>roundingMode</I></CODE> argument specifies the rounding mode to apply. The variable that usually indicates rounding mode, <CODE>softfloat_roundingMode</CODE>, is ignored. -If <CODE><I>roundingMode</I></CODE> is <CODE>softfloat_round_odd</CODE>, -rounding is to minimum magnitude, the same as -<CODE>softfloat_round_minMag</CODE>, rather than to an odd integer value. -</P> - -<P> Argument <CODE><I>exact</I></CODE> determines whether the <I>inexact</I> exception flag is raised if the conversion is not exact. If <CODE><I>exact</I></CODE> is <CODE>true</CODE>, the <I>inexact</I> flag may |