Skip to contentSkip to conversation

relicense QEMU softfloat from 2b to to 2a

PATCH Superseded Peter Maydell 3 participants 21 messages Nov 25, 2014 – Jan 12, 2015

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover relicense QEMU softfloat from 2b to to 2a

[If you're not a regular QEMU contributor: you are CC'd on this just for your information and because you provided an Acked-by for the previous version of this patch back in 2013; thanks! No action is required from you. Regular contributors are invited to review the patchset.]

Hi; as you may be aware, we discovered some time back that the license of SoftFloat-2b is claimed to be GPLv2 incompatible by the FSF due to an indemnification clause. The previous release, SoftFloat-2a, did not contain this clause. We're therefore switching to the -2a release and relicensing (or reverting and reimplementing) all subsequent commits by QEMU contributors.

Last time around we were able to collect acks for the relicensing from almost all contributors, so thanks to all of you. This patchset aims to complete the process by applying the relicensing patch and providing reimplemented code for the handful of commits that had to be reverted.

The patch switching from upstream's SoftFloat-2b to -2a is constructed in the same way Anthony Liguori used in 2013:
* diff commit 158142c2 against SoftFloat-2b to separate out the changes made by Fabrice as part of the import
* copy over the SoftFloat-2a versions of the files instead
* apply some mechanical transformations (line endings, block comment style)
* re-apply Fabrice's patches
* diff this endpoint against 158142c2 to give a 2b-to-2a relicensing patch
* apply that to current master

Conceptually I would have preferred to replay all of our QEMU commits after 158142c2 on top of the SoftFloat-2a equivalent (giving a sort of alternate-history master rebased on 2a) and then diffed that against the real-world master. However git cherry-pick chokes on merge commits. If anybody has better git skills than me and thinks this can be done then I'd be interested to see it. In any case the patch is I think equivalent -- it's just a matter of which two sides of a square you go round to reach the far corner.

Following this change are a set of patches which revert the only four commits in the tree which are still relevant and for which we could not get acks for relicensing. I present them in this series as separate "revert" and "reimplement" patches, since this more clearly shows the intent. Obviously this will break bisection...

Finally there's a patch which adds comments to the top of each affected file clarifying the new licensing status (where the files contain portions under variously SoftFloat-2a, BSD and GPLv2+ licenses) and specifying the default license for new contributions (so we don't have to keep asking patch submitters to specify it). I've applied the Acked-by tags from the 2013 round to this patch as it seemed the most appropriate place. (Those acks should thus be taken to indicate approval for the relicensing rather than necessarily specifically for the wording choice.)

Questions for review:
* can we do the git cherry-pick thing I mention above?
* should we squash the revert and reimplement patches together? (avoids bisection break but makes the revert-and-reimplement less clear)
* would anybody like to cross-check my examination of the commit logs to confirm I didn't miss any patches we need to revert?
* are there any bugs in my reimplementations?
* are people happy with my attempt to clarify the licensing status of the source files in patch 6, and my choice of GPLv2+ for future contributions to them?

I've put the full details of how I constructed this patchset after the diffstat. References in that text to "this archive" are to
http://people.linaro.org/~peter.maydell/softfloat-relicensing-proposed.tar.gz
which is a complete archive of everything needed to reproduce the patchset, including copies of upstream's pristine 2a and 2b tarballs. If/when this patchset is applied I plan to upload it to the QEMU webserver as a permanent archive of what happened here (since the commit diffs themselves don't tell the full story).

thanks
-- PMM

Peter Maydell (6):
softfloat: Apply patch corresponding to rebasing to softfloat-2a
softfloat: Revert remaining portions of commits 75d62a5856 and

    3430b0be36f

softfloat: Revert remaining parts of commits b645bb4885 and 5a6932d51d
softfloat: Implement uint64_to_float64() and uint64_to_float32()
softfloat: reimplement SNAN_BIT_IS_ONE support
softfloat: Clarify license status

 fpu/softfloat-macros.h     |  86 +++++++++++++++++++++-------
 fpu/softfloat-specialize.h | 139 ++++++++++++++++++++++++++++++---------------
 fpu/softfloat.c            | 136 +++++++++++++++++++++++++++++++-------------
 include/fpu/softfloat.h    |  82 +++++++++++++++++++-------
 4 files changed, 316 insertions(+), 127 deletions(-)
Signature · 129 lines
1.9.1

QEMU relicensing from SoftFloat-2b to SoftFloat-2a
==================================================

This archive contains binaries, patches and documentation regarding the
process of relicensing QEMU's softfloat code from 2b to 2a.

The process followed is in two parts: replace the upstream
SoftFloat code with the equivalent files from the upstream 2a release;
and then revert and rewrite some later commits by QEMU contributors who
could not be contacted to agree to a relicensing of their work.

Replacement of upstream code
----------------------------

This archive includes SoftFloat-2a.zip and SoftFloat-2b.zip, which
are the original upstream source releases downloaded from:

http://web.archive.org/web/19991004171915/http://http.cs.berkeley.edu/%7Ejhauser/arithmetic/SoftFloat-2a.zip
http://www.jhauser.us/arithmetic/SoftFloat-2b.zip

The differences between the two are minimal, consisting mostly of
the license change and a change in the style used for block comments.

Starting from the commit immediately before the original softfloat import
(4f716dc681d1b) we can construct a series of commits which import the
version 2a sources instead.

First separate out the changes Fabrice wrote as part of the initial
import from the upstream 2b changes, and save the patch for later:

    cp SoftFloat-2b/softfloat/bits64/softfloat.c 2b-rearranged/fpu
    cp SoftFloat-2b/softfloat/bits64/386-Win32-GCC/softfloat.h 2b-rearranged/fpu/
    cp SoftFloat-2b/softfloat/bits64/softfloat-macros 2b-rearranged/fpu/softfloat-macros.h
    cp SoftFloat-2b/softfloat/bits64/386-Win32-GCC/softfloat-specialize 2b-rearranged/fpu/
softfloat-specialize.h
    dos2unix 2b-rearranged/fpu/*.[ch]
    cd qemu
    git checkout 158142c2c2df728cfa3b5320c65534921a764f26
    cd ..
    diff -uN 2b-rearranged/fpu qemu/fpu > fabrice-initial-changes.patch

Now we can create the patchseries which is the equivalent 2a import:

    cd qemu
    git checkout 4f716dc681d1b

Copy the 2a files and fix their line endings to Unix style:

    cp ../SoftFloat-2a/softfloat/bits64/softfloat.c fpu
    cp ../SoftFloat-2a/softfloat/bits64/386-Win32-gcc/softfloat.h fpu
    cp ../SoftFloat-2a/softfloat/bits64/softfloat-macros fpu/softfloat-macros.h
    cp ../SoftFloat-2a/softfloat/bits64/386-Win32-gcc/softfloat-specialize fpu/softfloat-specialize.h
    dos2unix fpu/*.[ch]

Add the new files and configure/makefile changes from 158142c2c2df
    
    git checkout 158142c2c2df7 fpu/softfloat-native.c fpu/softfloat-native.h
    git show 158142c2c2df7 Makefile.target configure | patch -p1

Mechanically update comment style (the perl script used is provided in this archive)
    
    for f in fpu/softfloat-specialize.h fpu/softfloat-macros.h fpu/softfloat.c fpu/softfloat.h; do fix-softfloat-comments $f > $f.new && mv $f.new $f; done

Delete a handful of blank lines to avoid spurious patch rejects.

Apply the "Fabrice initial changes" patch created earlier:
This requires a bunch of fuzzing but it does not fail on any hunks.
    
     patch -N -p1 --fuzz 5 -i ../fabrice-initial-changes.patch
    
The five commits that result from this process are archived in
the reimport/ subdirectory.

We can now create a patch by diffing the endpoint of this set of commits
against the original upstream import commit 158142c2c2df7:
     diff -u 158142c2c2df import-sf-2a > ../relicense-patch.txt

That patch is also included in this archive. It consists entirely
of changes to version numbers, licence text and a trivial comment
reformat (as expected, since the upstream 2a to 2b changes were just this).

We can then apply that patch to current QEMU master:
     patch  -p1 --fuzz 10 <../relicense-patch.txt
to produce a modern QEMU effectively rebased on version 2a of upstream
SoftFloat.

Reverting and rewriting of later QEMU commits
---------------------------------------------

Since contributions to these softfloat files in QEMU after their
initial import have to be assumed to have been provided by their
authors under the SoftFloat-2b license, we needed to get permission
from those authors to relicense their contributions under either
the SoftFloat-2a license or some other GPLv2 compatible license.
Most of these were collected in an email thread on qemu-devel
in 2013 where we requested permission for relicensing changes which
had been made up to that point. For all changes to these files after
that date we confirmed with the patch submitter that they were willing
to dual-license their change before applying the commit.

The affected commits can be listed with:
  git log -- fpu/softfloat.h fpu/softfloat.c fpu/softfloat-specialize.h fpu/softfloat-macros.h include/fpu/softfloat.h

The file fpu-logs.txt lists these commits, annotated to either
to indicate that it's ok for relicensing, or to indicate that the
commit must be reverted. Only four commits need reversion:
 5a6932d51d1b, b645bb4885, 3430b0be36fb7 and 75d62a585629c

The interesting cases (both the SFNOs and a handful of SFOK that
were not trivially obviously OK) have been copied into 'sfno.txt'
(to save you having to wade through the long list).

Copies of all the emails where people provided Acks are in the ackmails/
directory.

The patches in the reverts/ directory:
 * apply the relicense-patch
 * revert those parts of commits 5a6932d51d1b, b645bb4885, 3430b0be36fb7 and
   75d62a585629c which change the softfloat files and are still in the
   QEMU tree
 * independently reimplement the two functions and one bit of minor
   functionality which those commits provided
 * update the source files to indicate the now complicated licensing
   that applies since some relicensing was to BSD or GPLv2+ rather than
   softfloat-2a

---end of README---
#1 lore raw

PATCH 1/6 softfloat: Apply patch corresponding to rebasing to softfloat-2a

This commit applies the changes to master which correspond to replacing commit 158142c2c2df with a set of changes made by:
* taking the SoftFloat-2a release
* mechanically transforming the block comment style
* reapplying Fabrice's original changes from 158142c2c2df

This commit was created by:
diff -u 158142c2c2df import-sf-2a
patch -p1 --fuzz 10 <../relicense-patch.txt
(where import-sf-2a is the branch resulting from the changes above).

---
 fpu/softfloat-macros.h     | 38 ++++++++++++++++++--------------------
 fpu/softfloat-specialize.h | 30 ++++++++++++++----------------
 fpu/softfloat.c            | 38 ++++++++++++++++++--------------------
 include/fpu/softfloat.h    | 32 +++++++++++++++-----------------
 4 files changed, 65 insertions(+), 73 deletions(-)
fpu/softfloat-macros.h +18 -20
index 0dcda93..ca1d81e 100644
@@ -4,10 +4,10 @@
  * Derived from SoftFloat.
  */
 
-/*============================================================================
-
+/*
+===============================================================================
 This C source fragment is part of the SoftFloat IEC/IEEE Floating-point
-Arithmetic Package, Release 2b.
+Arithmetic Package, Release 2a.
 
 Written by John R. Hauser.  This work was made possible in part by the
 International Computer Science Institute, located at Suite 600, 1947 Center
@@ -16,24 +16,22 @@ National Science Foundation under grant MIP-9311980.  The original version
 of this code was written as part of a project to build a fixed-point vector
 processor in collaboration with the University of California at Berkeley,
 overseen by Profs. Nelson Morgan and John Wawrzynek.  More information
-is available through the Web page `http://www.cs.berkeley.edu/~jhauser/
+is available through the Web page `http://HTTP.CS.Berkeley.EDU/~jhauser/
 arithmetic/SoftFloat.html'.
 
-THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE.  Although reasonable effort has
-been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT TIMES
-RESULT IN INCORRECT BEHAVIOR.  USE OF THIS SOFTWARE IS RESTRICTED TO PERSONS
-AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ALL LOSSES,
-COSTS, OR OTHER PROBLEMS THEY INCUR DUE TO THE SOFTWARE, AND WHO FURTHERMORE
-EFFECTIVELY INDEMNIFY JOHN HAUSER AND THE INTERNATIONAL COMPUTER SCIENCE
-INSTITUTE (possibly via similar legal notice) AGAINST ALL LOSSES, COSTS, OR
-OTHER PROBLEMS INCURRED BY THEIR CUSTOMERS AND CLIENTS DUE TO THE SOFTWARE.
+THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE.  Although reasonable effort
+has been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT
+TIMES RESULT IN INCORRECT BEHAVIOR.  USE OF THIS SOFTWARE IS RESTRICTED TO
+PERSONS AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ANY
+AND ALL LOSSES, COSTS, OR OTHER PROBLEMS ARISING FROM ITS USE.
 
 Derivative works are acceptable, even for commercial purposes, so long as
-(1) the source code for the derivative work includes prominent notice that
-the work is derivative, and (2) the source code includes prominent notice with
-these four paragraphs for those parts of this code that are retained.
+(1) they include prominent notice that the work is derivative, and (2) they
+include prominent notice akin to these four paragraphs for those parts of
+this code that are retained.
 
-=============================================================================*/
+===============================================================================
+*/
 
 /*----------------------------------------------------------------------------
 | This macro tests for minimum version of the GNU C compiler.
@@ -107,10 +105,10 @@ static inline void shift64RightJamming(uint64_t a, int_fast16_t count, uint64_t
 | 63 bits of the extra result are all zero if and only if _all_but_the_last_
 | bits shifted off were all zero.  This extra result is stored in the location
 | pointed to by `z1Ptr'.  The value of `count' can be arbitrarily large.
-|     (This routine makes more sense if `a0' and `a1' are considered to form
-| a fixed-point value with binary point between `a0' and `a1'.  This fixed-
-| point value is shifted right by the number of bits given in `count', and
-| the integer part of the result is returned at the location pointed to by
+|     (This routine makes more sense if `a0' and `a1' are considered to form a
+| fixed-point value with binary point between `a0' and `a1'.  This fixed-point
+| value is shifted right by the number of bits given in `count', and the
+| integer part of the result is returned at the location pointed to by
 | `z0Ptr'.  The fractional part of the result may be slightly corrupted as
 | described above, and is returned at the location pointed to by `z1Ptr'.)
 *----------------------------------------------------------------------------*/
fpu/softfloat-specialize.h +14 -16
index 518f694..39335b4 100644
@@ -4,10 +4,10 @@
  * Derived from SoftFloat.
  */
 
-/*============================================================================
-
+/*
+===============================================================================
 This C source fragment is part of the SoftFloat IEC/IEEE Floating-point
-Arithmetic Package, Release 2b.
+Arithmetic Package, Release 2a.
 
 Written by John R. Hauser.  This work was made possible in part by the
 International Computer Science Institute, located at Suite 600, 1947 Center
@@ -16,24 +16,22 @@ National Science Foundation under grant MIP-9311980.  The original version
 of this code was written as part of a project to build a fixed-point vector
 processor in collaboration with the University of California at Berkeley,
 overseen by Profs. Nelson Morgan and John Wawrzynek.  More information
-is available through the Web page `http://www.cs.berkeley.edu/~jhauser/
+is available through the Web page `http://HTTP.CS.Berkeley.EDU/~jhauser/
 arithmetic/SoftFloat.html'.
 
-THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE.  Although reasonable effort has
-been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT TIMES
-RESULT IN INCORRECT BEHAVIOR.  USE OF THIS SOFTWARE IS RESTRICTED TO PERSONS
-AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ALL LOSSES,
-COSTS, OR OTHER PROBLEMS THEY INCUR DUE TO THE SOFTWARE, AND WHO FURTHERMORE
-EFFECTIVELY INDEMNIFY JOHN HAUSER AND THE INTERNATIONAL COMPUTER SCIENCE
-INSTITUTE (possibly via similar legal warning) AGAINST ALL LOSSES, COSTS, OR
-OTHER PROBLEMS INCURRED BY THEIR CUSTOMERS AND CLIENTS DUE TO THE SOFTWARE.
+THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE.  Although reasonable effort
+has been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT
+TIMES RESULT IN INCORRECT BEHAVIOR.  USE OF THIS SOFTWARE IS RESTRICTED TO
+PERSONS AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ANY
+AND ALL LOSSES, COSTS, OR OTHER PROBLEMS ARISING FROM ITS USE.
 
 Derivative works are acceptable, even for commercial purposes, so long as
-(1) the source code for the derivative work includes prominent notice that
-the work is derivative, and (2) the source code includes prominent notice with
-these four paragraphs for those parts of this code that are retained.
+(1) they include prominent notice that the work is derivative, and (2) they
+include prominent notice akin to these four paragraphs for those parts of
+this code that are retained.
 
-=============================================================================*/
+===============================================================================
+*/
 
 #if defined(TARGET_MIPS) || defined(TARGET_SH4) || defined(TARGET_UNICORE32)
 #define SNAN_BIT_IS_ONE		1
fpu/softfloat.c +18 -20
index 16b21eb..6041dbd 100644
@@ -4,10 +4,10 @@
  * Derived from SoftFloat.
  */
 
-/*============================================================================
-
-This C source file is part of the SoftFloat IEC/IEEE Floating-point Arithmetic
-Package, Release 2b.
+/*
+===============================================================================
+This C source file is part of the SoftFloat IEC/IEEE Floating-point
+Arithmetic Package, Release 2a.
 
 Written by John R. Hauser.  This work was made possible in part by the
 International Computer Science Institute, located at Suite 600, 1947 Center
@@ -16,24 +16,22 @@ National Science Foundation under grant MIP-9311980.  The original version
 of this code was written as part of a project to build a fixed-point vector
 processor in collaboration with the University of California at Berkeley,
 overseen by Profs. Nelson Morgan and John Wawrzynek.  More information
-is available through the Web page `http://www.cs.berkeley.edu/~jhauser/
+is available through the Web page `http://HTTP.CS.Berkeley.EDU/~jhauser/
 arithmetic/SoftFloat.html'.
 
-THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE.  Although reasonable effort has
-been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT TIMES
-RESULT IN INCORRECT BEHAVIOR.  USE OF THIS SOFTWARE IS RESTRICTED TO PERSONS
-AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ALL LOSSES,
-COSTS, OR OTHER PROBLEMS THEY INCUR DUE TO THE SOFTWARE, AND WHO FURTHERMORE
-EFFECTIVELY INDEMNIFY JOHN HAUSER AND THE INTERNATIONAL COMPUTER SCIENCE
-INSTITUTE (possibly via similar legal warning) AGAINST ALL LOSSES, COSTS, OR
-OTHER PROBLEMS INCURRED BY THEIR CUSTOMERS AND CLIENTS DUE TO THE SOFTWARE.
+THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE.  Although reasonable effort
+has been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT
+TIMES RESULT IN INCORRECT BEHAVIOR.  USE OF THIS SOFTWARE IS RESTRICTED TO
+PERSONS AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ANY
+AND ALL LOSSES, COSTS, OR OTHER PROBLEMS ARISING FROM ITS USE.
 
 Derivative works are acceptable, even for commercial purposes, so long as
-(1) the source code for the derivative work includes prominent notice that
-the work is derivative, and (2) the source code includes prominent notice with
-these four paragraphs for those parts of this code that are retained.
+(1) they include prominent notice that the work is derivative, and (2) they
+include prominent notice akin to these four paragraphs for those parts of
+this code that are retained.
 
-=============================================================================*/
+===============================================================================
+*/
 
 /* softfloat (and in particular the code in softfloat-specialize.h) is
  * target-dependent and needs the TARGET_* macros.
@@ -529,9 +527,9 @@ static inline float64 packFloat64(flag zSign, int_fast16_t zExp, uint64_t zSig)
 | the inexact exception raised if the abstract input cannot be represented
 | exactly.  However, if the abstract value is too large, the overflow and
 | inexact exceptions are raised and an infinity or maximal finite value is
-| returned.  If the abstract value is too small, the input value is rounded
-| to a subnormal number, and the underflow and inexact exceptions are raised
-| if the abstract input cannot be represented exactly as a subnormal double-
+| returned.  If the abstract value is too small, the input value is rounded to
+| a subnormal number, and the underflow and inexact exceptions are raised if
+| the abstract input cannot be represented exactly as a subnormal double-
 | precision floating-point number.
 |     The input significand `zSig' has its binary point between bits 62
 | and 61, which is 10 bits to the left of the usual location.  This shifted
include/fpu/softfloat.h +15 -17
index e32e25d..4da5778 100644
@@ -4,10 +4,10 @@
  * Derived from SoftFloat.
  */
 
-/*============================================================================
-
-This C header file is part of the SoftFloat IEC/IEEE Floating-point Arithmetic
-Package, Release 2b.
+/*
+===============================================================================
+This C header file is part of the SoftFloat IEC/IEEE Floating-point
+Arithmetic Package, Release 2a.
 
 Written by John R. Hauser.  This work was made possible in part by the
 International Computer Science Institute, located at Suite 600, 1947 Center
@@ -16,24 +16,22 @@ National Science Foundation under grant MIP-9311980.  The original version
 of this code was written as part of a project to build a fixed-point vector
 processor in collaboration with the University of California at Berkeley,
 overseen by Profs. Nelson Morgan and John Wawrzynek.  More information
-is available through the Web page `http://www.cs.berkeley.edu/~jhauser/
+is available through the Web page `http://HTTP.CS.Berkeley.EDU/~jhauser/
 arithmetic/SoftFloat.html'.
 
-THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE.  Although reasonable effort has
-been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT TIMES
-RESULT IN INCORRECT BEHAVIOR.  USE OF THIS SOFTWARE IS RESTRICTED TO PERSONS
-AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ALL LOSSES,
-COSTS, OR OTHER PROBLEMS THEY INCUR DUE TO THE SOFTWARE, AND WHO FURTHERMORE
-EFFECTIVELY INDEMNIFY JOHN HAUSER AND THE INTERNATIONAL COMPUTER SCIENCE
-INSTITUTE (possibly via similar legal warning) AGAINST ALL LOSSES, COSTS, OR
-OTHER PROBLEMS INCURRED BY THEIR CUSTOMERS AND CLIENTS DUE TO THE SOFTWARE.
+THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE.  Although reasonable effort
+has been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT
+TIMES RESULT IN INCORRECT BEHAVIOR.  USE OF THIS SOFTWARE IS RESTRICTED TO
+PERSONS AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ANY
+AND ALL LOSSES, COSTS, OR OTHER PROBLEMS ARISING FROM ITS USE.
 
 Derivative works are acceptable, even for commercial purposes, so long as
-(1) the source code for the derivative work includes prominent notice that
-the work is derivative, and (2) the source code includes prominent notice with
-these four paragraphs for those parts of this code that are retained.
+(1) they include prominent notice that the work is derivative, and (2) they
+include prominent notice akin to these four paragraphs for those parts of
+this code that are retained.
 
-=============================================================================*/
+===============================================================================
+*/
 
 #ifndef SOFTFLOAT_H
 #define SOFTFLOAT_H
Signature · 1 line
1.9.1
#2 lore raw

PATCH 2/6 softfloat: Revert remaining portions of commits 75d62a5856 and 3430b0be36f

In reply to Peter Maydell

Revert the remaining portions of commits 75d62a5856 and 3430b0be36f which are under a SoftFloat-2b license, ie the functions uint64_to_float32() and uint64_to_float64(). (The float64_to_uint64() and float64_to_uint64_round_to_zero() functions were completely rewritten in commits fb3ea83aa and 0a87a3107d so can stay.)

---
 fpu/softfloat.c         | 35 -----------------------------------
 include/fpu/softfloat.h |  2 --
 2 files changed, 37 deletions(-)
fpu/softfloat.c +0 -35
index 6041dbd..f79669f 100644
@@ -1302,27 +1302,6 @@ float32 int64_to_float32(int64_t a STATUS_PARAM)
 
 }
 
-float32 uint64_to_float32(uint64_t a STATUS_PARAM)
-{
-    int8 shiftCount;
-
-    if ( a == 0 ) return float32_zero;
-    shiftCount = countLeadingZeros64( a ) - 40;
-    if ( 0 <= shiftCount ) {
-        return packFloat32(0, 0x95 - shiftCount, a<<shiftCount);
-    }
-    else {
-        shiftCount += 7;
-        if ( shiftCount < 0 ) {
-            shift64RightJamming( a, - shiftCount, &a );
-        }
-        else {
-            a <<= shiftCount;
-        }
-        return roundAndPackFloat32(0, 0x9C - shiftCount, a STATUS_VAR);
-    }
-}
-
 /*----------------------------------------------------------------------------
 | Returns the result of converting the 64-bit two's complement integer `a'
 | to the double-precision floating-point format.  The conversion is performed
@@ -1342,20 +1321,6 @@ float64 int64_to_float64(int64_t a STATUS_PARAM)
 
 }
 
-float64 uint64_to_float64(uint64_t a STATUS_PARAM)
-{
-    int exp =  0x43C;
-
-    if (a == 0) {
-        return float64_zero;
-    }
-    if ((int64_t)a < 0) {
-        shift64RightJamming(a, 1, &a);
-        exp += 1;
-    }
-    return normalizeRoundAndPackFloat64(0, exp, a STATUS_VAR);
-}
-
 /*----------------------------------------------------------------------------
 | Returns the result of converting the 64-bit two's complement integer `a'
 | to the extended double-precision floating-point format.  The conversion
include/fpu/softfloat.h +0 -2
index 4da5778..772f9a1 100644
@@ -273,9 +273,7 @@ float64 uint32_to_float64(uint32_t STATUS_PARAM);
 floatx80 int32_to_floatx80(int32_t STATUS_PARAM);
 float128 int32_to_float128(int32_t STATUS_PARAM);
 float32 int64_to_float32(int64_t STATUS_PARAM);
-float32 uint64_to_float32(uint64_t STATUS_PARAM);
 float64 int64_to_float64(int64_t STATUS_PARAM);
-float64 uint64_to_float64(uint64_t STATUS_PARAM);
 floatx80 int64_to_floatx80(int64_t STATUS_PARAM);
 float128 int64_to_float128(int64_t STATUS_PARAM);
 float128 uint64_to_float128(uint64_t STATUS_PARAM);
Signature · 1 line
1.9.1
#3 lore raw

PATCH 3/6 softfloat: Revert remaining parts of commits b645bb4885 and 5a6932d51d

In reply to Peter Maydell

Revert the parts of commits b645bb4885 and 5a6932d51d which are still in the codebase and under a SoftFloat-2b license.

---
 fpu/softfloat-specialize.h | 69 ++--------------------------------------------
 1 file changed, 2 insertions(+), 67 deletions(-)
fpu/softfloat-specialize.h +2 -67
index 39335b4..187cdf6 100644
@@ -33,12 +33,6 @@ this code that are retained.
 ===============================================================================
 */
 
-#if defined(TARGET_MIPS) || defined(TARGET_SH4) || defined(TARGET_UNICORE32)
-#define SNAN_BIT_IS_ONE		1
-#else
-#define SNAN_BIT_IS_ONE		0
-#endif
-
 #if defined(TARGET_XTENSA)
 /* Define for architectures which deviate from IEEE in not supporting
  * signaling NaNs (so all NaNs are treated as quiet).
@@ -65,8 +59,6 @@ const float32 float32_default_nan = const_float32(0x7FFFFFFF);
 #elif defined(TARGET_PPC) || defined(TARGET_ARM) || defined(TARGET_ALPHA) || \
       defined(TARGET_XTENSA)
 const float32 float32_default_nan = const_float32(0x7FC00000);
-#elif SNAN_BIT_IS_ONE
-const float32 float32_default_nan = const_float32(0x7FBFFFFF);
 #else
 const float32 float32_default_nan = const_float32(0xFFC00000);
 #endif
@@ -78,8 +70,6 @@ const float32 float32_default_nan = const_float32(0xFFC00000);
 const float64 float64_default_nan = const_float64(LIT64( 0x7FFFFFFFFFFFFFFF ));
 #elif defined(TARGET_PPC) || defined(TARGET_ARM) || defined(TARGET_ALPHA)
 const float64 float64_default_nan = const_float64(LIT64( 0x7FF8000000000000 ));
-#elif SNAN_BIT_IS_ONE
-const float64 float64_default_nan = const_float64(LIT64( 0x7FF7FFFFFFFFFFFF ));
 #else
 const float64 float64_default_nan = const_float64(LIT64( 0xFFF8000000000000 ));
 #endif
@@ -87,13 +77,8 @@ const float64 float64_default_nan = const_float64(LIT64( 0xFFF8000000000000 ));
 /*----------------------------------------------------------------------------
 | The pattern for a default generated extended double-precision NaN.
 *----------------------------------------------------------------------------*/
-#if SNAN_BIT_IS_ONE
-#define floatx80_default_nan_high 0x7FFF
-#define floatx80_default_nan_low  LIT64( 0xBFFFFFFFFFFFFFFF )
-#else
 #define floatx80_default_nan_high 0xFFFF
 #define floatx80_default_nan_low  LIT64( 0xC000000000000000 )
-#endif
 
 const floatx80 floatx80_default_nan
     = make_floatx80_init(floatx80_default_nan_high, floatx80_default_nan_low);
@@ -102,13 +87,8 @@ const floatx80 floatx80_default_nan
 | The pattern for a default generated quadruple-precision NaN.  The `high' and
 | `low' values hold the most- and least-significant bits, respectively.
 *----------------------------------------------------------------------------*/
-#if SNAN_BIT_IS_ONE
-#define float128_default_nan_high LIT64( 0x7FFF7FFFFFFFFFFF )
-#define float128_default_nan_low  LIT64( 0xFFFFFFFFFFFFFFFF )
-#else
 #define float128_default_nan_high LIT64( 0xFFFF800000000000 )
 #define float128_default_nan_low  LIT64( 0x0000000000000000 )
-#endif
 
 const float128 float128_default_nan
     = make_float128_init(float128_default_nan_high, float128_default_nan_low);
@@ -254,11 +234,7 @@ int float32_is_signaling_nan(float32 a_)
 int float32_is_quiet_nan( float32 a_ )
 {
     uint32_t a = float32_val(a_);
-#if SNAN_BIT_IS_ONE
-    return ( ( ( a>>22 ) & 0x1FF ) == 0x1FE ) && ( a & 0x003FFFFF );
-#else
-    return ( 0xFF800000 <= (uint32_t) ( a<<1 ) );
-#endif
+    return ( 0xFF000000 <= (uint32_t) ( a<<1 ) );
 }
 
 /*----------------------------------------------------------------------------
@@ -269,11 +245,7 @@ int float32_is_quiet_nan( float32 a_ )
 int float32_is_signaling_nan( float32 a_ )
 {
     uint32_t a = float32_val(a_);
-#if SNAN_BIT_IS_ONE
-    return ( 0xFF800000 <= (uint32_t) ( a<<1 ) );
-#else
     return ( ( ( a>>22 ) & 0x1FF ) == 0x1FE ) && ( a & 0x003FFFFF );
-#endif
 }
 #endif
 
@@ -662,13 +634,7 @@ int float64_is_signaling_nan(float64 a_)
 int float64_is_quiet_nan( float64 a_ )
 {
     uint64_t a = float64_val(a_);
-#if SNAN_BIT_IS_ONE
-    return
-           ( ( ( a>>51 ) & 0xFFF ) == 0xFFE )
-        && ( a & LIT64( 0x0007FFFFFFFFFFFF ) );
-#else
-    return ( LIT64( 0xFFF0000000000000 ) <= (uint64_t) ( a<<1 ) );
-#endif
+    return ( LIT64( 0xFFE0000000000000 ) <= (uint64_t) ( a<<1 ) );
 }
 
 /*----------------------------------------------------------------------------
@@ -679,13 +645,9 @@ int float64_is_quiet_nan( float64 a_ )
 int float64_is_signaling_nan( float64 a_ )
 {
     uint64_t a = float64_val(a_);
-#if SNAN_BIT_IS_ONE
-    return ( LIT64( 0xFFF0000000000000 ) <= (uint64_t) ( a<<1 ) );
-#else
     return
            ( ( ( a>>51 ) & 0xFFF ) == 0xFFE )
         && ( a & LIT64( 0x0007FFFFFFFFFFFF ) );
-#endif
 }
 #endif
 
@@ -861,18 +823,8 @@ int floatx80_is_signaling_nan(floatx80 a_)
 
 int floatx80_is_quiet_nan( floatx80 a )
 {
-#if SNAN_BIT_IS_ONE
-    uint64_t aLow;
-
-    aLow = a.low & ~ LIT64( 0x4000000000000000 );
-    return
-           ( ( a.high & 0x7FFF ) == 0x7FFF )
-        && (uint64_t) ( aLow<<1 )
-        && ( a.low == aLow );
-#else
     return ( ( a.high & 0x7FFF ) == 0x7FFF )
         && (LIT64( 0x8000000000000000 ) <= ((uint64_t) ( a.low<<1 )));
-#endif
 }
 
 /*----------------------------------------------------------------------------
@@ -883,10 +835,6 @@ int floatx80_is_quiet_nan( floatx80 a )
 
 int floatx80_is_signaling_nan( floatx80 a )
 {
-#if SNAN_BIT_IS_ONE
-    return ( ( a.high & 0x7FFF ) == 0x7FFF )
-        && (LIT64( 0x8000000000000000 ) <= ((uint64_t) ( a.low<<1 )));
-#else
     uint64_t aLow;
 
     aLow = a.low & ~ LIT64( 0x4000000000000000 );
@@ -894,7 +842,6 @@ int floatx80_is_signaling_nan( floatx80 a )
            ( ( a.high & 0x7FFF ) == 0x7FFF )
         && (uint64_t) ( aLow<<1 )
         && ( a.low == aLow );
-#endif
 }
 #endif
 
@@ -1028,15 +975,9 @@ int float128_is_signaling_nan(float128 a_)
 
 int float128_is_quiet_nan( float128 a )
 {
-#if SNAN_BIT_IS_ONE
-    return
-           ( ( ( a.high>>47 ) & 0xFFFF ) == 0xFFFE )
-        && ( a.low || ( a.high & LIT64( 0x00007FFFFFFFFFFF ) ) );
-#else
     return
            ( LIT64( 0xFFFE000000000000 ) <= (uint64_t) ( a.high<<1 ) )
         && ( a.low || ( a.high & LIT64( 0x0000FFFFFFFFFFFF ) ) );
-#endif
 }
 
 /*----------------------------------------------------------------------------
@@ -1046,15 +987,9 @@ int float128_is_quiet_nan( float128 a )
 
 int float128_is_signaling_nan( float128 a )
 {
-#if SNAN_BIT_IS_ONE
-    return
-           ( LIT64( 0xFFFE000000000000 ) <= (uint64_t) ( a.high<<1 ) )
-        && ( a.low || ( a.high & LIT64( 0x0000FFFFFFFFFFFF ) ) );
-#else
     return
            ( ( ( a.high>>47 ) & 0xFFFF ) == 0xFFFE )
         && ( a.low || ( a.high & LIT64( 0x00007FFFFFFFFFFF ) ) );
-#endif
 }
 #endif
 
Signature · 1 line
1.9.1
#4 lore raw

PATCH 4/6 softfloat: Implement uint64_to_float64() and uint64_to_float32()

In reply to Peter Maydell

Reimplement from scratch the uint64_to_float64() and uint64_to_float32() conversion functions.

---
 fpu/softfloat.c         | 47 +++++++++++++++++++++++++++++++++++++++++++++++
 include/fpu/softfloat.h |  2 ++
 2 files changed, 49 insertions(+)
fpu/softfloat.c +47 -0
index f79669f..3ab75a3 100644
@@ -1302,6 +1302,35 @@ float32 int64_to_float32(int64_t a STATUS_PARAM)
 
 }
 
+float32 uint64_to_float32(uint64_t a STATUS_PARAM)
+{
+    int shiftcount;
+
+    if (a == 0) {
+        return float32_zero;
+    }
+
+    /* Determine (left) shift needed to put first set bit into bit posn 23
+     * (since packFloat32() expects the binary point between bits 23 and 22);
+     * this is the fast case for smallish numbers.
+     */
+    shiftcount = countLeadingZeros64(a) - 40;
+    if (shiftcount >= 0) {
+        return packFloat32(0, 0x95 - shiftcount, a << shiftcount);
+    }
+    /* Otherwise we need to do a round-and-pack. roundAndPackFloat32()
+     * expects the binary point between bits 30 and 29, hence the + 7.
+     */
+    shiftcount += 7;
+    if (shiftcount < 0) {
+        shift64RightJamming(a, -shiftcount, &a);
+    } else {
+        a <<= shiftcount;
+    }
+
+    return roundAndPackFloat32(0, 0x9c - shiftcount, a STATUS_VAR);
+}
+
 /*----------------------------------------------------------------------------
 | Returns the result of converting the 64-bit two's complement integer `a'
 | to the double-precision floating-point format.  The conversion is performed
@@ -1321,6 +1350,24 @@ float64 int64_to_float64(int64_t a STATUS_PARAM)
 
 }
 
+float64 uint64_to_float64(uint64_t a STATUS_PARAM)
+{
+    int exp = 0x43C;
+    int shiftcount;
+
+    if (a == 0) {
+        return float64_zero;
+    }
+
+    shiftcount = countLeadingZeros64(a) - 1;
+    if (shiftcount < 0) {
+        shift64RightJamming(a, -shiftcount, &a);
+    } else {
+        a <<= shiftcount;
+    }
+    return roundAndPackFloat64(0, exp - shiftcount, a STATUS_VAR);
+}
+
 /*----------------------------------------------------------------------------
 | Returns the result of converting the 64-bit two's complement integer `a'
 | to the extended double-precision floating-point format.  The conversion
include/fpu/softfloat.h +2 -0
index 772f9a1..50c2fec 100644
@@ -274,6 +274,8 @@ floatx80 int32_to_floatx80(int32_t STATUS_PARAM);
 float128 int32_to_float128(int32_t STATUS_PARAM);
 float32 int64_to_float32(int64_t STATUS_PARAM);
 float64 int64_to_float64(int64_t STATUS_PARAM);
+float32 uint64_to_float32(uint64_t STATUS_PARAM);
+float64 uint64_to_float64(uint64_t STATUS_PARAM);
 floatx80 int64_to_floatx80(int64_t STATUS_PARAM);
 float128 int64_to_float128(int64_t STATUS_PARAM);
 float128 uint64_to_float128(uint64_t STATUS_PARAM);
Signature · 1 line
1.9.1
#5 lore raw

PATCH 5/6 softfloat: reimplement SNAN_BIT_IS_ONE support

In reply to Peter Maydell

Reimplement support for architectures where the most significant bit in the mantissa is 1 for a signaling NaN rather than a quiet NaN, by adding handling for SNAN_BIT_IS_ONE being set to the functions which test values for NaN-ness.

This includes restoring the bugfixes lost in the reversion where some of the float*_is_quiet_nan() functions were returning true for both signaling and quiet NaNs.

---
 fpu/softfloat-specialize.h | 74 +++++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 70 insertions(+), 4 deletions(-)
fpu/softfloat-specialize.h +70 -4
index 187cdf6..6de66ce 100644
@@ -33,6 +33,16 @@ this code that are retained.
 ===============================================================================
 */
 
+/* Does the target distinguish signaling NaNs from non-signaling NaNs
+ * by setting the most significant bit of the mantissa for a signaling NaN?
+ * (The more common choice is to have it be zero for SNaN and one for QNaN.)
+ */
+#if defined(TARGET_MIPS) || defined(TARGET_SH4) || defined(TARGET_UNICORE32)
+#define SNAN_BIT_IS_ONE 1
+#else
+#define SNAN_BIT_IS_ONE 0
+#endif
+
 #if defined(TARGET_XTENSA)
 /* Define for architectures which deviate from IEEE in not supporting
  * signaling NaNs (so all NaNs are treated as quiet).
@@ -59,6 +69,8 @@ const float32 float32_default_nan = const_float32(0x7FFFFFFF);
 #elif defined(TARGET_PPC) || defined(TARGET_ARM) || defined(TARGET_ALPHA) || \
       defined(TARGET_XTENSA)
 const float32 float32_default_nan = const_float32(0x7FC00000);
+#elif SNAN_BIT_IS_ONE
+const float32 float32_default_nan = const_float32(0xFF800000);
 #else
 const float32 float32_default_nan = const_float32(0xFFC00000);
 #endif
@@ -70,6 +82,8 @@ const float32 float32_default_nan = const_float32(0xFFC00000);
 const float64 float64_default_nan = const_float64(LIT64( 0x7FFFFFFFFFFFFFFF ));
 #elif defined(TARGET_PPC) || defined(TARGET_ARM) || defined(TARGET_ALPHA)
 const float64 float64_default_nan = const_float64(LIT64( 0x7FF8000000000000 ));
+#elif SNAN_BIT_IS_ONE
+const float64 float64_default_nan = const_float64(LIT64(0xFFF0000000000000));
 #else
 const float64 float64_default_nan = const_float64(LIT64( 0xFFF8000000000000 ));
 #endif
@@ -77,8 +91,13 @@ const float64 float64_default_nan = const_float64(LIT64( 0xFFF8000000000000 ));
 /*----------------------------------------------------------------------------
 | The pattern for a default generated extended double-precision NaN.
 *----------------------------------------------------------------------------*/
+#if SNAN_BIT_IS_ONE
+#define floatx80_default_nan_high 0xFFFF
+#define floatx80_default_nan_low  LIT64(0x8000000000000000)
+#else
 #define floatx80_default_nan_high 0xFFFF
 #define floatx80_default_nan_low  LIT64( 0xC000000000000000 )
+#endif
 
 const floatx80 floatx80_default_nan
     = make_floatx80_init(floatx80_default_nan_high, floatx80_default_nan_low);
@@ -87,8 +106,13 @@ const floatx80 floatx80_default_nan
 | The pattern for a default generated quadruple-precision NaN.  The `high' and
 | `low' values hold the most- and least-significant bits, respectively.
 *----------------------------------------------------------------------------*/
+#if SNAN_BIT_IS_ONE
+#define float128_default_nan_high LIT64(0xFFFF000000000000)
+#define float128_default_nan_low  LIT64(0x0000000000000000)
+#else
 #define float128_default_nan_high LIT64( 0xFFFF800000000000 )
 #define float128_default_nan_low  LIT64( 0x0000000000000000 )
+#endif
 
 const float128 float128_default_nan
     = make_float128_init(float128_default_nan_high, float128_default_nan_low);
@@ -234,7 +258,11 @@ int float32_is_signaling_nan(float32 a_)
 int float32_is_quiet_nan( float32 a_ )
 {
     uint32_t a = float32_val(a_);
-    return ( 0xFF000000 <= (uint32_t) ( a<<1 ) );
+#if SNAN_BIT_IS_ONE
+    return (((a >> 22) & 0x1ff) == 0x1fe) && (a & 0x003fffff);
+#else
+    return ((uint32_t)(a << 1) >= 0xff800000);
+#endif
 }
 
 /*----------------------------------------------------------------------------
@@ -245,7 +273,11 @@ int float32_is_quiet_nan( float32 a_ )
 int float32_is_signaling_nan( float32 a_ )
 {
     uint32_t a = float32_val(a_);
+#if SNAN_BIT_IS_ONE
+    return ((uint32_t)(a << 1) >= 0xff800000);
+#else
     return ( ( ( a>>22 ) & 0x1FF ) == 0x1FE ) && ( a & 0x003FFFFF );
+#endif
 }
 #endif
 
@@ -634,7 +666,12 @@ int float64_is_signaling_nan(float64 a_)
 int float64_is_quiet_nan( float64 a_ )
 {
     uint64_t a = float64_val(a_);
-    return ( LIT64( 0xFFE0000000000000 ) <= (uint64_t) ( a<<1 ) );
+#if SNAN_BIT_IS_ONE
+    return (((a >> 51) & 0xfff) == 0xffe)
+           && (a & 0x0007ffffffffffffULL);
+#else
+    return ((a << 1) >= 0xfff0000000000000ULL);
+#endif
 }
 
 /*----------------------------------------------------------------------------
@@ -645,9 +682,13 @@ int float64_is_quiet_nan( float64 a_ )
 int float64_is_signaling_nan( float64 a_ )
 {
     uint64_t a = float64_val(a_);
+#if SNAN_BIT_IS_ONE
+    return ((a << 1) >= 0xfff0000000000000ULL);
+#else
     return
            ( ( ( a>>51 ) & 0xFFF ) == 0xFFE )
         && ( a & LIT64( 0x0007FFFFFFFFFFFF ) );
+#endif
 }
 #endif
 
@@ -823,8 +864,17 @@ int floatx80_is_signaling_nan(floatx80 a_)
 
 int floatx80_is_quiet_nan( floatx80 a )
 {
+#if SNAN_BIT_IS_ONE
+    uint64_t aLow;
+
+    aLow = a.low & ~0x4000000000000000ULL;
+    return ((a.high & 0x7fff) == 0x7fff)
+        && (aLow << 1)
+        && (a.low == aLow);
+#else
     return ( ( a.high & 0x7FFF ) == 0x7FFF )
         && (LIT64( 0x8000000000000000 ) <= ((uint64_t) ( a.low<<1 )));
+#endif
 }
 
 /*----------------------------------------------------------------------------
@@ -835,6 +885,10 @@ int floatx80_is_quiet_nan( floatx80 a )
 
 int floatx80_is_signaling_nan( floatx80 a )
 {
+#if SNAN_BIT_IS_ONE
+    return ((a.high & 0x7fff) == 0x7fff)
+        && ((a.low << 1) >= 0x8000000000000000ULL);
+#else
     uint64_t aLow;
 
     aLow = a.low & ~ LIT64( 0x4000000000000000 );
@@ -842,6 +896,7 @@ int floatx80_is_signaling_nan( floatx80 a )
            ( ( a.high & 0x7FFF ) == 0x7FFF )
         && (uint64_t) ( aLow<<1 )
         && ( a.low == aLow );
+#endif
 }
 #endif
 
@@ -975,9 +1030,14 @@ int float128_is_signaling_nan(float128 a_)
 
 int float128_is_quiet_nan( float128 a )
 {
+#if SNAN_BIT_IS_ONE
+    return (((a.high >> 47) & 0xffff) == 0xfffe)
+        && (a.low || (a.high & 0x00007fffffffffffULL));
+#else
     return
-           ( LIT64( 0xFFFE000000000000 ) <= (uint64_t) ( a.high<<1 ) )
-        && ( a.low || ( a.high & LIT64( 0x0000FFFFFFFFFFFF ) ) );
+        ((a.high << 1) >= 0xffff000000000000)
+        && (a.low || (a.high & 0x0000ffffffffffffULL));
+#endif
 }
 
 /*----------------------------------------------------------------------------
@@ -987,9 +1047,15 @@ int float128_is_quiet_nan( float128 a )
 
 int float128_is_signaling_nan( float128 a )
 {
+#if SNAN_BIT_IS_ONE
+    return
+        ((a.high << 1) >= 0xffff000000000000)
+        && (a.low || (a.high & 0x0000ffffffffffffULL));
+#else
     return
            ( ( ( a.high>>47 ) & 0xFFFF ) == 0xFFFE )
         && ( a.low || ( a.high & LIT64( 0x00007FFFFFFFFFFF ) ) );
+#endif
 }
 #endif
 
Signature · 1 line
1.9.1
#6 lore raw

Re: [Qemu-devel] [PATCH 5/6] softfloat: reimplement SNAN_BIT_IS_ONE support

Peter,

Quoted 5 lines

Reimplement support for architectures where the most significant bit in the mantissa is 1 for a signaling NaN rather than a quiet NaN, by adding handling for SNAN_BIT_IS_ONE being set to the functions which test values for NaN-ness.

Quoted 8 lines

This includes restoring the bugfixes lost in the reversion where some of the float*_is_quiet_nan() functions were returning true for both signaling and quiet NaNs.

---
 fpu/softfloat-specialize.h | 74 +++++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 70 insertions(+), 4 deletions(-)

You've lost changes made by Thiemo here:

commit 5a6932d51d1b34b68b3f10fc5ac65598bece88c0

Author: ths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>
Date:   Fri Nov 16 14:57:36 2007 +0000

Fix NaN handling for MIPS and HPPA.

-- notice the reintroduction of the different, wrong default NaN encoding patterns. Will you be sending an update shortly so that I can schedule my MIPS IEEE 754-2008 testing tonight?

Maciej

#7 lore raw

Re: [Qemu-devel] [PATCH 5/6] softfloat: reimplement SNAN_BIT_IS_ONE support

Quoted 3 lines · Maciej W. Rozycki

-- notice the reintroduction of the different, wrong default NaN encoding patterns. Will you be sending an update shortly so that I can schedule my MIPS IEEE 754-2008 testing tonight?

Ah, yes, as you point out these are all actually not NaN bit patterns at all. I've just sent out a fixup patch which makes them all consistently sign-bit-clear, exponent-bits-set, top-mantissa-bit-clear, other-mantissa-bits-set. (I'll squash that patch into the other one for v2.)

thanks
-- PMM

#8 lore raw

PATCH 6/6 softfloat: Clarify license status

In reply to Peter Maydell

The code in the softfloat source files is under a mixture of
licenses: the original code and many changes from QEMU contributors are under the base SoftFloat-2a license; changes from Stefan Weil and RedHat employees are GPLv2-or-later; changes from Fabrice Bellard are under the BSD license. Clarify this in the comments at the top of each affected source file, including a statement about the assumed licensing for future contributions, so we don't need to remember to ask patch submitters explicitly to pick a license.

---
 fpu/softfloat-macros.h     | 48 +++++++++++++++++++++++++++++++++++++++++++++-
 fpu/softfloat-specialize.h | 48 +++++++++++++++++++++++++++++++++++++++++++++-
 fpu/softfloat.c            | 48 +++++++++++++++++++++++++++++++++++++++++++++-
 include/fpu/softfloat.h    | 48 +++++++++++++++++++++++++++++++++++++++++++++-
 4 files changed, 188 insertions(+), 4 deletions(-)
fpu/softfloat-macros.h +47 -1
index ca1d81e..194360e 100644
@@ -1,7 +1,18 @@
 /*
  * QEMU float support macros
  *
- * Derived from SoftFloat.
+ * The code in this source file is derived from release 2a of the SoftFloat
+ * IEC/IEEE Floating-point Arithmetic Package. Those parts of the code (and
+ * some later contributions) are provided under that license, as detailed below.
+ * It has subsequently been modified by contributors to the QEMU Project,
+ * so some portions are provided under:
+ *  the SoftFloat-2a license
+ *  the BSD license
+ *  GPL-v2-or-later
+ *
+ * Any future contributions to this file after December 1st 2014
+ * will be taken to be licensed under GPL-v2-or-later unless specifically
+ * indicated otherwise. See the COPYING file in the top-level directory.
  */
 
 /*
@@ -33,6 +44,41 @@ this code that are retained.
 ===============================================================================
 */
 
+/* BSD licensing:
+ * Copyright (c) 2006, Fabrice Bellard
+ * 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.
+ *
+ * 3. Neither the name of the copyright holder nor the names of its contributors
+ * may be used to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT HOLDER 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.
+ */
+
+/* Portions of this work are licensed under the terms of the GNU GPL,
+ * version 2 or later. See the COPYING file in the top-level directory.
+ */
+
 /*----------------------------------------------------------------------------
 | This macro tests for minimum version of the GNU C compiler.
 *----------------------------------------------------------------------------*/
fpu/softfloat-specialize.h +47 -1

60 lines not on this page · raw message

fpu/softfloat.c +47 -1

60 lines not on this page · raw message

include/fpu/softfloat.h +47 -1

60 lines not on this page · raw message

Signature · 1 line
1.9.1
#9 lore raw
In reply to Peter Maydell

Hi; this is a ping (with some of the less frequent contributors taken off cc), because I'd really like it if we could get this issue dealt with (preferably before a flood of new patches to softfloat arrive after the tree reopens for 2.3), but this patchset needs review (for methodology, of my reimplemented functions, and of whether we should avoid the bisection break).

thanks
-- PMM

Quoted 222 lines · Peter Maydell

[If you're not a regular QEMU contributor: you are CC'd on this just for your information and because you provided an Acked-by for the previous version of this patch back in 2013; thanks! No action is required from you. Regular contributors are invited to review the patchset.]

Hi; as you may be aware, we discovered some time back that the license of SoftFloat-2b is claimed to be GPLv2 incompatible by the FSF due to an indemnification clause. The previous release, SoftFloat-2a, did not contain this clause. We're therefore switching to the -2a release and relicensing (or reverting and reimplementing) all subsequent commits by QEMU contributors.

Last time around we were able to collect acks for the relicensing from almost all contributors, so thanks to all of you. This patchset aims to complete the process by applying the relicensing patch and providing reimplemented code for the handful of commits that had to be reverted.

The patch switching from upstream's SoftFloat-2b to -2a is constructed in the same way Anthony Liguori used in 2013:
* diff commit 158142c2 against SoftFloat-2b to separate out the changes made by Fabrice as part of the import
* copy over the SoftFloat-2a versions of the files instead
* apply some mechanical transformations (line endings, block comment style)
* re-apply Fabrice's patches
* diff this endpoint against 158142c2 to give a 2b-to-2a relicensing patch
* apply that to current master

Conceptually I would have preferred to replay all of our QEMU commits after 158142c2 on top of the SoftFloat-2a equivalent (giving a sort of alternate-history master rebased on 2a) and then diffed that against the real-world master. However git cherry-pick chokes on merge commits. If anybody has better git skills than me and thinks this can be done then I'd be interested to see it. In any case the patch is I think equivalent -- it's just a matter of which two sides of a square you go round to reach the far corner.

Following this change are a set of patches which revert the only four commits in the tree which are still relevant and for which we could not get acks for relicensing. I present them in this series as separate "revert" and "reimplement" patches, since this more clearly shows the intent. Obviously this will break bisection...

Finally there's a patch which adds comments to the top of each affected file clarifying the new licensing status (where the files contain portions under variously SoftFloat-2a, BSD and GPLv2+ licenses) and specifying the default license for new contributions (so we don't have to keep asking patch submitters to specify it). I've applied the Acked-by tags from the 2013 round to this patch as it seemed the most appropriate place. (Those acks should thus be taken to indicate approval for the relicensing rather than necessarily specifically for the wording choice.)

Questions for review:
* can we do the git cherry-pick thing I mention above?
* should we squash the revert and reimplement patches together? (avoids bisection break but makes the revert-and-reimplement less clear)
* would anybody like to cross-check my examination of the commit logs to confirm I didn't miss any patches we need to revert?
* are there any bugs in my reimplementations?
* are people happy with my attempt to clarify the licensing status of the source files in patch 6, and my choice of GPLv2+ for future contributions to them?

I've put the full details of how I constructed this patchset after the diffstat. References in that text to "this archive" are to
http://people.linaro.org/~peter.maydell/softfloat-relicensing-proposed.tar.gz
which is a complete archive of everything needed to reproduce the patchset, including copies of upstream's pristine 2a and 2b tarballs. If/when this patchset is applied I plan to upload it to the QEMU webserver as a permanent archive of what happened here (since the commit diffs themselves don't tell the full story).

thanks
-- PMM

Peter Maydell (6):
softfloat: Apply patch corresponding to rebasing to softfloat-2a
softfloat: Revert remaining portions of commits 75d62a5856 and

    3430b0be36f

softfloat: Revert remaining parts of commits b645bb4885 and 5a6932d51d
softfloat: Implement uint64_to_float64() and uint64_to_float32()
softfloat: reimplement SNAN_BIT_IS_ONE support
softfloat: Clarify license status

 fpu/softfloat-macros.h     |  86 +++++++++++++++++++++-------
 fpu/softfloat-specialize.h | 139 ++++++++++++++++++++++++++++++---------------
 fpu/softfloat.c            | 136 +++++++++++++++++++++++++++++++-------------
 include/fpu/softfloat.h    |  82 +++++++++++++++++++-------
 4 files changed, 316 insertions(+), 127 deletions(-)

--
1.9.1

QEMU relicensing from SoftFloat-2b to SoftFloat-2a
==================================================

This archive contains binaries, patches and documentation regarding the process of relicensing QEMU's softfloat code from 2b to 2a.

The process followed is in two parts: replace the upstream SoftFloat code with the equivalent files from the upstream 2a release; and then revert and rewrite some later commits by QEMU contributors who could not be contacted to agree to a relicensing of their work.

Replacement of upstream code
----------------------------

This archive includes SoftFloat-2a.zip and SoftFloat-2b.zip, which are the original upstream source releases downloaded from:

http://web.archive.org/web/19991004171915/http://http.cs.berkeley.edu/%7Ejhauser/arithmetic/SoftFloat-2a.zip
http://www.jhauser.us/arithmetic/SoftFloat-2b.zip

The differences between the two are minimal, consisting mostly of the license change and a change in the style used for block comments.

Starting from the commit immediately before the original softfloat import (4f716dc681d1b) we can construct a series of commits which import the version 2a sources instead.

First separate out the changes Fabrice wrote as part of the initial import from the upstream 2b changes, and save the patch for later:

cp SoftFloat-2b/softfloat/bits64/softfloat.c 2b-rearranged/fpu
cp SoftFloat-2b/softfloat/bits64/386-Win32-GCC/softfloat.h 2b-rearranged/fpu/ cp SoftFloat-2b/softfloat/bits64/softfloat-macros 2b-rearranged/fpu/softfloat-macros.h cp SoftFloat-2b/softfloat/bits64/386-Win32-GCC/softfloat-specialize 2b-rearranged/fpu/
softfloat-specialize.h

    dos2unix 2b-rearranged/fpu/*.[ch]
    cd qemu
    git checkout 158142c2c2df728cfa3b5320c65534921a764f26
    cd ..
    diff -uN 2b-rearranged/fpu qemu/fpu > fabrice-initial-changes.patch

Now we can create the patchseries which is the equivalent 2a import:

    cd qemu
    git checkout 4f716dc681d1b

Copy the 2a files and fix their line endings to Unix style:

cp ../SoftFloat-2a/softfloat/bits64/softfloat.c fpu
cp ../SoftFloat-2a/softfloat/bits64/386-Win32-gcc/softfloat.h fpu
cp ../SoftFloat-2a/softfloat/bits64/softfloat-macros fpu/softfloat-macros.h
cp ../SoftFloat-2a/softfloat/bits64/386-Win32-gcc/softfloat-specialize fpu/softfloat-specialize.h dos2unix fpu/*.[ch]

Add the new files and configure/makefile changes from 158142c2c2df

git checkout 158142c2c2df7 fpu/softfloat-native.c fpu/softfloat-native.h git show 158142c2c2df7 Makefile.target configure | patch -p1

Mechanically update comment style (the perl script used is provided in this archive)

    for f in fpu/softfloat-specialize.h fpu/softfloat-macros.h fpu/softfloat.c fpu/softfloat.h; do fix-softfloat-comments $f > $f.new && mv $f.new $f; done

Delete a handful of blank lines to avoid spurious patch rejects.

Apply the "Fabrice initial changes" patch created earlier:
This requires a bunch of fuzzing but it does not fail on any hunks.

     patch -N -p1 --fuzz 5 -i ../fabrice-initial-changes.patch

The five commits that result from this process are archived in the reimport/ subdirectory.

We can now create a patch by diffing the endpoint of this set of commits against the original upstream import commit 158142c2c2df7:

     diff -u 158142c2c2df import-sf-2a > ../relicense-patch.txt

That patch is also included in this archive. It consists entirely of changes to version numbers, licence text and a trivial comment reformat (as expected, since the upstream 2a to 2b changes were just this).

We can then apply that patch to current QEMU master:

     patch  -p1 --fuzz 10 <../relicense-patch.txt

to produce a modern QEMU effectively rebased on version 2a of upstream SoftFloat.

Reverting and rewriting of later QEMU commits
---------------------------------------------

Since contributions to these softfloat files in QEMU after their initial import have to be assumed to have been provided by their authors under the SoftFloat-2b license, we needed to get permission from those authors to relicense their contributions under either the SoftFloat-2a license or some other GPLv2 compatible license. Most of these were collected in an email thread on qemu-devel in 2013 where we requested permission for relicensing changes which had been made up to that point. For all changes to these files after that date we confirmed with the patch submitter that they were willing to dual-license their change before applying the commit.

The affected commits can be listed with:
git log -- fpu/softfloat.h fpu/softfloat.c fpu/softfloat-specialize.h fpu/softfloat-macros.h include/fpu/softfloat.h

The file fpu-logs.txt lists these commits, annotated to either to indicate that it's ok for relicensing, or to indicate that the commit must be reverted. Only four commits need reversion:
5a6932d51d1b, b645bb4885, 3430b0be36fb7 and 75d62a585629c

The interesting cases (both the SFNOs and a handful of SFOK that were not trivially obviously OK) have been copied into 'sfno.txt' (to save you having to wade through the long list).

Copies of all the emails where people provided Acks are in the ackmails/ directory.

The patches in the reverts/ directory:
* apply the relicense-patch
* revert those parts of commits 5a6932d51d1b, b645bb4885, 3430b0be36fb7 and 75d62a585629c which change the softfloat files and are still in the QEMU tree
* independently reimplement the two functions and one bit of minor functionality which those commits provided
* update the source files to indicate the now complicated licensing that applies since some relicensing was to BSD or GPLv2+ rather than softfloat-2a

---end of README---

#10 lore raw
Quoted 6 lines · Peter Maydell

Hi; this is a ping (with some of the less frequent contributors taken off cc), because I'd really like it if we could get this issue dealt with (preferably before a flood of new patches to softfloat arrive after the tree reopens for 2.3), but this patchset needs review (for methodology, of my reimplemented functions, and of whether we should avoid the bisection break).

Ping^2 -- we've had some review of the reimplemented functions, but I would still appreciate review of methodology, opinions on whether we should squash the revert and reimplement patches together, etc.

thanks
-- PMM

#11 lore raw

Ping^3. I think this is an important issue to resolve, so please could somebody review what I've done?

thanks
-- PMM

Quoted 12 lines · Peter Maydell
Quoted 6 lines · Peter Maydell

Hi; this is a ping (with some of the less frequent contributors taken off cc), because I'd really like it if we could get this issue dealt with (preferably before a flood of new patches to softfloat arrive after the tree reopens for 2.3), but this patchset needs review (for methodology, of my reimplemented functions, and of whether we should avoid the bisection break).

Ping^2 -- we've had some review of the reimplemented functions, but I would still appreciate review of methodology, opinions on whether we should squash the revert and reimplement patches together, etc.

#12 lore raw
In reply to Peter Maydell
Quoted 2 lines · Peter Maydell

Questions for review:
* can we do the git cherry-pick thing I mention above?

I'm afraid that would double the size of the repository (in terms of number of commits).

One possibility is this:

git checkout 158142c2
git cherry-pick this-series~5 # patch 1
git cherry-pick this-series~2 # patch 4
git cherry-pick this-series~1 # patch 5
git merge origin/master
git checkout -p -- this-series~1 # patch 5
git commit --amend -C HEAD
git cherry-pick this-series # patch 6

Then the reverts are implicit in the merge commit.

However, this will probably still cause problems with bisection, since the merge base between 2.2 and 2.3 will be in prehistory.

Quoted 2 lines

* should we squash the revert and reimplement patches together? (avoids bisection break but makes the revert-and-reimplement less clear)

I think we can do that, provided the reimplemented functions are in different places than the originals, so that the revert-and-reimplement is still clear from the diff.

Quoted 2 lines

* would anybody like to cross-check my examination of the commit logs to confirm I didn't miss any patches we need to revert?

Ok.

Quoted 1 line

* are there any bugs in my reimplementations?

I guess Maciej took care of this

Quoted 3 lines

* are people happy with my attempt to clarify the licensing status of the source files in patch 6, and my choice of GPLv2+ for future contributions to them?

I think SoftFloat-2a is more appropriate but I don't really care.

Quoted 8 lines

I've put the full details of how I constructed this patchset after the diffstat. References in that text to "this archive" are to
http://people.linaro.org/~peter.maydell/softfloat-relicensing-proposed.tar.gz
which is a complete archive of everything needed to reproduce the patchset, including copies of upstream's pristine 2a and 2b tarballs. If/when this patchset is applied I plan to upload it to the QEMU webserver as a permanent archive of what happened here (since the commit diffs themselves don't tell the full story).

Sonuds good.

Paolo

Quoted 19 lines

thanks
-- PMM

Peter Maydell (6):
softfloat: Apply patch corresponding to rebasing to softfloat-2a
softfloat: Revert remaining portions of commits 75d62a5856 and

    3430b0be36f

softfloat: Revert remaining parts of commits b645bb4885 and 5a6932d51d
softfloat: Implement uint64_to_float64() and uint64_to_float32()
softfloat: reimplement SNAN_BIT_IS_ONE support
softfloat: Clarify license status

 fpu/softfloat-macros.h     |  86 +++++++++++++++++++++-------
 fpu/softfloat-specialize.h | 139 ++++++++++++++++++++++++++++++---------------
 fpu/softfloat.c            | 136 +++++++++++++++++++++++++++++++-------------
 include/fpu/softfloat.h    |  82 +++++++++++++++++++-------
 4 files changed, 316 insertions(+), 127 deletions(-)
#13 lore raw
Quoted 20 lines · Paolo Bonzini
Quoted 2 lines · Peter Maydell

Questions for review:
* can we do the git cherry-pick thing I mention above?

I'm afraid that would double the size of the repository (in terms of number of commits).

One possibility is this:

git checkout 158142c2
git cherry-pick this-series~5 # patch 1
git cherry-pick this-series~2 # patch 4
git cherry-pick this-series~1 # patch 5
git merge origin/master
git checkout -p -- this-series~1 # patch 5
git commit --amend -C HEAD
git cherry-pick this-series # patch 6

Quoted 4 lines

Then the reverts are implicit in the merge commit.

However, this will probably still cause problems with bisection, since the merge base between 2.2 and 2.3 will be in prehistory.

I meant more in the sense of how we generated the eventual relicensing-patch to apply to current master, rather than trying to make master's actual history have weird things in it. Anyway, it sounds like the thing I did is the best we can do.

Quoted 6 lines
Quoted 2 lines

* should we squash the revert and reimplement patches together? (avoids bisection break but makes the revert-and-reimplement less clear)

I think we can do that, provided the reimplemented functions are in different places than the originals, so that the revert-and-reimplement is still clear from the diff.

OK. I'll make sure I do that with the next version.

Quoted 5 lines
Quoted 3 lines

* are people happy with my attempt to clarify the licensing status of the source files in patch 6, and my choice of GPLv2+ for future contributions to them?

I think SoftFloat-2a is more appropriate but I don't really care.

The thing is that after all these relicensings we end up with a file with a mix of licenses in it. So for somebody actually using the file the controlling license is GPLv2+. (In particular all the RedHat contributions are GPLv2+, not SoftFloat-2a...) So it seemed simplest to say 'GPLv2+ for future changes'; but it wouldn't make any major difference to pick softfloat-2a I guess (and that is the license covering the bulk of the code so it does make more sense in some ways).

Thanks for looking at the series.
-- PMM

#14 lore raw
Quoted 4 lines · Peter Maydell

The thing is that after all these relicensings we end up with a file with a mix of licenses in it. So for somebody actually using the file the controlling license is GPLv2+. (In particular all the RedHat contributions are GPLv2+, not SoftFloat-2a...)

Actually, all four of us (I and Avi and Juan and Luiz) acked the change, so Red Hat contributions are SoftFloat-2a.

Quoted 4 lines

So it seemed simplest to say 'GPLv2+ for future changes'; but it wouldn't make any major difference to pick softfloat-2a I guess (and that is the license covering the bulk of the code so it does make more sense in some ways).

Yes, that was my reasoning.

Paolo

#15 lore raw
Quoted 10 lines · Paolo Bonzini
Quoted 4 lines · Peter Maydell

The thing is that after all these relicensings we end up with a file with a mix of licenses in it. So for somebody actually using the file the controlling license is GPLv2+. (In particular all the RedHat contributions are GPLv2+, not SoftFloat-2a...)

Actually, all four of us (I and Avi and Juan and Luiz) acked the change, so Red Hat contributions are SoftFloat-2a.

You said
# All Red Hat contributions (at least Avi, Juan, me; don't know about rth)

# are available under GPLv2+; also other authors agreed on it.  For this
# particular license,
# Acked-by: Paolo Bonzini <[email protected]>

and Juan said:
# As said by paolo, any contribution by me is under GPLv2+ O:-)

which I took to mean that the RH contribs were GPLv2+, not SF2a.

Quoted 6 lines
Quoted 4 lines

So it seemed simplest to say 'GPLv2+ for future changes'; but it wouldn't make any major difference to pick softfloat-2a I guess (and that is the license covering the bulk of the code so it does make more sense in some ways).

Yes, that was my reasoning.

Anyway, we can make the future-changes license sf2a regardless of what license the RH contribs in the past are under (we have the non-SF2a BSD contribs as well so the license of the whole file is never going to be a single simple thing).

-- PMM

#16 lore raw
Quoted 14 lines · Peter Maydell
Quoted 10 lines · Paolo Bonzini
Quoted 4 lines · Peter Maydell

The thing is that after all these relicensings we end up with a file with a mix of licenses in it. So for somebody actually using the file the controlling license is GPLv2+. (In particular all the RedHat contributions are GPLv2+, not SoftFloat-2a...)

Actually, all four of us (I and Avi and Juan and Luiz) acked the change, so Red Hat contributions are SoftFloat-2a.

You said
# All Red Hat contributions (at least Avi, Juan, me; don't know about rth)

Quoted 8 lines
# are available under GPLv2+; also other authors agreed on it.  For this
# particular license,
# Acked-by: Paolo Bonzini <[email protected]>

and Juan said:
# As said by paolo, any contribution by me is under GPLv2+ O:-)

which I took to mean that the RH contribs were GPLv2+, not SF2a.

I was not counting rth, because I don't know what he did on company time and what he did on his own, and he's not on the virt team too.

rth and Avi agreed on SoftFloat-2a license separately.

Juan was the only one to reply to my message above, and his reply
http://lists.gnu.org/archive/html/qemu-devel/2013-04/msg05849.html is somewhat contradictory; he mentions GPLv2 but his explicit Acked-by was below my own Acked-by "for this particular license". I took that as a SoftFloat-2a ack too when I reviewed the commits and threads this morning.

But...

Quoted 4 lines

Anyway, we can make the future-changes license sf2a regardless of what license the RH contribs in the past are under (we have the non-SF2a BSD contribs as well so the license of the whole file is never going to be a single simple thing).

... this is true anyway.

Paolo

#17 lore raw
Quoted 8 lines · Paolo Bonzini
Quoted 7 lines · Peter Maydell

On 7 January 2015 at 11:04, Paolo Bonzini <[email protected]> wrote:
You said
# All Red Hat contributions (at least Avi, Juan, me; don't know about rth)

# are available under GPLv2+; also other authors agreed on it.  For this
# particular license,
# Acked-by: Paolo Bonzini <[email protected]>
Quoted 7 lines
Quoted 4 lines

and Juan said:
# As said by paolo, any contribution by me is under GPLv2+ O:-)

which I took to mean that the RH contribs were GPLv2+, not SF2a.

I was not counting rth, because I don't know what he did on company time and what he did on his own, and he's not on the virt team too.

Right, but I assumed when you said "this particular license" you meant GPLv2+, not SF2a...

-- PMM

#18 lore raw
Quoted 8 lines · Peter Maydell
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

# All Red Hat contributions (at least Avi, Juan, me; don't know about rth)

# are available under GPLv2+; also other authors agreed on it.  For this
# particular license,
# Acked-by: Paolo Bonzini <[email protected]>

and Juan said:
# As said by paolo, any contribution by me is under GPLv2+ O:-)

Quoted 6 lines
Quoted 4 lines
Quoted 4 lines
Quoted 1 line
Quoted 1 line

which I took to mean that the RH contribs were GPLv2+, not SF2a.

I was not counting rth, because I don't know what he did on company time and what he did on his own, and he's not on the virt team too.

Right, but I assumed when you said "this particular license" you meant GPLv2+, not SF2a...

Ah... For extra clarity what I meant was "strictly speaking RH contributors except possibly rth already have relicensed all their QEMU contributions under a license that is compatible with the rest of QEMU; but I am also okay with SF2a.

Paolo

#19 lore raw
In reply to Peter Maydell
Quoted 10 lines · Peter Maydell
Quoted 7 lines · Paolo Bonzini
Quoted 2 lines · Peter Maydell

* should we squash the revert and reimplement patches together? (avoids bisection break but makes the revert-and-reimplement less clear)

I think we can do that, provided the reimplemented functions are in different places than the originals, so that the revert-and-reimplement is still clear from the diff.

OK. I'll make sure I do that with the next version.

Having tried it, this is pretty straightforward for the uint64_to_* functions, but the SNAN_BIT_IS_ONE code doesn't work out so nicely, because it's removing and reimplementing a lot of #ifdefs inside functions, rather than whole functions. We could squash together for the commits to master but leave the split commits in the tarball archive?

-- PMM

#20 lore raw
Quoted 11 lines · Peter Maydell
Quoted 5 lines
Quoted 5 lines
Quoted 3 lines
Quoted 3 lines

I think we can do that, provided the reimplemented functions are in different places than the originals, so that the revert-and-reimplement is still clear from the diff.

OK. I'll make sure I do that with the next version.

Having tried it, this is pretty straightforward for the uint64_to_* functions, but the SNAN_BIT_IS_ONE code doesn't work out so nicely, because it's removing and reimplementing a lot of #ifdefs inside functions, rather than whole functions. We could squash together for the commits to master but leave the split commits in the tarball archive?

Sure.

Paolo