Skip to content

Commit

Permalink
update to SoftFloat-3e
Browse files Browse the repository at this point in the history
closes #823
  • Loading branch information
andrewrk committed Mar 9, 2018
1 parent 6db9be8 commit 5a7a0e8
Show file tree
Hide file tree
Showing 435 changed files with 4,434 additions and 898 deletions.
224 changes: 112 additions & 112 deletions CMakeLists.txt

Large diffs are not rendered by default.

File renamed without changes.
@@ -1,13 +1,13 @@

License for Berkeley SoftFloat Release 3d
License for Berkeley SoftFloat Release 3e

John R. Hauser
2017 August 10
2018 January 20

The following applies to the whole of SoftFloat Release 3d as well as to
The following applies to the whole of SoftFloat Release 3e as well as to
each source file individually.

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.

Redistribution and use in source and binary forms, with or without
Expand Down
Expand Up @@ -7,11 +7,11 @@

<BODY>

<H1>Package Overview for Berkeley SoftFloat Release 3d</H1>
<H1>Package Overview for Berkeley SoftFloat Release 3e</H1>

<P>
John R. Hauser<BR>
2017 August 10<BR>
2018 January 20<BR>
</P>

<P>
Expand Down
4 changes: 2 additions & 2 deletions deps/SoftFloat-3d/README.txt → deps/SoftFloat-3e/README.txt
@@ -1,8 +1,8 @@

Package Overview for Berkeley SoftFloat Release 3d
Package Overview for Berkeley SoftFloat Release 3e

John R. Hauser
2017 August 10
2018 January 20

Berkeley SoftFloat is a software implementation of binary floating-point
that conforms to the IEEE Standard for Floating-Point Arithmetic. SoftFloat
Expand Down
Expand Up @@ -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
&lsquo;<CODE>roundToInt</CODE>&rsquo; 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>
Expand Down
Expand Up @@ -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>


Expand Down Expand Up @@ -69,7 +69,7 @@ <H2>1. Introduction</H2>
<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>


Expand Down Expand Up @@ -114,7 +114,7 @@ <H2>3. Acknowledgments and License</H2>
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.
Expand Down Expand Up @@ -148,12 +148,12 @@ <H2>3. Acknowledgments and License</H2>
</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>
Expand Down Expand Up @@ -215,33 +215,53 @@ <H2>4. SoftFloat Package Directory Structure</H2>
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
</PRE>
</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&rsquo;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&rsquo;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&rsquo;s older, 8087-derived floating-point, extended to all supported
floating-point types
</DD>
<DT><CODE>8086-SSE</CODE></DT>
<DD>
Intel&rsquo;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&rsquo;s VFPv2 or later floating-point, with NaN payload propagation
</DD>
<DT><CODE>ARM-VFPv2-defaultNaN</CODE></DT>
<DD>
ARM&rsquo;s VFPv2 or later floating-point, with the &ldquo;default NaN&rdquo;
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>
Expand All @@ -264,19 +284,20 @@ <H2>4. SoftFloat Package Directory Structure</H2>
For the example targets,
<NOBR><CODE>&lt;<I>execution-environment</I>&gt;</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>&lt;<I>compiler</I>&gt;</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&rsquo;
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>
Expand Down Expand Up @@ -402,8 +423,8 @@ <H3>5.2. Specializing Floating-Point Behavior</H3>
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.
Expand Down Expand Up @@ -577,8 +598,40 @@ <H3>5.5. Target-Specific Optimization of Primitive Functions</H3>
This technically defines <NOBR><CODE>&lt;<I>function-name</I>&gt;</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&rsquo;s internal
&lsquo;<CODE>countLeadingZeros</CODE>&rsquo; 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&rsquo;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>


Expand Down

0 comments on commit 5a7a0e8

Please sign in to comment.