author | Stefan Vogel <sv@exept.de> |
Fri, 22 Nov 2019 10:16:43 +0100 | |
changeset 5269 | 83163a7005f1 |
parent 5268 | d3a464884f60 |
child 5276 | b81062a163d4 |
permissions | -rw-r--r-- |
5264 | 1 |
"{ Encoding: utf8 }" |
2 |
||
4983 | 3 |
"{ Package: 'stx:libbasic2' }" |
4 |
||
5 |
"{ NameSpace: Smalltalk }" |
|
6 |
||
7 |
LimitedPrecisionReal variableByteSubclass:#QuadFloat |
|
8 |
instanceVariableNames:'' |
|
9 |
classVariableNames:'QuadFloatZero QuadFloatOne Pi E Epsilon NaN PositiveInfinity |
|
5269
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
10 |
NegativeInfinity Halfpi HalfpiNegative Phi' |
4983 | 11 |
poolDictionaries:'' |
12 |
category:'Magnitude-Numbers' |
|
13 |
! |
|
14 |
||
4991 | 15 |
!QuadFloat primitiveDefinitions! |
16 |
%{ |
|
5269
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
17 |
#if __POINTER_SIZE__ == 8 |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
18 |
# define SUPPORT_QUADFLOAT |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
19 |
#endif |
5027 | 20 |
|
5269
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
21 |
#if defined(__MSBFIRST__) || defined(__MSB_FIRST__) || defined(MSBFIRST) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
22 |
# undef LITTLEENDIAN |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
23 |
#else |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
24 |
# define LITTLEENDIAN |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
25 |
#endif |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
26 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
27 |
#ifdef SUPPORT_QUADFLOAT |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
28 |
# include <stdint.h> |
4998 | 29 |
|
5269
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
30 |
// The following code is adapted from the Softfloat-3e package, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
31 |
// which includes the following license/copyright statement: |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
32 |
// |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
33 |
// License for Berkeley SoftFloat Release 3e |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
34 |
// |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
35 |
// John R. Hauser |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
36 |
// 2018 January 20 |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
37 |
// |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
38 |
// The following applies to the whole of SoftFloat Release 3e as well as to |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
39 |
// each source file individually. |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
40 |
// |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
41 |
// Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 The Regents of the |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
42 |
// University of California. All rights reserved. |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
43 |
// |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
44 |
// Redistribution and use in source and binary forms, with or without |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
45 |
// modification, are permitted provided that the following conditions are met: |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
46 |
// |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
47 |
// 1. Redistributions of source code must retain the above copyright notice, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
48 |
// this list of conditions, and the following disclaimer. |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
49 |
// |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
50 |
// 2. Redistributions in binary form must reproduce the above copyright |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
51 |
// notice, this list of conditions, and the following disclaimer in the |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
52 |
// documentation and/or other materials provided with the distribution. |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
53 |
// |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
54 |
// 3. Neither the name of the University nor the names of its contributors |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
55 |
// may be used to endorse or promote products derived from this software |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
56 |
// without specific prior written permission. |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
57 |
// |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
58 |
// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
59 |
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
60 |
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
61 |
// DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
62 |
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
63 |
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
64 |
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
65 |
// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
66 |
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
67 |
// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
68 |
// |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
69 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
70 |
/*---------------------------------------------------------------------------- |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
71 |
| Software floating-point underflow tininess-detection mode. |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
72 |
*----------------------------------------------------------------------------*/ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
73 |
enum { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
74 |
softfloat_tininess_beforeRounding = 0, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
75 |
softfloat_tininess_afterRounding = 1 |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
76 |
}; |
5013 | 77 |
|
5269
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
78 |
/*---------------------------------------------------------------------------- |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
79 |
| Software floating-point exception flags. |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
80 |
*----------------------------------------------------------------------------*/ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
81 |
enum { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
82 |
softfloat_flag_inexact = 1, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
83 |
softfloat_flag_underflow = 2, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
84 |
softfloat_flag_overflow = 4, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
85 |
softfloat_flag_infinite = 8, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
86 |
softfloat_flag_invalid = 16 |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
87 |
}; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
88 |
/*---------------------------------------------------------------------------- |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
89 |
| Software floating-point rounding mode. (Mode "odd" is supported only if |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
90 |
| SoftFloat is compiled with macro 'SOFTFLOAT_ROUND_ODD' defined.) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
91 |
*----------------------------------------------------------------------------*/ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
92 |
enum { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
93 |
softfloat_round_near_even = 0, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
94 |
softfloat_round_minMag = 1, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
95 |
softfloat_round_min = 2, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
96 |
softfloat_round_max = 3, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
97 |
softfloat_round_near_maxMag = 4, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
98 |
softfloat_round_odd = 6 |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
99 |
}; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
100 |
#define init_detectTininess softfloat_tininess_afterRounding |
4992 | 101 |
|
5269
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
102 |
typedef unsigned char bool; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
103 |
typedef double float64_t; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
104 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
105 |
#if defined(LITTLEENDIAN) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
106 |
struct uint128 { uint64_t v0, v64; }; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
107 |
struct uint64_extra { uint64_t extra, v; }; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
108 |
struct uint128_extra { uint64_t extra; struct uint128 v; }; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
109 |
struct extFloat80M { uint64_t signif; uint16_t signExp; }; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
110 |
#else |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
111 |
struct uint128 { uint64_t v64, v0; }; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
112 |
struct uint64_extra { uint64_t v, extra; }; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
113 |
struct uint128_extra { struct uint128 v; uint64_t extra; }; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
114 |
struct extFloat80M { uint16_t signExp; uint64_t signif; }; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
115 |
#endif |
4992 | 116 |
|
5269
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
117 |
union ui64_f64 { uint64_t ui; float64_t f; }; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
118 |
union ui128_f128 { struct uint128 ui; float128_t f; }; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
119 |
struct exp32_sig128 { int_fast32_t exp; struct uint128 sig; }; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
120 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
121 |
typedef struct extFloat80M extFloat80_t; |
4992 | 122 |
|
5269
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
123 |
/*---------------------------------------------------------------------------- |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
124 |
| The bit pattern for a default generated 128-bit floating-point NaN. |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
125 |
*----------------------------------------------------------------------------*/ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
126 |
#define defaultNaNF128UI96_32 0xFFFF8000 |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
127 |
#define defaultNaNF128UI64_32 0 |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
128 |
#define defaultNaNF128UI32_32 0 |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
129 |
#define defaultNaNF128UI0_32 0 |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
130 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
131 |
// #define defaultNaNF128UI64_64 UINT64_C( 0x7FFF800000000000 ) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
132 |
// #define defaultNaNF128UI0_64 UINT64_C( 0 ) |
5014 | 133 |
|
5269
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
134 |
/*---------------------------------------------------------------------------- |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
135 |
| The bit pattern for a default generated 128-bit floating-point +INF. |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
136 |
*----------------------------------------------------------------------------*/ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
137 |
#define defaultPInfF128UI96_32 0x7FFF0000 |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
138 |
#define defaultPInfF128UI64_32 0 |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
139 |
#define defaultPInfF128UI32_32 0 |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
140 |
#define defaultPInfF128UI0_32 0 |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
141 |
/*---------------------------------------------------------------------------- |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
142 |
| The bit pattern for a default generated 128-bit floating-point -INF. |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
143 |
*----------------------------------------------------------------------------*/ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
144 |
#define defaultNInfF128UI96_32 0xFFFF0000 |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
145 |
#define defaultNInfF128UI64_32 0 |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
146 |
#define defaultNInfF128UI32_32 0 |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
147 |
#define defaultNInfF128UI0_32 0 |
4992 | 148 |
|
5269
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
149 |
struct commonNaN { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
150 |
bool sign; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
151 |
#ifdef LITTLEENDIAN |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
152 |
uint64_t v0, v64; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
153 |
#else |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
154 |
uint64_t v64, v0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
155 |
#endif |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
156 |
}; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
157 |
struct exp16_sig64 { int_fast16_t exp; uint_fast64_t sig; }; |
5266 | 158 |
|
5269
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
159 |
#endif // SUPPORT_QUADFLOAT |
4993 | 160 |
|
4992 | 161 |
%} |
162 |
! ! |
|
163 |
||
164 |
!QuadFloat primitiveVariables! |
|
5267 | 165 |
%{ |
5269
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
166 |
#ifdef SUPPORT_QUADFLOAT |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
167 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
168 |
uint_fast8_t softfloat_exceptionFlags; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
169 |
uint_fast8_t softfloat_roundingMode = softfloat_round_near_even; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
170 |
uint_fast8_t softfloat_detectTininess = init_detectTininess; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
171 |
uint_fast8_t softfloat_exceptionFlags = 0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
172 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
173 |
const uint_least8_t softfloat_countLeadingZeros8[256] = { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
174 |
8, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
175 |
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
176 |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
177 |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
178 |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
179 |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
180 |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
181 |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
182 |
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
183 |
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
184 |
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
185 |
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
186 |
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
187 |
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
188 |
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
189 |
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
190 |
}; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
191 |
#endif // SUPPORT_QUADFLOAT |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
192 |
|
5267 | 193 |
%} |
4991 | 194 |
! ! |
195 |
||
4992 | 196 |
!QuadFloat primitiveFunctions! |
5267 | 197 |
%{ |
5269
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
198 |
#ifdef SUPPORT_QUADFLOAT |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
199 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
200 |
#if defined(LITTLEENDIAN) || defined(__LSBFIRST__) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
201 |
#define wordIncr 1 |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
202 |
#define indexWord( total, n ) (n) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
203 |
#define indexWordHi( total ) ((total) - 1) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
204 |
#define indexWordLo( total ) 0 |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
205 |
#define indexMultiword( total, m, n ) (n) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
206 |
#define indexMultiwordHi( total, n ) ((total) - (n)) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
207 |
#define indexMultiwordLo( total, n ) 0 |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
208 |
#define indexMultiwordHiBut( total, n ) (n) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
209 |
#define indexMultiwordLoBut( total, n ) 0 |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
210 |
#define INIT_UINTM4( v3, v2, v1, v0 ) { v0, v1, v2, v3 } |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
211 |
#else |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
212 |
#define wordIncr -1 |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
213 |
#define indexWord( total, n ) ((total) - 1 - (n)) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
214 |
#define indexWordHi( total ) 0 |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
215 |
#define indexWordLo( total ) ((total) - 1) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
216 |
#define indexMultiword( total, m, n ) ((total) - 1 - (m)) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
217 |
#define indexMultiwordHi( total, n ) 0 |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
218 |
#define indexMultiwordLo( total, n ) ((total) - (n)) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
219 |
#define indexMultiwordHiBut( total, n ) 0 |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
220 |
#define indexMultiwordLoBut( total, n ) (n) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
221 |
#define INIT_UINTM4( v3, v2, v1, v0 ) { v3, v2, v1, v0 } |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
222 |
#endif |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
223 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
224 |
#define signF64UI( a ) ((bool) ((uint64_t) (a)>>63)) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
225 |
#define expF64UI( a ) ((int_fast16_t) ((a)>>52) & 0x7FF) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
226 |
#define fracF64UI( a ) ((a) & UINT64_C( 0x000FFFFFFFFFFFFF )) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
227 |
#define softfloat_f64UIToCommonNaN( uiA, zPtr ) if ( ! ((uiA) & UINT64_C( 0x0008000000000000 )) ) softfloat_raiseFlags( softfloat_flag_invalid ) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
228 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
229 |
#define signF128UI64( a64 ) ((bool) ((uint64_t) (a64)>>63)) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
230 |
#define expF128UI64( a64 ) ((int_fast32_t) ((a64)>>48) & 0x7FFF) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
231 |
#define fracF128UI64( a64 ) ((a64) & UINT64_C( 0x0000FFFFFFFFFFFF )) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
232 |
#define packToF128UI64( sign, exp, sig64 ) (((uint_fast64_t) (sign)<<63) + ((uint_fast64_t) (exp)<<48) + (sig64)) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
233 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
234 |
#define signF128UI96( a96 ) ((bool) ((uint32_t) (a96)>>31)) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
235 |
#define expF128UI96( a96 ) ((int32_t) ((a96)>>16) & 0x7FFF) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
236 |
#define fracF128UI96( a96 ) ((a96) & 0x0000FFFF) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
237 |
#define packToF128UI96( sign, exp, sig96 ) (((uint32_t) (sign)<<31) + ((uint32_t) (exp)<<16) + (sig96)) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
238 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
239 |
#define isNaNF128UI( a64, a0 ) (((~(a64) & UINT64_C( 0x7FFF000000000000 )) == 0) && (a0 || ((a64) & UINT64_C( 0x0000FFFFFFFFFFFF )))) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
240 |
#define softfloat_isSigNaNF128UI( uiA64, uiA0 ) ((((uiA64) & UINT64_C( 0x7FFF800000000000 )) == UINT64_C( 0x7FFF000000000000 )) && ((uiA0) || ((uiA64) & UINT64_C( 0x00007FFFFFFFFFFF )))) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
241 |
#define softfloat_approxRecip32_1( a ) ((uint32_t) (UINT64_C( 0x7FFFFFFFFFFFFFFF ) / (uint32_t) (a))) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
242 |
#define isInfF128UI( a64, a0 ) (((a64) & UINT64_C(0x7FFF800000000000)) == UINT64_C(0x7FFF000000000000)) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
243 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
244 |
#define signExtF80UI64( a64 ) ((bool) ((uint16_t) (a64)>>15)) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
245 |
#define expExtF80UI64( a64 ) ((a64) & 0x7FFF) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
246 |
#define packToExtF80UI64( sign, exp ) ((uint_fast16_t) (sign)<<15 | (exp)) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
247 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
248 |
#define isNaNExtF80UI( a64, a0 ) ((((a64) & 0x7FFF) == 0x7FFF) && ((a0) & UINT64_C( 0x7FFFFFFFFFFFFFFF ))) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
249 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
250 |
/*---------------------------------------------------------------------------- |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
251 |
| This function or macro is the same as 'softfloat_shortShiftLeftM' with |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
252 |
| 'size_words' = 5 (N = 160). |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
253 |
*----------------------------------------------------------------------------*/ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
254 |
#define softfloat_shortShiftLeft160M( aPtr, dist, zPtr ) softfloat_shortShiftLeftM( 5, aPtr, dist, zPtr ) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
255 |
/*---------------------------------------------------------------------------- |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
256 |
| This function or macro is the same as 'softfloat_shiftRightJamM' with |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
257 |
| 'size_words' = 5 (N = 160). |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
258 |
*----------------------------------------------------------------------------*/ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
259 |
#define softfloat_shiftRightJam160M( aPtr, dist, zPtr ) softfloat_shiftRightJamM( 5, aPtr, dist, zPtr ) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
260 |
/*---------------------------------------------------------------------------- |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
261 |
| This function or macro is the same as 'softfloat_shortShiftLeftM' with |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
262 |
| 'size_words' = 4 (N = 128). |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
263 |
*----------------------------------------------------------------------------*/ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
264 |
#define softfloat_shortShiftLeft128M( aPtr, dist, zPtr ) softfloat_shortShiftLeftM( 4, aPtr, dist, zPtr ) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
265 |
/*---------------------------------------------------------------------------- |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
266 |
| This function or macro is the same as 'softfloat_shortShiftLeftM' with |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
267 |
| 'size_words' = 3 (N = 96). |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
268 |
*----------------------------------------------------------------------------*/ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
269 |
#define softfloat_shortShiftLeft96M( aPtr, dist, zPtr ) softfloat_shortShiftLeftM( 3, aPtr, dist, zPtr ) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
270 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
271 |
static inline void |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
272 |
softfloat_raiseFlags( uint_fast8_t flags ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
273 |
softfloat_exceptionFlags |= flags; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
274 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
275 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
276 |
#if 1 |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
277 |
static inline void |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
278 |
softfloat_commonNaNToF128M( uint32_t *zWPtr ) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
279 |
{ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
280 |
zWPtr[indexWord( 4, 3 )] = defaultNaNF128UI96_32; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
281 |
zWPtr[indexWord( 4, 2 )] = defaultNaNF128UI64_32; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
282 |
zWPtr[indexWord( 4, 1 )] = defaultNaNF128UI32_32; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
283 |
zWPtr[indexWord( 4, 0 )] = defaultNaNF128UI0_32; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
284 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
285 |
#else |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
286 |
# define softfloat_commonNaNToF128M( zWPtr ) \ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
287 |
{ \ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
288 |
(zWPtr)[indexWord( 4, 3 )] = defaultNaNF128UI96_32; \ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
289 |
(zWPtr)[indexWord( 4, 2 )] = defaultNaNF128UI64_32; \ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
290 |
(zWPtr)[indexWord( 4, 1 )] = defaultNaNF128UI32_32; \ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
291 |
(zWPtr)[indexWord( 4, 0 )] = defaultNaNF128UI0_32; \ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
292 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
293 |
#endif |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
294 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
295 |
/*---------------------------------------------------------------------------- |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
296 |
| Assuming the unsigned integer formed from concatenating 'uiA64' and 'uiA0' |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
297 |
| has the bit pattern of an 80-bit extended floating-point NaN, converts |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
298 |
| this NaN to the common NaN form, and stores the resulting common NaN at the |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
299 |
| location pointed to by 'zPtr'. If the NaN is a signaling NaN, the invalid |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
300 |
| exception is raised. |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
301 |
*----------------------------------------------------------------------------*/ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
302 |
#define softfloat_extF80UIToCommonNaN( uiA64, uiA0, zPtr ) if ( ! ((uiA0) & UINT64_C( 0x4000000000000000 )) ) softfloat_raiseFlags( softfloat_flag_invalid ) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
303 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
304 |
static inline void |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
305 |
softfloat_invalidF128M( uint32_t *zWPtr ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
306 |
softfloat_raiseFlags( softfloat_flag_invalid ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
307 |
softfloat_commonNaNToF128M( zWPtr ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
308 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
309 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
310 |
static bool |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
311 |
f128M_isSignalingNaN( const float128_t *aPtr ) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
312 |
{ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
313 |
const uint32_t *aWPtr; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
314 |
uint32_t uiA96; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
315 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
316 |
aWPtr = (const uint32_t *) aPtr; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
317 |
uiA96 = aWPtr[indexWordHi( 4 )]; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
318 |
if ( (uiA96 & 0x7FFF8000) != 0x7FFF0000 ) return 0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
319 |
return |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
320 |
((uiA96 & 0x00007FFF) != 0) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
321 |
|| ((aWPtr[indexWord( 4, 2 )] | aWPtr[indexWord( 4, 1 )] |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
322 |
| aWPtr[indexWord( 4, 0 )]) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
323 |
!= 0); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
324 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
325 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
326 |
static void |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
327 |
softfloat_shortShiftRightJamM( |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
328 |
uint_fast8_t size_words, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
329 |
const uint32_t *aPtr, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
330 |
uint_fast8_t dist, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
331 |
uint32_t *zPtr |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
332 |
) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
333 |
{ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
334 |
uint_fast8_t uNegDist; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
335 |
unsigned int index, lastIndex; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
336 |
uint32_t partWordZ, wordA; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
337 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
338 |
uNegDist = -dist; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
339 |
index = indexWordLo( size_words ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
340 |
lastIndex = indexWordHi( size_words ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
341 |
wordA = aPtr[index]; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
342 |
partWordZ = wordA>>dist; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
343 |
if ( partWordZ<<dist != wordA ) partWordZ |= 1; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
344 |
while ( index != lastIndex ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
345 |
wordA = aPtr[index + wordIncr]; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
346 |
zPtr[index] = wordA<<(uNegDist & 31) | partWordZ; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
347 |
index += wordIncr; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
348 |
partWordZ = wordA>>dist; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
349 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
350 |
zPtr[index] = partWordZ; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
351 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
352 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
353 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
354 |
void |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
355 |
softfloat_shiftRightJamM( |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
356 |
uint_fast8_t size_words, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
357 |
const uint32_t *aPtr, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
358 |
uint32_t dist, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
359 |
uint32_t *zPtr |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
360 |
) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
361 |
{ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
362 |
uint32_t wordJam, wordDist, *ptr; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
363 |
uint_fast8_t i, innerDist; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
364 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
365 |
wordJam = 0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
366 |
wordDist = dist>>5; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
367 |
if ( wordDist ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
368 |
if ( size_words < wordDist ) wordDist = size_words; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
369 |
ptr = (uint32_t *) (aPtr + indexMultiwordLo( size_words, wordDist )); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
370 |
i = wordDist; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
371 |
do { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
372 |
wordJam = *ptr++; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
373 |
if ( wordJam ) break; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
374 |
--i; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
375 |
} while ( i ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
376 |
ptr = zPtr; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
377 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
378 |
if ( wordDist < size_words ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
379 |
aPtr += indexMultiwordHiBut( size_words, wordDist ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
380 |
innerDist = dist & 31; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
381 |
if ( innerDist ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
382 |
softfloat_shortShiftRightJamM( |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
383 |
size_words - wordDist, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
384 |
aPtr, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
385 |
innerDist, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
386 |
(zPtr + indexMultiwordLoBut( size_words, wordDist )) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
387 |
); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
388 |
if ( ! wordDist ) goto wordJam; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
389 |
} else { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
390 |
aPtr += indexWordLo( size_words - wordDist ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
391 |
ptr = zPtr + indexWordLo( size_words ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
392 |
for ( i = size_words - wordDist; i; --i ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
393 |
*ptr = *aPtr; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
394 |
aPtr += wordIncr; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
395 |
ptr += wordIncr; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
396 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
397 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
398 |
ptr = zPtr + indexMultiwordHi( size_words, wordDist ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
399 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
400 |
do { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
401 |
*ptr++ = 0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
402 |
--wordDist; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
403 |
} while ( wordDist ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
404 |
wordJam: |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
405 |
if ( wordJam ) zPtr[indexWordLo( size_words )] |= 1; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
406 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
407 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
408 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
409 |
void |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
410 |
softfloat_shortShiftLeftM( |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
411 |
uint_fast8_t size_words, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
412 |
const uint32_t *aPtr, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
413 |
uint_fast8_t dist, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
414 |
uint32_t *zPtr |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
415 |
) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
416 |
{ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
417 |
uint_fast8_t uNegDist; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
418 |
unsigned int index, lastIndex; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
419 |
uint32_t partWordZ, wordA; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
420 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
421 |
uNegDist = -dist; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
422 |
index = indexWordHi( size_words ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
423 |
lastIndex = indexWordLo( size_words ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
424 |
partWordZ = aPtr[index]<<dist; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
425 |
while ( index != lastIndex ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
426 |
wordA = aPtr[index - wordIncr]; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
427 |
zPtr[index] = partWordZ | wordA>>(uNegDist & 31); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
428 |
index -= wordIncr; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
429 |
partWordZ = wordA<<dist; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
430 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
431 |
zPtr[index] = partWordZ; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
432 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
433 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
434 |
static void |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
435 |
softfloat_shiftLeftM( |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
436 |
uint_fast8_t size_words, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
437 |
const uint32_t *aPtr, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
438 |
uint32_t dist, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
439 |
uint32_t *zPtr |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
440 |
) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
441 |
{ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
442 |
uint32_t wordDist; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
443 |
uint_fast8_t innerDist; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
444 |
uint32_t *destPtr; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
445 |
uint_fast8_t i; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
446 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
447 |
wordDist = dist>>5; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
448 |
if ( wordDist < size_words ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
449 |
aPtr += indexMultiwordLoBut( size_words, wordDist ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
450 |
innerDist = dist & 31; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
451 |
if ( innerDist ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
452 |
softfloat_shortShiftLeftM( |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
453 |
size_words - wordDist, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
454 |
aPtr, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
455 |
innerDist, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
456 |
zPtr + indexMultiwordHiBut( size_words, wordDist ) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
457 |
); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
458 |
if ( ! wordDist ) return; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
459 |
} else { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
460 |
aPtr += indexWordHi( size_words - wordDist ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
461 |
destPtr = zPtr + indexWordHi( size_words ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
462 |
for ( i = size_words - wordDist; i; --i ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
463 |
*destPtr = *aPtr; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
464 |
aPtr -= wordIncr; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
465 |
destPtr -= wordIncr; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
466 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
467 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
468 |
zPtr += indexMultiwordLo( size_words, wordDist ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
469 |
} else { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
470 |
wordDist = size_words; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
471 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
472 |
do { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
473 |
*zPtr++ = 0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
474 |
--wordDist; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
475 |
} while ( wordDist ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
476 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
477 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
478 |
/*---------------------------------------------------------------------------- |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
479 |
| This function or macro is the same as 'softfloat_shiftLeftM' with |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
480 |
| 'size_words' = 4 (N = 128). |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
481 |
*----------------------------------------------------------------------------*/ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
482 |
#define softfloat_shiftLeft128M( aPtr, dist, zPtr ) softfloat_shiftLeftM( 4, aPtr, dist, zPtr ) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
483 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
484 |
bool |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
485 |
softfloat_isNaNF128M( const uint32_t *aWPtr ) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
486 |
{ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
487 |
uint32_t uiA96; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
488 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
489 |
uiA96 = aWPtr[indexWordHi( 4 )]; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
490 |
if ( (~uiA96 & 0x7FFF0000) != 0 ) return 0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
491 |
return |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
492 |
((uiA96 & 0x0000FFFF) != 0) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
493 |
|| ((aWPtr[indexWord( 4, 2 )] | aWPtr[indexWord( 4, 1 )] |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
494 |
| aWPtr[indexWord( 4, 0 )]) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
495 |
!= 0); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
496 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
497 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
498 |
static inline uint_fast8_t |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
499 |
softfloat_countLeadingZeros32( uint32_t a ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
500 |
return a ? __builtin_clz( a ) : 32; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
501 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
502 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
503 |
static inline bool |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
504 |
softfloat_eq128( uint64_t a64, uint64_t a0, uint64_t b64, uint64_t b0 ){ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
505 |
return (a64 == b64) && (a0 == b0); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
506 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
507 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
508 |
static inline bool |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
509 |
softfloat_lt128( uint64_t a64, uint64_t a0, uint64_t b64, uint64_t b0 ){ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
510 |
return (a64 < b64) || ((a64 == b64) && (a0 < b0)); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
511 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
512 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
513 |
static inline bool |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
514 |
softfloat_le128( uint64_t a64, uint64_t a0, uint64_t b64, uint64_t b0 ){ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
515 |
return (a64 < b64) || ((a64 == b64) && (a0 <= b0)); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
516 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
517 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
518 |
void |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
519 |
softfloat_propagateNaNF128M( |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
520 |
const uint32_t *aWPtr, const uint32_t *bWPtr, uint32_t *zWPtr ) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
521 |
{ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
522 |
bool isSigNaNA; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
523 |
const uint32_t *ptr; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
524 |
bool isSigNaNB; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
525 |
uint32_t uiA96, uiB96, wordMagA, wordMagB; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
526 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
527 |
isSigNaNA = f128M_isSignalingNaN( (const float128_t *) aWPtr ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
528 |
ptr = aWPtr; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
529 |
if ( ! bWPtr ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
530 |
if ( isSigNaNA ) softfloat_raiseFlags( softfloat_flag_invalid ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
531 |
goto copy; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
532 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
533 |
isSigNaNB = f128M_isSignalingNaN( (const float128_t *) bWPtr ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
534 |
if ( isSigNaNA | isSigNaNB ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
535 |
softfloat_raiseFlags( softfloat_flag_invalid ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
536 |
if ( isSigNaNA ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
537 |
if ( isSigNaNB ) goto returnLargerUIMag; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
538 |
if ( softfloat_isNaNF128M( bWPtr ) ) goto copyB; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
539 |
goto copy; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
540 |
} else { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
541 |
if ( softfloat_isNaNF128M( aWPtr ) ) goto copy; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
542 |
goto copyB; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
543 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
544 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
545 |
returnLargerUIMag: |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
546 |
uiA96 = aWPtr[indexWordHi( 4 )]; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
547 |
uiB96 = bWPtr[indexWordHi( 4 )]; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
548 |
wordMagA = uiA96 & 0x7FFFFFFF; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
549 |
wordMagB = uiB96 & 0x7FFFFFFF; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
550 |
if ( wordMagA < wordMagB ) goto copyB; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
551 |
if ( wordMagB < wordMagA ) goto copy; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
552 |
wordMagA = aWPtr[indexWord( 4, 2 )]; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
553 |
wordMagB = bWPtr[indexWord( 4, 2 )]; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
554 |
if ( wordMagA < wordMagB ) goto copyB; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
555 |
if ( wordMagB < wordMagA ) goto copy; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
556 |
wordMagA = aWPtr[indexWord( 4, 1 )]; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
557 |
wordMagB = bWPtr[indexWord( 4, 1 )]; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
558 |
if ( wordMagA < wordMagB ) goto copyB; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
559 |
if ( wordMagB < wordMagA ) goto copy; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
560 |
wordMagA = aWPtr[indexWord( 4, 0 )]; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
561 |
wordMagB = bWPtr[indexWord( 4, 0 )]; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
562 |
if ( wordMagA < wordMagB ) goto copyB; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
563 |
if ( wordMagB < wordMagA ) goto copy; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
564 |
if ( uiA96 < uiB96 ) goto copy; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
565 |
copyB: |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
566 |
ptr = bWPtr; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
567 |
copy: |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
568 |
zWPtr[indexWordHi( 4 )] = ptr[indexWordHi( 4 )] | 0x00008000; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
569 |
zWPtr[indexWord( 4, 2 )] = ptr[indexWord( 4, 2 )]; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
570 |
zWPtr[indexWord( 4, 1 )] = ptr[indexWord( 4, 1 )]; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
571 |
zWPtr[indexWord( 4, 0 )] = ptr[indexWord( 4, 0 )]; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
572 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
573 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
574 |
static inline uint_fast8_t |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
575 |
softfloat_countLeadingZeros64( uint64_t a ) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
576 |
{ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
577 |
uint_fast8_t count; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
578 |
uint32_t a32; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
579 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
580 |
count = 0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
581 |
a32 = a>>32; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
582 |
if ( ! a32 ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
583 |
count = 32; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
584 |
a32 = a; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
585 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
586 |
/*------------------------------------------------------------------------ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
587 |
| From here, result is current count + count leading zeros of `a32'. |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
588 |
*------------------------------------------------------------------------*/ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
589 |
if ( a32 < 0x10000 ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
590 |
count += 16; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
591 |
a32 <<= 16; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
592 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
593 |
if ( a32 < 0x1000000 ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
594 |
count += 8; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
595 |
a32 <<= 8; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
596 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
597 |
count += softfloat_countLeadingZeros8[a32>>24]; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
598 |
return count; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
599 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
600 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
601 |
static inline struct exp16_sig64 |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
602 |
softfloat_normSubnormalF64Sig( uint_fast64_t sig ) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
603 |
{ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
604 |
int_fast8_t shiftDist; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
605 |
struct exp16_sig64 z; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
606 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
607 |
shiftDist = softfloat_countLeadingZeros64( sig ) - 11; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
608 |
z.exp = 1 - shiftDist; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
609 |
z.sig = sig<<shiftDist; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
610 |
return z; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
611 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
612 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
613 |
static inline struct uint128_extra |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
614 |
softfloat_shiftRightJam128Extra( |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
615 |
uint64_t a64, uint64_t a0, uint64_t extra, uint_fast32_t dist ) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
616 |
{ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
617 |
uint_fast8_t u8NegDist; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
618 |
struct uint128_extra z; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
619 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
620 |
u8NegDist = -dist; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
621 |
if ( dist < 64 ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
622 |
z.v.v64 = a64>>dist; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
623 |
z.v.v0 = a64<<(u8NegDist & 63) | a0>>dist; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
624 |
z.extra = a0<<(u8NegDist & 63); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
625 |
} else { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
626 |
z.v.v64 = 0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
627 |
if ( dist == 64 ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
628 |
z.v.v0 = a64; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
629 |
z.extra = a0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
630 |
} else { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
631 |
extra |= a0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
632 |
if ( dist < 128 ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
633 |
z.v.v0 = a64>>(dist & 63); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
634 |
z.extra = a64<<(u8NegDist & 63); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
635 |
} else { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
636 |
z.v.v0 = 0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
637 |
z.extra = (dist == 128) ? a64 : (a64 != 0); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
638 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
639 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
640 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
641 |
z.extra |= (extra != 0); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
642 |
return z; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
643 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
644 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
645 |
static inline struct uint128_extra |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
646 |
softfloat_shortShiftRightJam128Extra( |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
647 |
uint64_t a64, uint64_t a0, uint64_t extra, uint_fast8_t dist ) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
648 |
{ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
649 |
uint_fast8_t negDist = -dist; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
650 |
struct uint128_extra z; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
651 |
z.v.v64 = a64>>dist; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
652 |
z.v.v0 = a64<<(negDist & 63) | a0>>dist; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
653 |
z.extra = a0<<(negDist & 63) | (extra != 0); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
654 |
return z; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
655 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
656 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
657 |
static inline struct uint128 |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
658 |
softfloat_shiftRightJam128( uint64_t a64, uint64_t a0, uint_fast32_t dist ) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
659 |
{ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
660 |
uint_fast8_t u8NegDist; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
661 |
struct uint128 z; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
662 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
663 |
if ( dist < 64 ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
664 |
u8NegDist = -dist; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
665 |
z.v64 = a64>>dist; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
666 |
z.v0 = |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
667 |
a64<<(u8NegDist & 63) | a0>>dist |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
668 |
| ((uint64_t) (a0<<(u8NegDist & 63)) != 0); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
669 |
} else { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
670 |
z.v64 = 0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
671 |
z.v0 = |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
672 |
(dist < 127) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
673 |
? a64>>(dist & 63) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
674 |
| (((a64 & (((uint_fast64_t) 1<<(dist & 63)) - 1)) | a0) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
675 |
!= 0) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
676 |
: ((a64 | a0) != 0); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
677 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
678 |
return z; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
679 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
680 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
681 |
static inline struct uint128 |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
682 |
softfloat_shortShiftLeft128( uint64_t a64, uint64_t a0, uint_fast8_t dist ) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
683 |
{ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
684 |
struct uint128 z; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
685 |
z.v64 = a64<<dist | a0>>(-dist & 63); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
686 |
z.v0 = a0<<dist; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
687 |
return z; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
688 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
689 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
690 |
static int_fast8_t |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
691 |
softfloat_compare128M( const uint32_t *aPtr, const uint32_t *bPtr ) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
692 |
{ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
693 |
unsigned int index, lastIndex; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
694 |
uint32_t wordA, wordB; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
695 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
696 |
index = indexWordHi( 4 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
697 |
lastIndex = indexWordLo( 4 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
698 |
for (;;) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
699 |
wordA = aPtr[index]; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
700 |
wordB = bPtr[index]; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
701 |
if ( wordA != wordB ) return (wordA < wordB) ? -1 : 1; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
702 |
if ( index == lastIndex ) break; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
703 |
index -= wordIncr; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
704 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
705 |
return 0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
706 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
707 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
708 |
static void |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
709 |
softfloat_roundPackMToF128M( |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
710 |
bool sign, int32_t exp, uint32_t *extSigPtr, uint32_t *zWPtr ) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
711 |
{ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
712 |
uint_fast8_t roundingMode; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
713 |
bool roundNearEven; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
714 |
uint32_t sigExtra; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
715 |
bool doIncrement, isTiny; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
716 |
static const uint32_t maxSig[4] = |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
717 |
INIT_UINTM4( 0x0001FFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
718 |
uint32_t ui, uj; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
719 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
720 |
/*------------------------------------------------------------------------ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
721 |
*------------------------------------------------------------------------*/ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
722 |
roundingMode = softfloat_roundingMode; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
723 |
roundNearEven = (roundingMode == softfloat_round_near_even); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
724 |
sigExtra = extSigPtr[indexWordLo( 5 )]; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
725 |
doIncrement = (0x80000000 <= sigExtra); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
726 |
if ( ! roundNearEven && (roundingMode != softfloat_round_near_maxMag) ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
727 |
doIncrement = |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
728 |
(roundingMode |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
729 |
== (sign ? softfloat_round_min : softfloat_round_max)) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
730 |
&& sigExtra; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
731 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
732 |
/*------------------------------------------------------------------------ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
733 |
*------------------------------------------------------------------------*/ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
734 |
if ( 0x7FFD <= (uint32_t) exp ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
735 |
if ( exp < 0 ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
736 |
/*---------------------------------------------------------------- |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
737 |
*----------------------------------------------------------------*/ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
738 |
isTiny = |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
739 |
(softfloat_detectTininess |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
740 |
== softfloat_tininess_beforeRounding) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
741 |
|| (exp < -1) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
742 |
|| ! doIncrement |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
743 |
|| (softfloat_compare128M( |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
744 |
extSigPtr + indexMultiwordHi( 5, 4 ), maxSig ) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
745 |
< 0); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
746 |
softfloat_shiftRightJam160M( extSigPtr, -exp, extSigPtr ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
747 |
exp = 0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
748 |
sigExtra = extSigPtr[indexWordLo( 5 )]; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
749 |
if ( isTiny && sigExtra ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
750 |
softfloat_raiseFlags( softfloat_flag_underflow ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
751 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
752 |
doIncrement = (0x80000000 <= sigExtra); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
753 |
if ( |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
754 |
! roundNearEven |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
755 |
&& (roundingMode != softfloat_round_near_maxMag) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
756 |
) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
757 |
doIncrement = |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
758 |
(roundingMode |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
759 |
== (sign ? softfloat_round_min : softfloat_round_max)) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
760 |
&& sigExtra; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
761 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
762 |
} else if ( |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
763 |
(0x7FFD < exp) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
764 |
|| ((exp == 0x7FFD) && doIncrement |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
765 |
&& (softfloat_compare128M( |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
766 |
extSigPtr + indexMultiwordHi( 5, 4 ), maxSig ) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
767 |
== 0)) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
768 |
) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
769 |
/*---------------------------------------------------------------- |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
770 |
*----------------------------------------------------------------*/ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
771 |
softfloat_raiseFlags( |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
772 |
softfloat_flag_overflow | softfloat_flag_inexact ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
773 |
if ( |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
774 |
roundNearEven |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
775 |
|| (roundingMode == softfloat_round_near_maxMag) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
776 |
|| (roundingMode |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
777 |
== (sign ? softfloat_round_min : softfloat_round_max)) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
778 |
) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
779 |
ui = packToF128UI96( sign, 0x7FFF, 0 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
780 |
uj = 0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
781 |
} else { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
782 |
ui = packToF128UI96( sign, 0x7FFE, 0x0000FFFF ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
783 |
uj = 0xFFFFFFFF; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
784 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
785 |
zWPtr[indexWordHi( 4 )] = ui; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
786 |
zWPtr[indexWord( 4, 2 )] = uj; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
787 |
zWPtr[indexWord( 4, 1 )] = uj; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
788 |
zWPtr[indexWord( 4, 0 )] = uj; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
789 |
return; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
790 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
791 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
792 |
/*------------------------------------------------------------------------ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
793 |
*------------------------------------------------------------------------*/ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
794 |
uj = extSigPtr[indexWord( 5, 1 )]; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
795 |
if ( sigExtra ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
796 |
softfloat_exceptionFlags |= softfloat_flag_inexact; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
797 |
#ifdef SOFTFLOAT_ROUND_ODD |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
798 |
if ( roundingMode == softfloat_round_odd ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
799 |
uj |= 1; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
800 |
goto noIncrementPackReturn; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
801 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
802 |
#endif |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
803 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
804 |
if ( doIncrement ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
805 |
++uj; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
806 |
if ( uj ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
807 |
if ( ! (sigExtra & 0x7FFFFFFF) && roundNearEven ) uj &= ~1; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
808 |
zWPtr[indexWord( 4, 2 )] = extSigPtr[indexWord( 5, 3 )]; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
809 |
zWPtr[indexWord( 4, 1 )] = extSigPtr[indexWord( 5, 2 )]; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
810 |
zWPtr[indexWord( 4, 0 )] = uj; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
811 |
ui = extSigPtr[indexWordHi( 5 )]; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
812 |
} else { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
813 |
zWPtr[indexWord( 4, 0 )] = uj; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
814 |
ui = extSigPtr[indexWord( 5, 2 )] + 1; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
815 |
zWPtr[indexWord( 4, 1 )] = ui; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
816 |
uj = extSigPtr[indexWord( 5, 3 )]; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
817 |
if ( ui ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
818 |
zWPtr[indexWord( 4, 2 )] = uj; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
819 |
ui = extSigPtr[indexWordHi( 5 )]; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
820 |
} else { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
821 |
++uj; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
822 |
zWPtr[indexWord( 4, 2 )] = uj; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
823 |
ui = extSigPtr[indexWordHi( 5 )]; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
824 |
if ( ! uj ) ++ui; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
825 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
826 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
827 |
} else { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
828 |
noIncrementPackReturn: |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
829 |
zWPtr[indexWord( 4, 0 )] = uj; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
830 |
ui = extSigPtr[indexWord( 5, 2 )]; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
831 |
zWPtr[indexWord( 4, 1 )] = ui; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
832 |
uj |= ui; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
833 |
ui = extSigPtr[indexWord( 5, 3 )]; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
834 |
zWPtr[indexWord( 4, 2 )] = ui; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
835 |
uj |= ui; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
836 |
ui = extSigPtr[indexWordHi( 5 )]; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
837 |
uj |= ui; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
838 |
if ( ! uj ) exp = 0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
839 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
840 |
zWPtr[indexWordHi( 4 )] = packToF128UI96( sign, exp, ui ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
841 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
842 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
843 |
static int |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
844 |
softfloat_shiftNormSigF128M( |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
845 |
const uint32_t *wPtr, uint_fast8_t shiftDist, uint32_t *sigPtr ) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
846 |
{ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
847 |
uint32_t wordSig; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
848 |
int32_t exp; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
849 |
uint32_t leadingBit; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
850 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
851 |
wordSig = wPtr[indexWordHi( 4 )]; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
852 |
exp = expF128UI96( wordSig ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
853 |
if ( exp ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
854 |
softfloat_shortShiftLeft128M( wPtr, shiftDist, sigPtr ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
855 |
leadingBit = 0x00010000<<shiftDist; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
856 |
sigPtr[indexWordHi( 4 )] = |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
857 |
(sigPtr[indexWordHi( 4 )] & (leadingBit - 1)) | leadingBit; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
858 |
} else { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
859 |
exp = 16; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
860 |
wordSig &= 0x7FFFFFFF; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
861 |
if ( ! wordSig ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
862 |
exp = -16; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
863 |
wordSig = wPtr[indexWord( 4, 2 )]; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
864 |
if ( ! wordSig ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
865 |
exp = -48; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
866 |
wordSig = wPtr[indexWord( 4, 1 )]; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
867 |
if ( ! wordSig ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
868 |
wordSig = wPtr[indexWord( 4, 0 )]; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
869 |
if ( ! wordSig ) return -128; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
870 |
exp = -80; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
871 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
872 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
873 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
874 |
exp -= softfloat_countLeadingZeros32( wordSig ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
875 |
softfloat_shiftLeft128M( wPtr, 1 - exp + shiftDist, sigPtr ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
876 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
877 |
return exp; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
878 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
879 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
880 |
bool |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
881 |
softfloat_tryPropagateNaNF128M( |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
882 |
const uint32_t *aWPtr, const uint32_t *bWPtr, uint32_t *zWPtr ) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
883 |
{ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
884 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
885 |
if ( softfloat_isNaNF128M( aWPtr ) || softfloat_isNaNF128M( bWPtr ) ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
886 |
softfloat_propagateNaNF128M( aWPtr, bWPtr, zWPtr ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
887 |
return 1; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
888 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
889 |
return 0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
890 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
891 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
892 |
static inline struct uint128 |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
893 |
softfloat_add128( uint64_t a64, uint64_t a0, uint64_t b64, uint64_t b0 ) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
894 |
{ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
895 |
struct uint128 z; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
896 |
z.v0 = a0 + b0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
897 |
z.v64 = a64 + b64 + (z.v0 < a0); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
898 |
return z; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
899 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
900 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
901 |
static inline struct uint128 |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
902 |
softfloat_sub128( uint64_t a64, uint64_t a0, uint64_t b64, uint64_t b0 ) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
903 |
{ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
904 |
struct uint128 z; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
905 |
z.v0 = a0 - b0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
906 |
z.v64 = a64 - b64; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
907 |
z.v64 -= (a0 < b0); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
908 |
return z; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
909 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
910 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
911 |
static inline struct uint128 |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
912 |
softfloat_mul128By32( uint64_t a64, uint64_t a0, uint32_t b ) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
913 |
{ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
914 |
union { unsigned __int128 ui; struct uint128 s; } uZ; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
915 |
uZ.ui = ((unsigned __int128) a64<<64 | a0) * b; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
916 |
return uZ.s; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
917 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
918 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
919 |
static void |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
920 |
softfloat_mul128MTo256M( |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
921 |
const uint32_t *aPtr, const uint32_t *bPtr, uint32_t *zPtr ) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
922 |
{ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
923 |
uint32_t *lastZPtr, wordB; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
924 |
uint64_t dwordProd; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
925 |
uint32_t wordZ; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
926 |
uint_fast8_t carry; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
927 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
928 |
bPtr += indexWordLo( 4 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
929 |
lastZPtr = zPtr + indexMultiwordHi( 8, 5 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
930 |
zPtr += indexMultiwordLo( 8, 5 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
931 |
wordB = *bPtr; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
932 |
dwordProd = (uint64_t) aPtr[indexWord( 4, 0 )] * wordB; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
933 |
zPtr[indexWord( 5, 0 )] = dwordProd; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
934 |
dwordProd = (uint64_t) aPtr[indexWord( 4, 1 )] * wordB + (dwordProd>>32); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
935 |
zPtr[indexWord( 5, 1 )] = dwordProd; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
936 |
dwordProd = (uint64_t) aPtr[indexWord( 4, 2 )] * wordB + (dwordProd>>32); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
937 |
zPtr[indexWord( 5, 2 )] = dwordProd; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
938 |
dwordProd = (uint64_t) aPtr[indexWord( 4, 3 )] * wordB + (dwordProd>>32); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
939 |
zPtr[indexWord( 5, 3 )] = dwordProd; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
940 |
zPtr[indexWord( 5, 4 )] = dwordProd>>32; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
941 |
do { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
942 |
bPtr += wordIncr; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
943 |
zPtr += wordIncr; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
944 |
wordB = *bPtr; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
945 |
dwordProd = (uint64_t) aPtr[indexWord( 4, 0 )] * wordB; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
946 |
wordZ = zPtr[indexWord( 5, 0 )] + (uint32_t) dwordProd; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
947 |
zPtr[indexWord( 5, 0 )] = wordZ; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
948 |
carry = (wordZ < (uint32_t) dwordProd); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
949 |
dwordProd = |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
950 |
(uint64_t) aPtr[indexWord( 4, 1 )] * wordB + (dwordProd>>32); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
951 |
wordZ = zPtr[indexWord( 5, 1 )] + (uint32_t) dwordProd + carry; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
952 |
zPtr[indexWord( 5, 1 )] = wordZ; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
953 |
if ( wordZ != (uint32_t) dwordProd ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
954 |
carry = (wordZ < (uint32_t) dwordProd); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
955 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
956 |
dwordProd = |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
957 |
(uint64_t) aPtr[indexWord( 4, 2 )] * wordB + (dwordProd>>32); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
958 |
wordZ = zPtr[indexWord( 5, 2 )] + (uint32_t) dwordProd + carry; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
959 |
zPtr[indexWord( 5, 2 )] = wordZ; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
960 |
if ( wordZ != (uint32_t) dwordProd ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
961 |
carry = (wordZ < (uint32_t) dwordProd); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
962 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
963 |
dwordProd = |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
964 |
(uint64_t) aPtr[indexWord( 4, 3 )] * wordB + (dwordProd>>32); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
965 |
wordZ = zPtr[indexWord( 5, 3 )] + (uint32_t) dwordProd + carry; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
966 |
zPtr[indexWord( 5, 3 )] = wordZ; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
967 |
if ( wordZ != (uint32_t) dwordProd ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
968 |
carry = (wordZ < (uint32_t) dwordProd); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
969 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
970 |
zPtr[indexWord( 5, 4 )] = (dwordProd>>32) + carry; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
971 |
} while ( zPtr != lastZPtr ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
972 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
973 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
974 |
float128_t |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
975 |
softfloat_roundPackToF128( |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
976 |
bool sign, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
977 |
int_fast32_t exp, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
978 |
uint_fast64_t sig64, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
979 |
uint_fast64_t sig0, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
980 |
uint_fast64_t sigExtra |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
981 |
) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
982 |
{ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
983 |
uint_fast8_t roundingMode; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
984 |
bool roundNearEven, doIncrement, isTiny; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
985 |
struct uint128_extra sig128Extra; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
986 |
uint_fast64_t uiZ64, uiZ0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
987 |
struct uint128 sig128; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
988 |
union ui128_f128 uZ; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
989 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
990 |
/*------------------------------------------------------------------------ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
991 |
*------------------------------------------------------------------------*/ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
992 |
roundingMode = softfloat_roundingMode; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
993 |
roundNearEven = (roundingMode == softfloat_round_near_even); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
994 |
doIncrement = (UINT64_C( 0x8000000000000000 ) <= sigExtra); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
995 |
if ( ! roundNearEven && (roundingMode != softfloat_round_near_maxMag) ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
996 |
doIncrement = |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
997 |
(roundingMode |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
998 |
== (sign ? softfloat_round_min : softfloat_round_max)) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
999 |
&& sigExtra; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1000 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1001 |
/*------------------------------------------------------------------------ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1002 |
*------------------------------------------------------------------------*/ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1003 |
if ( 0x7FFD <= (uint32_t) exp ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1004 |
if ( exp < 0 ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1005 |
/*---------------------------------------------------------------- |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1006 |
*----------------------------------------------------------------*/ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1007 |
isTiny = |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1008 |
(softfloat_detectTininess |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1009 |
== softfloat_tininess_beforeRounding) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1010 |
|| (exp < -1) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1011 |
|| ! doIncrement |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1012 |
|| softfloat_lt128( |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1013 |
sig64, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1014 |
sig0, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1015 |
UINT64_C( 0x0001FFFFFFFFFFFF ), |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1016 |
UINT64_C( 0xFFFFFFFFFFFFFFFF ) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1017 |
); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1018 |
sig128Extra = |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1019 |
softfloat_shiftRightJam128Extra( sig64, sig0, sigExtra, -exp ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1020 |
sig64 = sig128Extra.v.v64; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1021 |
sig0 = sig128Extra.v.v0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1022 |
sigExtra = sig128Extra.extra; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1023 |
exp = 0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1024 |
if ( isTiny && sigExtra ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1025 |
softfloat_raiseFlags( softfloat_flag_underflow ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1026 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1027 |
doIncrement = (UINT64_C( 0x8000000000000000 ) <= sigExtra); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1028 |
if ( |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1029 |
! roundNearEven |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1030 |
&& (roundingMode != softfloat_round_near_maxMag) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1031 |
) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1032 |
doIncrement = |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1033 |
(roundingMode |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1034 |
== (sign ? softfloat_round_min : softfloat_round_max)) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1035 |
&& sigExtra; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1036 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1037 |
} else if ( |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1038 |
(0x7FFD < exp) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1039 |
|| ((exp == 0x7FFD) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1040 |
&& softfloat_eq128( |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1041 |
sig64, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1042 |
sig0, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1043 |
UINT64_C( 0x0001FFFFFFFFFFFF ), |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1044 |
UINT64_C( 0xFFFFFFFFFFFFFFFF ) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1045 |
) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1046 |
&& doIncrement) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1047 |
) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1048 |
/*---------------------------------------------------------------- |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1049 |
*----------------------------------------------------------------*/ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1050 |
softfloat_raiseFlags( |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1051 |
softfloat_flag_overflow | softfloat_flag_inexact ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1052 |
if ( |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1053 |
roundNearEven |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1054 |
|| (roundingMode == softfloat_round_near_maxMag) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1055 |
|| (roundingMode |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1056 |
== (sign ? softfloat_round_min : softfloat_round_max)) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1057 |
) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1058 |
uiZ64 = packToF128UI64( sign, 0x7FFF, 0 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1059 |
uiZ0 = 0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1060 |
} else { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1061 |
uiZ64 = packToF128UI64( sign, 0x7FFE, UINT64_C( 0x0000FFFFFFFFFFFF ) ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1062 |
uiZ0 = UINT64_C( 0xFFFFFFFFFFFFFFFF ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1063 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1064 |
goto uiZ; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1065 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1066 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1067 |
/*------------------------------------------------------------------------ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1068 |
*------------------------------------------------------------------------*/ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1069 |
if ( sigExtra ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1070 |
softfloat_exceptionFlags |= softfloat_flag_inexact; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1071 |
#ifdef SOFTFLOAT_ROUND_ODD |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1072 |
if ( roundingMode == softfloat_round_odd ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1073 |
sig0 |= 1; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1074 |
goto packReturn; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1075 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1076 |
#endif |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1077 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1078 |
if ( doIncrement ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1079 |
sig128 = softfloat_add128( sig64, sig0, 0, 1 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1080 |
sig64 = sig128.v64; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1081 |
sig0 = |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1082 |
sig128.v0 |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1083 |
& ~(uint64_t) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1084 |
(! (sigExtra & UINT64_C( 0x7FFFFFFFFFFFFFFF )) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1085 |
& roundNearEven); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1086 |
} else { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1087 |
if ( ! (sig64 | sig0) ) exp = 0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1088 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1089 |
/*------------------------------------------------------------------------ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1090 |
*------------------------------------------------------------------------*/ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1091 |
packReturn: |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1092 |
uiZ64 = packToF128UI64( sign, exp, sig64 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1093 |
uiZ0 = sig0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1094 |
uiZ: |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1095 |
uZ.ui.v64 = uiZ64; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1096 |
uZ.ui.v0 = uiZ0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1097 |
return uZ.f; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1098 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1099 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1100 |
float128_t |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1101 |
softfloat_normRoundPackToF128( |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1102 |
bool sign, int_fast32_t exp, uint_fast64_t sig64, uint_fast64_t sig0 ) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1103 |
{ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1104 |
int_fast8_t shiftDist; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1105 |
struct uint128 sig128; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1106 |
union ui128_f128 uZ; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1107 |
uint_fast64_t sigExtra; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1108 |
struct uint128_extra sig128Extra; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1109 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1110 |
if ( ! sig64 ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1111 |
exp -= 64; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1112 |
sig64 = sig0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1113 |
sig0 = 0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1114 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1115 |
shiftDist = softfloat_countLeadingZeros64( sig64 ) - 15; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1116 |
exp -= shiftDist; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1117 |
if ( 0 <= shiftDist ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1118 |
if ( shiftDist ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1119 |
sig128 = softfloat_shortShiftLeft128( sig64, sig0, shiftDist ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1120 |
sig64 = sig128.v64; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1121 |
sig0 = sig128.v0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1122 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1123 |
if ( (uint32_t) exp < 0x7FFD ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1124 |
uZ.ui.v64 = packToF128UI64( sign, sig64 | sig0 ? exp : 0, sig64 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1125 |
uZ.ui.v0 = sig0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1126 |
return uZ.f; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1127 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1128 |
sigExtra = 0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1129 |
} else { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1130 |
sig128Extra = |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1131 |
softfloat_shortShiftRightJam128Extra( sig64, sig0, 0, -shiftDist ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1132 |
sig64 = sig128Extra.v.v64; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1133 |
sig0 = sig128Extra.v.v0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1134 |
sigExtra = sig128Extra.extra; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1135 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1136 |
return softfloat_roundPackToF128( sign, exp, sig64, sig0, sigExtra ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1137 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1138 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1139 |
struct exp32_sig128 |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1140 |
softfloat_normSubnormalF128Sig( uint_fast64_t sig64, uint_fast64_t sig0 ) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1141 |
{ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1142 |
int_fast8_t shiftDist; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1143 |
struct exp32_sig128 z; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1144 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1145 |
if ( ! sig64 ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1146 |
shiftDist = softfloat_countLeadingZeros64( sig0 ) - 15; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1147 |
z.exp = -63 - shiftDist; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1148 |
if ( shiftDist < 0 ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1149 |
z.sig.v64 = sig0>>-shiftDist; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1150 |
z.sig.v0 = sig0<<(shiftDist & 63); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1151 |
} else { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1152 |
z.sig.v64 = sig0<<shiftDist; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1153 |
z.sig.v0 = 0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1154 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1155 |
} else { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1156 |
shiftDist = softfloat_countLeadingZeros64( sig64 ) - 15; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1157 |
z.exp = 1 - shiftDist; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1158 |
z.sig = softfloat_shortShiftLeft128( sig64, sig0, shiftDist ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1159 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1160 |
return z; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1161 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1162 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1163 |
struct uint128 |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1164 |
softfloat_propagateNaNF128UI( |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1165 |
uint_fast64_t uiA64, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1166 |
uint_fast64_t uiA0, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1167 |
uint_fast64_t uiB64, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1168 |
uint_fast64_t uiB0 |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1169 |
) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1170 |
{ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1171 |
bool isSigNaNA, isSigNaNB; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1172 |
uint_fast64_t uiNonsigA64, uiNonsigB64, uiMagA64, uiMagB64; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1173 |
struct uint128 uiZ; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1174 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1175 |
/*------------------------------------------------------------------------ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1176 |
*------------------------------------------------------------------------*/ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1177 |
isSigNaNA = softfloat_isSigNaNF128UI( uiA64, uiA0 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1178 |
isSigNaNB = softfloat_isSigNaNF128UI( uiB64, uiB0 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1179 |
/*------------------------------------------------------------------------ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1180 |
| Make NaNs non-signaling. |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1181 |
*------------------------------------------------------------------------*/ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1182 |
uiNonsigA64 = uiA64 | UINT64_C( 0x0000800000000000 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1183 |
uiNonsigB64 = uiB64 | UINT64_C( 0x0000800000000000 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1184 |
/*------------------------------------------------------------------------ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1185 |
*------------------------------------------------------------------------*/ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1186 |
if ( isSigNaNA | isSigNaNB ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1187 |
softfloat_raiseFlags( softfloat_flag_invalid ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1188 |
if ( isSigNaNA ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1189 |
if ( isSigNaNB ) goto returnLargerMag; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1190 |
if ( isNaNF128UI( uiB64, uiB0 ) ) goto returnB; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1191 |
goto returnA; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1192 |
} else { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1193 |
if ( isNaNF128UI( uiA64, uiA0 ) ) goto returnA; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1194 |
goto returnB; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1195 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1196 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1197 |
returnLargerMag: |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1198 |
uiMagA64 = uiA64 & UINT64_C( 0x7FFFFFFFFFFFFFFF ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1199 |
uiMagB64 = uiB64 & UINT64_C( 0x7FFFFFFFFFFFFFFF ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1200 |
if ( uiMagA64 < uiMagB64 ) goto returnB; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1201 |
if ( uiMagB64 < uiMagA64 ) goto returnA; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1202 |
if ( uiA0 < uiB0 ) goto returnB; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1203 |
if ( uiB0 < uiA0 ) goto returnA; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1204 |
if ( uiNonsigA64 < uiNonsigB64 ) goto returnA; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1205 |
returnB: |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1206 |
uiZ.v64 = uiNonsigB64; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1207 |
uiZ.v0 = uiB0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1208 |
return uiZ; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1209 |
returnA: |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1210 |
uiZ.v64 = uiNonsigA64; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1211 |
uiZ.v0 = uiA0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1212 |
return uiZ; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1213 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1214 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1215 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1216 |
#if __POINTER_SIZE__ == 4 |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1217 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1218 |
void |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1219 |
i32_to_f128M( int32_t a, float128_t *zPtr ) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1220 |
{ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1221 |
uint32_t *zWPtr; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1222 |
uint32_t uiZ96, uiZ64; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1223 |
bool sign; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1224 |
uint32_t absA; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1225 |
int_fast8_t shiftDist; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1226 |
uint64_t normAbsA; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1227 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1228 |
zWPtr = (uint32_t *) zPtr; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1229 |
uiZ96 = 0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1230 |
uiZ64 = 0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1231 |
if ( a ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1232 |
sign = (a < 0); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1233 |
absA = sign ? -(uint32_t) a : (uint32_t) a; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1234 |
shiftDist = softfloat_countLeadingZeros32( absA ) + 17; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1235 |
normAbsA = (uint64_t) absA<<shiftDist; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1236 |
uiZ96 = packToF128UI96( sign, 0x402E - shiftDist, normAbsA>>32 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1237 |
uiZ64 = normAbsA; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1238 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1239 |
zWPtr[indexWord( 4, 3 )] = uiZ96; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1240 |
zWPtr[indexWord( 4, 2 )] = uiZ64; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1241 |
zWPtr[indexWord( 4, 1 )] = 0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1242 |
zWPtr[indexWord( 4, 0 )] = 0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1243 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1244 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1245 |
#else |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1246 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1247 |
void |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1248 |
i64_to_f128M( int64_t a, float128_t *zPtr ) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1249 |
{ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1250 |
uint32_t *zWPtr; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1251 |
uint32_t uiZ96, uiZ64; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1252 |
bool sign; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1253 |
uint64_t absA; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1254 |
uint_fast8_t shiftDist; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1255 |
uint32_t *ptr; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1256 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1257 |
zWPtr = (uint32_t *) zPtr; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1258 |
uiZ96 = 0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1259 |
uiZ64 = 0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1260 |
zWPtr[indexWord( 4, 1 )] = 0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1261 |
zWPtr[indexWord( 4, 0 )] = 0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1262 |
if ( a ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1263 |
sign = (a < 0); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1264 |
absA = sign ? -(uint64_t) a : (uint64_t) a; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1265 |
shiftDist = softfloat_countLeadingZeros64( absA ) + 17; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1266 |
if ( shiftDist < 32 ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1267 |
ptr = zWPtr + indexMultiwordHi( 4, 3 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1268 |
ptr[indexWord( 3, 2 )] = 0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1269 |
ptr[indexWord( 3, 1 )] = absA>>32; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1270 |
ptr[indexWord( 3, 0 )] = absA; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1271 |
softfloat_shortShiftLeft96M( ptr, shiftDist, ptr ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1272 |
ptr[indexWordHi( 3 )] = |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1273 |
packToF128UI96( |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1274 |
sign, 0x404E - shiftDist, ptr[indexWordHi( 3 )] ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1275 |
return; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1276 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1277 |
absA <<= shiftDist - 32; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1278 |
uiZ96 = packToF128UI96( sign, 0x404E - shiftDist, absA>>32 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1279 |
uiZ64 = absA; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1280 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1281 |
zWPtr[indexWord( 4, 3 )] = uiZ96; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1282 |
zWPtr[indexWord( 4, 2 )] = uiZ64; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1283 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1284 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1285 |
#endif |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1286 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1287 |
void |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1288 |
f64_to_f128M( float64_t a, float128_t *zPtr ) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1289 |
{ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1290 |
uint32_t *zWPtr; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1291 |
union ui64_f64 uA; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1292 |
uint64_t uiA; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1293 |
bool sign; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1294 |
int_fast16_t exp; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1295 |
uint64_t frac; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1296 |
struct commonNaN commonNaN; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1297 |
uint32_t uiZ96; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1298 |
struct exp16_sig64 normExpSig; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1299 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1300 |
/*------------------------------------------------------------------------ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1301 |
*------------------------------------------------------------------------*/ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1302 |
zWPtr = (uint32_t *) zPtr; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1303 |
/*------------------------------------------------------------------------ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1304 |
*------------------------------------------------------------------------*/ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1305 |
uA.f = a; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1306 |
uiA = uA.ui; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1307 |
sign = signF64UI( uiA ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1308 |
exp = expF64UI( uiA ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1309 |
frac = fracF64UI( uiA ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1310 |
/*------------------------------------------------------------------------ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1311 |
*------------------------------------------------------------------------*/ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1312 |
zWPtr[indexWord( 4, 0 )] = 0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1313 |
if ( exp == 0x7FF ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1314 |
if ( frac ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1315 |
// NaN |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1316 |
softfloat_commonNaNToF128M( zWPtr ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1317 |
return; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1318 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1319 |
uiZ96 = packToF128UI96( sign, 0x7FFF, 0 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1320 |
goto uiZ; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1321 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1322 |
/*------------------------------------------------------------------------ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1323 |
*------------------------------------------------------------------------*/ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1324 |
if ( ! exp ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1325 |
if ( ! frac ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1326 |
uiZ96 = packToF128UI96( sign, 0, 0 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1327 |
goto uiZ; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1328 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1329 |
normExpSig = softfloat_normSubnormalF64Sig( frac ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1330 |
exp = normExpSig.exp - 1; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1331 |
frac = normExpSig.sig; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1332 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1333 |
/*------------------------------------------------------------------------ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1334 |
*------------------------------------------------------------------------*/ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1335 |
zWPtr[indexWord( 4, 1 )] = (uint32_t) frac<<28; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1336 |
frac >>= 4; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1337 |
zWPtr[indexWordHi( 4 )] = packToF128UI96( sign, exp + 0x3C00, frac>>32 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1338 |
zWPtr[indexWord( 4, 2 )] = frac; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1339 |
return; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1340 |
/*------------------------------------------------------------------------ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1341 |
*------------------------------------------------------------------------*/ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1342 |
uiZ: |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1343 |
zWPtr[indexWord( 4, 3 )] = uiZ96; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1344 |
zWPtr[indexWord( 4, 2 )] = 0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1345 |
zWPtr[indexWord( 4, 1 )] = 0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1346 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1347 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1348 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1349 |
float128_t |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1350 |
extF80_to_f128( extFloat80_t a ) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1351 |
{ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1352 |
union { struct extFloat80M s; extFloat80_t f; } uA; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1353 |
uint_fast16_t uiA64; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1354 |
uint_fast64_t uiA0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1355 |
uint_fast16_t exp; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1356 |
uint_fast64_t frac; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1357 |
struct commonNaN commonNaN; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1358 |
struct uint128 uiZ; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1359 |
bool sign; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1360 |
struct uint128 frac128; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1361 |
union ui128_f128 uZ; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1362 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1363 |
uA.f = a; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1364 |
uiA64 = uA.s.signExp; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1365 |
uiA0 = uA.s.signif; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1366 |
exp = expExtF80UI64( uiA64 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1367 |
frac = uiA0 & UINT64_C( 0x7FFFFFFFFFFFFFFF ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1368 |
if ( (exp == 0x7FFF) && frac ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1369 |
softfloat_extF80UIToCommonNaN( uiA64, uiA0, &commonNaN ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1370 |
softfloat_commonNaNToF128M( (uint32_t*) &uiZ ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1371 |
} else { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1372 |
sign = signExtF80UI64( uiA64 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1373 |
frac128 = softfloat_shortShiftLeft128( 0, frac, 49 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1374 |
uiZ.v64 = packToF128UI64( sign, exp, frac128.v64 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1375 |
uiZ.v0 = frac128.v0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1376 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1377 |
uZ.ui = uiZ; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1378 |
return uZ.f; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1379 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1380 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1381 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1382 |
static float128_t |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1383 |
softfloat_addMagsF128( |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1384 |
uint64_t uiA64, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1385 |
uint64_t uiA0, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1386 |
uint64_t uiB64, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1387 |
uint64_t uiB0, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1388 |
bool signZ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1389 |
) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1390 |
{ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1391 |
int32_t expA; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1392 |
struct uint128 sigA; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1393 |
int32_t expB; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1394 |
struct uint128 sigB; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1395 |
int32_t expDiff; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1396 |
struct uint128 uiZ, sigZ; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1397 |
int32_t expZ; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1398 |
uint64_t sigZExtra; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1399 |
struct uint128_extra sig128Extra; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1400 |
union ui128_f128 uZ; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1401 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1402 |
expA = expF128UI64( uiA64 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1403 |
sigA.v64 = fracF128UI64( uiA64 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1404 |
sigA.v0 = uiA0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1405 |
expB = expF128UI64( uiB64 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1406 |
sigB.v64 = fracF128UI64( uiB64 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1407 |
sigB.v0 = uiB0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1408 |
expDiff = expA - expB; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1409 |
if ( ! expDiff ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1410 |
if ( expA == 0x7FFF ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1411 |
if ( sigA.v64 | sigA.v0 | sigB.v64 | sigB.v0 ) goto propagateNaN; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1412 |
uiZ.v64 = uiA64; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1413 |
uiZ.v0 = uiA0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1414 |
goto uiZ; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1415 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1416 |
sigZ = softfloat_add128( sigA.v64, sigA.v0, sigB.v64, sigB.v0 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1417 |
if ( ! expA ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1418 |
uiZ.v64 = packToF128UI64( signZ, 0, sigZ.v64 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1419 |
uiZ.v0 = sigZ.v0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1420 |
goto uiZ; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1421 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1422 |
expZ = expA; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1423 |
sigZ.v64 |= UINT64_C( 0x0002000000000000 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1424 |
sigZExtra = 0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1425 |
goto shiftRight1; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1426 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1427 |
if ( expDiff < 0 ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1428 |
if ( expB == 0x7FFF ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1429 |
if ( sigB.v64 | sigB.v0 ) goto propagateNaN; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1430 |
uiZ.v64 = packToF128UI64( signZ, 0x7FFF, 0 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1431 |
uiZ.v0 = 0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1432 |
goto uiZ; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1433 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1434 |
expZ = expB; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1435 |
if ( expA ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1436 |
sigA.v64 |= UINT64_C( 0x0001000000000000 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1437 |
} else { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1438 |
++expDiff; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1439 |
sigZExtra = 0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1440 |
if ( ! expDiff ) goto newlyAligned; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1441 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1442 |
sig128Extra = |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1443 |
softfloat_shiftRightJam128Extra( sigA.v64, sigA.v0, 0, -expDiff ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1444 |
sigA = sig128Extra.v; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1445 |
sigZExtra = sig128Extra.extra; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1446 |
} else { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1447 |
if ( expA == 0x7FFF ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1448 |
if ( sigA.v64 | sigA.v0 ) goto propagateNaN; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1449 |
uiZ.v64 = uiA64; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1450 |
uiZ.v0 = uiA0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1451 |
goto uiZ; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1452 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1453 |
expZ = expA; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1454 |
if ( expB ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1455 |
sigB.v64 |= UINT64_C( 0x0001000000000000 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1456 |
} else { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1457 |
--expDiff; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1458 |
sigZExtra = 0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1459 |
if ( ! expDiff ) goto newlyAligned; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1460 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1461 |
sig128Extra = |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1462 |
softfloat_shiftRightJam128Extra( sigB.v64, sigB.v0, 0, expDiff ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1463 |
sigB = sig128Extra.v; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1464 |
sigZExtra = sig128Extra.extra; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1465 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1466 |
newlyAligned: |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1467 |
sigZ = |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1468 |
softfloat_add128( |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1469 |
sigA.v64 | UINT64_C( 0x0001000000000000 ), |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1470 |
sigA.v0, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1471 |
sigB.v64, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1472 |
sigB.v0 |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1473 |
); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1474 |
--expZ; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1475 |
if ( sigZ.v64 < UINT64_C( 0x0002000000000000 ) ) goto roundAndPack; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1476 |
++expZ; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1477 |
shiftRight1: |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1478 |
sig128Extra = |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1479 |
softfloat_shortShiftRightJam128Extra( |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1480 |
sigZ.v64, sigZ.v0, sigZExtra, 1 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1481 |
sigZ = sig128Extra.v; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1482 |
sigZExtra = sig128Extra.extra; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1483 |
roundAndPack: |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1484 |
return |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1485 |
softfloat_roundPackToF128( signZ, expZ, sigZ.v64, sigZ.v0, sigZExtra ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1486 |
propagateNaN: |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1487 |
uiZ = softfloat_propagateNaNF128UI( uiA64, uiA0, uiB64, uiB0 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1488 |
uiZ: |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1489 |
uZ.ui = uiZ; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1490 |
return uZ.f; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1491 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1492 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1493 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1494 |
float128_t |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1495 |
softfloat_subMagsF128( |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1496 |
uint_fast64_t uiA64, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1497 |
uint_fast64_t uiA0, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1498 |
uint_fast64_t uiB64, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1499 |
uint_fast64_t uiB0, |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1500 |
bool signZ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1501 |
) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1502 |
{ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1503 |
int_fast32_t expA; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1504 |
struct uint128 sigA; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1505 |
int_fast32_t expB; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1506 |
struct uint128 sigB, sigZ; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1507 |
int_fast32_t expDiff, expZ; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1508 |
struct uint128 uiZ; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1509 |
union ui128_f128 uZ; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1510 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1511 |
expA = expF128UI64( uiA64 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1512 |
sigA.v64 = fracF128UI64( uiA64 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1513 |
sigA.v0 = uiA0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1514 |
expB = expF128UI64( uiB64 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1515 |
sigB.v64 = fracF128UI64( uiB64 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1516 |
sigB.v0 = uiB0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1517 |
sigA = softfloat_shortShiftLeft128( sigA.v64, sigA.v0, 4 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1518 |
sigB = softfloat_shortShiftLeft128( sigB.v64, sigB.v0, 4 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1519 |
expDiff = expA - expB; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1520 |
if ( 0 < expDiff ) goto expABigger; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1521 |
if ( expDiff < 0 ) goto expBBigger; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1522 |
if ( expA == 0x7FFF ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1523 |
if ( sigA.v64 | sigA.v0 | sigB.v64 | sigB.v0 ) goto propagateNaN; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1524 |
softfloat_raiseFlags( softfloat_flag_invalid ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1525 |
softfloat_commonNaNToF128M( (uint32_t*)&uiZ ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1526 |
// uiZ.v64 = defaultNaNF128UI64; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1527 |
// uiZ.v0 = defaultNaNF128UI0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1528 |
goto uiZ; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1529 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1530 |
expZ = expA; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1531 |
if ( ! expZ ) expZ = 1; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1532 |
if ( sigB.v64 < sigA.v64 ) goto aBigger; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1533 |
if ( sigA.v64 < sigB.v64 ) goto bBigger; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1534 |
if ( sigB.v0 < sigA.v0 ) goto aBigger; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1535 |
if ( sigA.v0 < sigB.v0 ) goto bBigger; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1536 |
uiZ.v64 = |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1537 |
packToF128UI64( |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1538 |
(softfloat_roundingMode == softfloat_round_min), 0, 0 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1539 |
uiZ.v0 = 0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1540 |
goto uiZ; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1541 |
expBBigger: |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1542 |
if ( expB == 0x7FFF ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1543 |
if ( sigB.v64 | sigB.v0 ) goto propagateNaN; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1544 |
uiZ.v64 = packToF128UI64( signZ ^ 1, 0x7FFF, 0 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1545 |
uiZ.v0 = 0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1546 |
goto uiZ; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1547 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1548 |
if ( expA ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1549 |
sigA.v64 |= UINT64_C( 0x0010000000000000 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1550 |
} else { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1551 |
++expDiff; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1552 |
if ( ! expDiff ) goto newlyAlignedBBigger; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1553 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1554 |
sigA = softfloat_shiftRightJam128( sigA.v64, sigA.v0, -expDiff ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1555 |
newlyAlignedBBigger: |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1556 |
expZ = expB; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1557 |
sigB.v64 |= UINT64_C( 0x0010000000000000 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1558 |
bBigger: |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1559 |
signZ = ! signZ; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1560 |
sigZ = softfloat_sub128( sigB.v64, sigB.v0, sigA.v64, sigA.v0 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1561 |
goto normRoundPack; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1562 |
expABigger: |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1563 |
if ( expA == 0x7FFF ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1564 |
if ( sigA.v64 | sigA.v0 ) goto propagateNaN; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1565 |
uiZ.v64 = uiA64; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1566 |
uiZ.v0 = uiA0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1567 |
goto uiZ; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1568 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1569 |
if ( expB ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1570 |
sigB.v64 |= UINT64_C( 0x0010000000000000 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1571 |
} else { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1572 |
--expDiff; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1573 |
if ( ! expDiff ) goto newlyAlignedABigger; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1574 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1575 |
sigB = softfloat_shiftRightJam128( sigB.v64, sigB.v0, expDiff ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1576 |
newlyAlignedABigger: |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1577 |
expZ = expA; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1578 |
sigA.v64 |= UINT64_C( 0x0010000000000000 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1579 |
aBigger: |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1580 |
sigZ = softfloat_sub128( sigA.v64, sigA.v0, sigB.v64, sigB.v0 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1581 |
normRoundPack: |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1582 |
return softfloat_normRoundPackToF128( signZ, expZ - 5, sigZ.v64, sigZ.v0 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1583 |
propagateNaN: |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1584 |
uiZ = softfloat_propagateNaNF128UI( uiA64, uiA0, uiB64, uiB0 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1585 |
uiZ: |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1586 |
uZ.ui = uiZ; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1587 |
return uZ.f; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1588 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1589 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1590 |
void |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1591 |
f128M_add( const float128_t *aPtr, const float128_t *bPtr, float128_t *zPtr ) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1592 |
{ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1593 |
const uint64_t *aWPtr, *bWPtr; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1594 |
uint64_t uiA64, uiA0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1595 |
int signA; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1596 |
uint64_t uiB64, uiB0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1597 |
int signB; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1598 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1599 |
aWPtr = (const uint64_t *) aPtr; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1600 |
bWPtr = (const uint64_t *) bPtr; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1601 |
uiA64 = aWPtr[indexWord( 2, 1 )]; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1602 |
uiA0 = aWPtr[indexWord( 2, 0 )]; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1603 |
signA = signF128UI64( uiA64 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1604 |
uiB64 = bWPtr[indexWord( 2, 1 )]; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1605 |
uiB0 = bWPtr[indexWord( 2, 0 )]; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1606 |
signB = signF128UI64( uiB64 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1607 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1608 |
if ( signA == signB ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1609 |
*zPtr = softfloat_addMagsF128( uiA64, uiA0, uiB64, uiB0, signA ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1610 |
} else { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1611 |
*zPtr = softfloat_subMagsF128( uiA64, uiA0, uiB64, uiB0, signA ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1612 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1613 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1614 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1615 |
void |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1616 |
f128M_sub( const float128_t *aPtr, const float128_t *bPtr, float128_t *zPtr ) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1617 |
{ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1618 |
const uint64_t *aWPtr, *bWPtr; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1619 |
uint_fast64_t uiA64, uiA0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1620 |
bool signA; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1621 |
uint_fast64_t uiB64, uiB0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1622 |
bool signB; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1623 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1624 |
aWPtr = (const uint64_t *) aPtr; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1625 |
bWPtr = (const uint64_t *) bPtr; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1626 |
uiA64 = aWPtr[indexWord( 2, 1 )]; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1627 |
uiA0 = aWPtr[indexWord( 2, 0 )]; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1628 |
signA = signF128UI64( uiA64 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1629 |
uiB64 = bWPtr[indexWord( 2, 1 )]; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1630 |
uiB0 = bWPtr[indexWord( 2, 0 )]; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1631 |
signB = signF128UI64( uiB64 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1632 |
if ( signA == signB ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1633 |
*zPtr = softfloat_subMagsF128( uiA64, uiA0, uiB64, uiB0, signA ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1634 |
} else { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1635 |
*zPtr = softfloat_addMagsF128( uiA64, uiA0, uiB64, uiB0, signA ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1636 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1637 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1638 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1639 |
void |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1640 |
f128M_mul( const float128_t *aPtr, const float128_t *bPtr, float128_t *zPtr ) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1641 |
{ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1642 |
const uint32_t *aWPtr, *bWPtr; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1643 |
uint32_t *zWPtr; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1644 |
uint32_t uiA96; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1645 |
int32_t expA; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1646 |
uint32_t uiB96; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1647 |
int32_t expB; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1648 |
bool signZ; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1649 |
const uint32_t *ptr; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1650 |
uint32_t uiZ96, sigA[4]; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1651 |
uint_fast8_t shiftDist; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1652 |
uint32_t sigB[4]; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1653 |
int32_t expZ; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1654 |
uint32_t sigProd[8], *extSigZPtr; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1655 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1656 |
/*------------------------------------------------------------------------ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1657 |
*------------------------------------------------------------------------*/ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1658 |
aWPtr = (const uint32_t *) aPtr; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1659 |
bWPtr = (const uint32_t *) bPtr; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1660 |
zWPtr = (uint32_t *) zPtr; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1661 |
/*------------------------------------------------------------------------ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1662 |
*------------------------------------------------------------------------*/ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1663 |
uiA96 = aWPtr[indexWordHi( 4 )]; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1664 |
expA = expF128UI96( uiA96 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1665 |
uiB96 = bWPtr[indexWordHi( 4 )]; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1666 |
expB = expF128UI96( uiB96 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1667 |
signZ = signF128UI96( uiA96 ) ^ signF128UI96( uiB96 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1668 |
/*------------------------------------------------------------------------ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1669 |
*------------------------------------------------------------------------*/ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1670 |
if ( (expA == 0x7FFF) || (expB == 0x7FFF) ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1671 |
if ( softfloat_tryPropagateNaNF128M( aWPtr, bWPtr, zWPtr ) ) return; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1672 |
ptr = aWPtr; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1673 |
if ( ! expA ) goto possiblyInvalid; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1674 |
if ( ! expB ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1675 |
ptr = bWPtr; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1676 |
possiblyInvalid: |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1677 |
if ( |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1678 |
! fracF128UI96( ptr[indexWordHi( 4 )] ) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1679 |
&& ! (ptr[indexWord( 4, 2 )] | ptr[indexWord( 4, 1 )] |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1680 |
| ptr[indexWord( 4, 0 )]) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1681 |
) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1682 |
softfloat_invalidF128M( zWPtr ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1683 |
return; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1684 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1685 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1686 |
uiZ96 = packToF128UI96( signZ, 0x7FFF, 0 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1687 |
goto uiZ96; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1688 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1689 |
/*------------------------------------------------------------------------ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1690 |
*------------------------------------------------------------------------*/ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1691 |
if ( expA ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1692 |
sigA[indexWordHi( 4 )] = fracF128UI96( uiA96 ) | 0x00010000; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1693 |
sigA[indexWord( 4, 2 )] = aWPtr[indexWord( 4, 2 )]; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1694 |
sigA[indexWord( 4, 1 )] = aWPtr[indexWord( 4, 1 )]; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1695 |
sigA[indexWord( 4, 0 )] = aWPtr[indexWord( 4, 0 )]; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1696 |
} else { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1697 |
expA = softfloat_shiftNormSigF128M( aWPtr, 0, sigA ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1698 |
if ( expA == -128 ) goto zero; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1699 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1700 |
if ( expB ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1701 |
sigB[indexWordHi( 4 )] = fracF128UI96( uiB96 ) | 0x00010000; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1702 |
sigB[indexWord( 4, 2 )] = bWPtr[indexWord( 4, 2 )]; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1703 |
sigB[indexWord( 4, 1 )] = bWPtr[indexWord( 4, 1 )]; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1704 |
sigB[indexWord( 4, 0 )] = bWPtr[indexWord( 4, 0 )]; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1705 |
} else { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1706 |
expB = softfloat_shiftNormSigF128M( bWPtr, 0, sigB ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1707 |
if ( expB == -128 ) goto zero; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1708 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1709 |
/*------------------------------------------------------------------------ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1710 |
*------------------------------------------------------------------------*/ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1711 |
expZ = expA + expB - 0x4000; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1712 |
softfloat_mul128MTo256M( sigA, sigB, sigProd ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1713 |
if ( |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1714 |
sigProd[indexWord( 8, 2 )] |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1715 |
|| (sigProd[indexWord( 8, 1 )] | sigProd[indexWord( 8, 0 )]) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1716 |
) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1717 |
sigProd[indexWord( 8, 3 )] |= 1; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1718 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1719 |
extSigZPtr = &sigProd[indexMultiwordHi( 8, 5 )]; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1720 |
shiftDist = 16; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1721 |
if ( extSigZPtr[indexWordHi( 5 )] & 2 ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1722 |
++expZ; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1723 |
shiftDist = 15; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1724 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1725 |
softfloat_shortShiftLeft160M( extSigZPtr, shiftDist, extSigZPtr ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1726 |
softfloat_roundPackMToF128M( signZ, expZ, extSigZPtr, zWPtr ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1727 |
return; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1728 |
/*------------------------------------------------------------------------ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1729 |
*------------------------------------------------------------------------*/ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1730 |
zero: |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1731 |
uiZ96 = packToF128UI96( signZ, 0, 0 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1732 |
uiZ96: |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1733 |
zWPtr[indexWordHi( 4 )] = uiZ96; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1734 |
zWPtr[indexWord( 4, 2 )] = 0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1735 |
zWPtr[indexWord( 4, 1 )] = 0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1736 |
zWPtr[indexWord( 4, 0 )] = 0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1737 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1738 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1739 |
float128_t |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1740 |
f128_div( float128_t a, float128_t b ) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1741 |
{ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1742 |
union ui128_f128 uA; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1743 |
uint_fast64_t uiA64, uiA0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1744 |
bool signA; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1745 |
int_fast32_t expA; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1746 |
struct uint128 sigA; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1747 |
union ui128_f128 uB; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1748 |
uint_fast64_t uiB64, uiB0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1749 |
bool signB; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1750 |
int_fast32_t expB; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1751 |
struct uint128 sigB; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1752 |
bool signZ; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1753 |
struct exp32_sig128 normExpSig; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1754 |
int_fast32_t expZ; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1755 |
struct uint128 rem; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1756 |
uint_fast32_t recip32; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1757 |
int ix; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1758 |
uint_fast64_t q64; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1759 |
uint_fast32_t q; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1760 |
struct uint128 term; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1761 |
uint_fast32_t qs[3]; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1762 |
uint_fast64_t sigZExtra; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1763 |
struct uint128 sigZ, uiZ; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1764 |
union ui128_f128 uZ; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1765 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1766 |
/*------------------------------------------------------------------------ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1767 |
*------------------------------------------------------------------------*/ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1768 |
uA.f = a; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1769 |
uiA64 = uA.ui.v64; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1770 |
uiA0 = uA.ui.v0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1771 |
signA = signF128UI64( uiA64 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1772 |
expA = expF128UI64( uiA64 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1773 |
sigA.v64 = fracF128UI64( uiA64 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1774 |
sigA.v0 = uiA0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1775 |
uB.f = b; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1776 |
uiB64 = uB.ui.v64; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1777 |
uiB0 = uB.ui.v0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1778 |
signB = signF128UI64( uiB64 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1779 |
expB = expF128UI64( uiB64 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1780 |
sigB.v64 = fracF128UI64( uiB64 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1781 |
sigB.v0 = uiB0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1782 |
signZ = signA ^ signB; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1783 |
/*------------------------------------------------------------------------ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1784 |
*------------------------------------------------------------------------*/ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1785 |
if ( expA == 0x7FFF ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1786 |
if ( sigA.v64 | sigA.v0 ) goto propagateNaN; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1787 |
if ( expB == 0x7FFF ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1788 |
if ( sigB.v64 | sigB.v0 ) goto propagateNaN; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1789 |
goto invalid; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1790 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1791 |
goto infinity; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1792 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1793 |
if ( expB == 0x7FFF ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1794 |
if ( sigB.v64 | sigB.v0 ) goto propagateNaN; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1795 |
goto zero; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1796 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1797 |
/*------------------------------------------------------------------------ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1798 |
*------------------------------------------------------------------------*/ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1799 |
if ( ! expB ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1800 |
if ( ! (sigB.v64 | sigB.v0) ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1801 |
if ( ! (expA | sigA.v64 | sigA.v0) ) goto invalid; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1802 |
softfloat_raiseFlags( softfloat_flag_infinite ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1803 |
goto infinity; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1804 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1805 |
normExpSig = softfloat_normSubnormalF128Sig( sigB.v64, sigB.v0 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1806 |
expB = normExpSig.exp; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1807 |
sigB = normExpSig.sig; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1808 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1809 |
if ( ! expA ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1810 |
if ( ! (sigA.v64 | sigA.v0) ) goto zero; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1811 |
normExpSig = softfloat_normSubnormalF128Sig( sigA.v64, sigA.v0 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1812 |
expA = normExpSig.exp; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1813 |
sigA = normExpSig.sig; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1814 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1815 |
/*------------------------------------------------------------------------ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1816 |
*------------------------------------------------------------------------*/ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1817 |
expZ = expA - expB + 0x3FFE; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1818 |
sigA.v64 |= UINT64_C( 0x0001000000000000 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1819 |
sigB.v64 |= UINT64_C( 0x0001000000000000 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1820 |
rem = sigA; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1821 |
if ( softfloat_lt128( sigA.v64, sigA.v0, sigB.v64, sigB.v0 ) ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1822 |
--expZ; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1823 |
rem = softfloat_add128( sigA.v64, sigA.v0, sigA.v64, sigA.v0 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1824 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1825 |
recip32 = softfloat_approxRecip32_1( sigB.v64>>17 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1826 |
ix = 3; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1827 |
for (;;) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1828 |
q64 = (uint_fast64_t) (uint32_t) (rem.v64>>19) * recip32; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1829 |
q = (q64 + 0x80000000)>>32; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1830 |
--ix; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1831 |
if ( ix < 0 ) break; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1832 |
rem = softfloat_shortShiftLeft128( rem.v64, rem.v0, 29 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1833 |
term = softfloat_mul128By32( sigB.v64, sigB.v0, q ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1834 |
rem = softfloat_sub128( rem.v64, rem.v0, term.v64, term.v0 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1835 |
if ( rem.v64 & UINT64_C( 0x8000000000000000 ) ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1836 |
--q; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1837 |
rem = softfloat_add128( rem.v64, rem.v0, sigB.v64, sigB.v0 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1838 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1839 |
qs[ix] = q; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1840 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1841 |
/*------------------------------------------------------------------------ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1842 |
*------------------------------------------------------------------------*/ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1843 |
if ( ((q + 1) & 7) < 2 ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1844 |
rem = softfloat_shortShiftLeft128( rem.v64, rem.v0, 29 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1845 |
term = softfloat_mul128By32( sigB.v64, sigB.v0, q ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1846 |
rem = softfloat_sub128( rem.v64, rem.v0, term.v64, term.v0 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1847 |
if ( rem.v64 & UINT64_C( 0x8000000000000000 ) ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1848 |
--q; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1849 |
rem = softfloat_add128( rem.v64, rem.v0, sigB.v64, sigB.v0 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1850 |
} else if ( softfloat_le128( sigB.v64, sigB.v0, rem.v64, rem.v0 ) ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1851 |
++q; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1852 |
rem = softfloat_sub128( rem.v64, rem.v0, sigB.v64, sigB.v0 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1853 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1854 |
if ( rem.v64 | rem.v0 ) q |= 1; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1855 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1856 |
/*------------------------------------------------------------------------ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1857 |
*------------------------------------------------------------------------*/ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1858 |
sigZExtra = (uint64_t) ((uint_fast64_t) q<<60); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1859 |
term = softfloat_shortShiftLeft128( 0, qs[1], 54 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1860 |
sigZ = |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1861 |
softfloat_add128( |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1862 |
(uint_fast64_t) qs[2]<<19, ((uint_fast64_t) qs[0]<<25) + (q>>4), |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1863 |
term.v64, term.v0 |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1864 |
); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1865 |
return |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1866 |
softfloat_roundPackToF128( signZ, expZ, sigZ.v64, sigZ.v0, sigZExtra ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1867 |
/*------------------------------------------------------------------------ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1868 |
*------------------------------------------------------------------------*/ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1869 |
propagateNaN: |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1870 |
uiZ = softfloat_propagateNaNF128UI( uiA64, uiA0, uiB64, uiB0 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1871 |
goto uiZ; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1872 |
/*------------------------------------------------------------------------ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1873 |
*------------------------------------------------------------------------*/ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1874 |
invalid: |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1875 |
softfloat_raiseFlags( softfloat_flag_invalid ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1876 |
softfloat_commonNaNToF128M( (uint32_t*)&uiZ ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1877 |
// uiZ.v64 = defaultNaNF128UI64; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1878 |
// uiZ.v0 = defaultNaNF128UI0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1879 |
goto uiZ; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1880 |
/*------------------------------------------------------------------------ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1881 |
*------------------------------------------------------------------------*/ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1882 |
infinity: |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1883 |
uiZ.v64 = packToF128UI64( signZ, 0x7FFF, 0 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1884 |
goto uiZ0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1885 |
/*------------------------------------------------------------------------ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1886 |
*------------------------------------------------------------------------*/ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1887 |
zero: |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1888 |
uiZ.v64 = packToF128UI64( signZ, 0, 0 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1889 |
uiZ0: |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1890 |
uiZ.v0 = 0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1891 |
uiZ: |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1892 |
uZ.ui = uiZ; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1893 |
return uZ.f; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1894 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1895 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1896 |
static float128_t |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1897 |
f128_rem( float128_t a, float128_t b ) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1898 |
{ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1899 |
union ui128_f128 uA; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1900 |
uint_fast64_t uiA64, uiA0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1901 |
bool signA; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1902 |
int_fast32_t expA; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1903 |
struct uint128 sigA; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1904 |
union ui128_f128 uB; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1905 |
uint_fast64_t uiB64, uiB0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1906 |
int_fast32_t expB; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1907 |
struct uint128 sigB; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1908 |
struct exp32_sig128 normExpSig; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1909 |
struct uint128 rem; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1910 |
int_fast32_t expDiff; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1911 |
uint_fast32_t q, recip32; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1912 |
uint_fast64_t q64; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1913 |
struct uint128 term, altRem, meanRem; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1914 |
bool signRem; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1915 |
struct uint128 uiZ; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1916 |
union ui128_f128 uZ; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1917 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1918 |
/*------------------------------------------------------------------------ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1919 |
*------------------------------------------------------------------------*/ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1920 |
uA.f = a; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1921 |
uiA64 = uA.ui.v64; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1922 |
uiA0 = uA.ui.v0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1923 |
signA = signF128UI64( uiA64 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1924 |
expA = expF128UI64( uiA64 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1925 |
sigA.v64 = fracF128UI64( uiA64 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1926 |
sigA.v0 = uiA0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1927 |
uB.f = b; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1928 |
uiB64 = uB.ui.v64; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1929 |
uiB0 = uB.ui.v0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1930 |
expB = expF128UI64( uiB64 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1931 |
sigB.v64 = fracF128UI64( uiB64 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1932 |
sigB.v0 = uiB0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1933 |
/*------------------------------------------------------------------------ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1934 |
*------------------------------------------------------------------------*/ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1935 |
if ( expA == 0x7FFF ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1936 |
if ( |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1937 |
(sigA.v64 | sigA.v0) || ((expB == 0x7FFF) && (sigB.v64 | sigB.v0)) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1938 |
) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1939 |
goto propagateNaN; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1940 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1941 |
goto invalid; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1942 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1943 |
if ( expB == 0x7FFF ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1944 |
if ( sigB.v64 | sigB.v0 ) goto propagateNaN; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1945 |
return a; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1946 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1947 |
/*------------------------------------------------------------------------ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1948 |
*------------------------------------------------------------------------*/ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1949 |
if ( ! expB ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1950 |
if ( ! (sigB.v64 | sigB.v0) ) goto invalid; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1951 |
normExpSig = softfloat_normSubnormalF128Sig( sigB.v64, sigB.v0 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1952 |
expB = normExpSig.exp; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1953 |
sigB = normExpSig.sig; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1954 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1955 |
if ( ! expA ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1956 |
if ( ! (sigA.v64 | sigA.v0) ) return a; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1957 |
normExpSig = softfloat_normSubnormalF128Sig( sigA.v64, sigA.v0 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1958 |
expA = normExpSig.exp; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1959 |
sigA = normExpSig.sig; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1960 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1961 |
/*------------------------------------------------------------------------ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1962 |
*------------------------------------------------------------------------*/ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1963 |
sigA.v64 |= UINT64_C( 0x0001000000000000 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1964 |
sigB.v64 |= UINT64_C( 0x0001000000000000 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1965 |
rem = sigA; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1966 |
expDiff = expA - expB; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1967 |
if ( expDiff < 1 ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1968 |
if ( expDiff < -1 ) return a; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1969 |
if ( expDiff ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1970 |
--expB; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1971 |
sigB = softfloat_add128( sigB.v64, sigB.v0, sigB.v64, sigB.v0 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1972 |
q = 0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1973 |
} else { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1974 |
q = softfloat_le128( sigB.v64, sigB.v0, rem.v64, rem.v0 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1975 |
if ( q ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1976 |
rem = softfloat_sub128( rem.v64, rem.v0, sigB.v64, sigB.v0 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1977 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1978 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1979 |
} else { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1980 |
recip32 = softfloat_approxRecip32_1( sigB.v64>>17 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1981 |
expDiff -= 30; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1982 |
for (;;) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1983 |
q64 = (uint_fast64_t) (uint32_t) (rem.v64>>19) * recip32; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1984 |
if ( expDiff < 0 ) break; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1985 |
q = (q64 + 0x80000000)>>32; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1986 |
rem = softfloat_shortShiftLeft128( rem.v64, rem.v0, 29 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1987 |
term = softfloat_mul128By32( sigB.v64, sigB.v0, q ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1988 |
rem = softfloat_sub128( rem.v64, rem.v0, term.v64, term.v0 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1989 |
if ( rem.v64 & UINT64_C( 0x8000000000000000 ) ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1990 |
rem = softfloat_add128( rem.v64, rem.v0, sigB.v64, sigB.v0 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1991 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1992 |
expDiff -= 29; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1993 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1994 |
/*-------------------------------------------------------------------- |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1995 |
| (`expDiff' cannot be less than -29 here.) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1996 |
*--------------------------------------------------------------------*/ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1997 |
q = (uint32_t) (q64>>32)>>(~expDiff & 31); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1998 |
rem = softfloat_shortShiftLeft128( rem.v64, rem.v0, expDiff + 30 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
1999 |
term = softfloat_mul128By32( sigB.v64, sigB.v0, q ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2000 |
rem = softfloat_sub128( rem.v64, rem.v0, term.v64, term.v0 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2001 |
if ( rem.v64 & UINT64_C( 0x8000000000000000 ) ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2002 |
altRem = softfloat_add128( rem.v64, rem.v0, sigB.v64, sigB.v0 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2003 |
goto selectRem; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2004 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2005 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2006 |
/*------------------------------------------------------------------------ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2007 |
*------------------------------------------------------------------------*/ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2008 |
do { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2009 |
altRem = rem; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2010 |
++q; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2011 |
rem = softfloat_sub128( rem.v64, rem.v0, sigB.v64, sigB.v0 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2012 |
} while ( ! (rem.v64 & UINT64_C( 0x8000000000000000 )) ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2013 |
selectRem: |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2014 |
meanRem = softfloat_add128( rem.v64, rem.v0, altRem.v64, altRem.v0 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2015 |
if ( |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2016 |
(meanRem.v64 & UINT64_C( 0x8000000000000000 )) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2017 |
|| (! (meanRem.v64 | meanRem.v0) && (q & 1)) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2018 |
) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2019 |
rem = altRem; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2020 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2021 |
signRem = signA; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2022 |
if ( rem.v64 & UINT64_C( 0x8000000000000000 ) ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2023 |
signRem = ! signRem; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2024 |
rem = softfloat_sub128( 0, 0, rem.v64, rem.v0 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2025 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2026 |
return softfloat_normRoundPackToF128( signRem, expB - 1, rem.v64, rem.v0 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2027 |
/*------------------------------------------------------------------------ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2028 |
*------------------------------------------------------------------------*/ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2029 |
propagateNaN: |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2030 |
uiZ = softfloat_propagateNaNF128UI( uiA64, uiA0, uiB64, uiB0 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2031 |
goto uiZ; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2032 |
/*------------------------------------------------------------------------ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2033 |
*------------------------------------------------------------------------*/ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2034 |
invalid: |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2035 |
softfloat_raiseFlags( softfloat_flag_invalid ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2036 |
softfloat_commonNaNToF128M( (uint32_t*)&uiZ ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2037 |
// uiZ.v64 = defaultNaNF128UI64; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2038 |
// uiZ.v0 = defaultNaNF128UI0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2039 |
uiZ: |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2040 |
uZ.ui = uiZ; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2041 |
return uZ.f; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2042 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2043 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2044 |
bool |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2045 |
f128_isNan( float128_t a) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2046 |
int_fast32_t expA; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2047 |
struct uint128 sigA; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2048 |
uint_fast64_t uiA64, uiA0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2049 |
union ui128_f128 uA; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2050 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2051 |
uA.f = a; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2052 |
uiA64 = uA.ui.v64; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2053 |
uiA0 = uA.ui.v0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2054 |
return isNaNF128UI( uiA64, uiA0 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2055 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2056 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2057 |
bool |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2058 |
f128_isInf( float128_t a) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2059 |
int_fast32_t expA; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2060 |
struct uint128 sigA; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2061 |
uint_fast64_t uiA64, uiA0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2062 |
union ui128_f128 uA; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2063 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2064 |
uA.f = a; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2065 |
uiA64 = uA.ui.v64; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2066 |
uiA0 = uA.ui.v0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2067 |
return isInfF128UI( uiA64, uiA0 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2068 |
// expA = expF128UI64( uiA64 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2069 |
// sigA.v64 = fracF128UI64( uiA64 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2070 |
// sigA.v0 = uiA0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2071 |
// |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2072 |
// if ( expA == 0x7FFF ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2073 |
// if ( sigA.v64 == 0 ) return 1; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2074 |
// } |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2075 |
// return 0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2076 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2077 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2078 |
static bool |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2079 |
f128M_eq( float128_t* aPtr, float128_t* bPtr ) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2080 |
{ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2081 |
union ui128_f128 uA; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2082 |
uint_fast64_t uiA64, uiA0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2083 |
union ui128_f128 uB; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2084 |
uint_fast64_t uiB64, uiB0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2085 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2086 |
uA.f = *aPtr; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2087 |
uiA64 = uA.ui.v64; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2088 |
uiA0 = uA.ui.v0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2089 |
uB.f = *bPtr; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2090 |
uiB64 = uB.ui.v64; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2091 |
uiB0 = uB.ui.v0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2092 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2093 |
// fprintf(stderr, "isNaNF128UI(a): %d\n", isNaNF128UI( uiA64, uiA0 )); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2094 |
// fprintf(stderr, "isNaNF128UI(a): %d\n", isNaNF128UI( uiB64, uiB0 )); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2095 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2096 |
if ( isNaNF128UI( uiA64, uiA0 ) || isNaNF128UI( uiB64, uiB0 ) ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2097 |
if ( |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2098 |
softfloat_isSigNaNF128UI( uiA64, uiA0 ) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2099 |
|| softfloat_isSigNaNF128UI( uiB64, uiB0 ) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2100 |
) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2101 |
softfloat_raiseFlags( softfloat_flag_invalid ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2102 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2103 |
return 0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2104 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2105 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2106 |
// fprintf(stderr, "uiA0 == uiB0: %d\n", (uiA0 == uiB0)); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2107 |
// fprintf(stderr, "uiA64 == uiB64: %d\n", (uiA64 == uiB64)); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2108 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2109 |
return |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2110 |
(uiA0 == uiB0) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2111 |
&& ( (uiA64 == uiB64) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2112 |
|| (! uiA0 && ! ((uiA64 | uiB64) & UINT64_C( 0x7FFFFFFFFFFFFFFF ))) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2113 |
); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2114 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2115 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2116 |
static bool |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2117 |
f128M_lt( float128_t* aPtr, float128_t* bPtr ) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2118 |
{ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2119 |
union ui128_f128 uA; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2120 |
uint_fast64_t uiA64, uiA0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2121 |
union ui128_f128 uB; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2122 |
uint_fast64_t uiB64, uiB0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2123 |
bool signA, signB; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2124 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2125 |
uA.f = *aPtr; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2126 |
uiA64 = uA.ui.v64; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2127 |
uiA0 = uA.ui.v0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2128 |
uB.f = *bPtr; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2129 |
uiB64 = uB.ui.v64; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2130 |
uiB0 = uB.ui.v0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2131 |
if ( isNaNF128UI( uiA64, uiA0 ) || isNaNF128UI( uiB64, uiB0 ) ) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2132 |
softfloat_raiseFlags( softfloat_flag_invalid ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2133 |
return 0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2134 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2135 |
signA = signF128UI64( uiA64 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2136 |
signB = signF128UI64( uiB64 ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2137 |
return |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2138 |
(signA != signB) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2139 |
? signA |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2140 |
&& (((uiA64 | uiB64) & UINT64_C( 0x7FFFFFFFFFFFFFFF )) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2141 |
| uiA0 | uiB0) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2142 |
: ((uiA64 != uiB64) || (uiA0 != uiB0)) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2143 |
&& (signA ^ softfloat_lt128( uiA64, uiA0, uiB64, uiB0 )); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2144 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2145 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2146 |
static inline void |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2147 |
f128M_div( const float128_t *aPtr, const float128_t *bPtr, float128_t *zPtr ) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2148 |
{ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2149 |
*zPtr = f128_div( *aPtr, *bPtr ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2150 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2151 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2152 |
static inline void |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2153 |
f128M_rem( const float128_t *aPtr, const float128_t *bPtr, float128_t *zPtr ) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2154 |
{ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2155 |
*zPtr = f128_rem( *aPtr, *bPtr ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2156 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2157 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2158 |
static inline float128_t |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2159 |
f128_negate( float128_t a) { |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2160 |
struct uint128 sigA; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2161 |
uint_fast64_t uiA64, uiA0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2162 |
union ui128_f128 uA; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2163 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2164 |
uA.f = a; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2165 |
uiA64 = uA.ui.v64; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2166 |
uiA0 = uA.ui.v0; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2167 |
if (isNaNF128UI( uiA64, uiA0 )) return a; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2168 |
uA.ui.v64 ^= UINT64_C(0x8000000000000000); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2169 |
return uA.f; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2170 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2171 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2172 |
static inline void |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2173 |
f128M_negate( const float128_t *aPtr, float128_t *zPtr ) |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2174 |
{ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2175 |
*zPtr = f128_negate( *aPtr ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2176 |
} |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2177 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2178 |
#endif // SUPPORT_QUADFLOAT |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2179 |
|
5267 | 2180 |
%} |
4992 | 2181 |
! ! |
4991 | 2182 |
|
4983 | 2183 |
!QuadFloat class methodsFor:'documentation'! |
2184 |
||
2185 |
documentation |
|
2186 |
" |
|
2187 |
QuadFloats represent rational numbers with limited precision |
|
5007 | 2188 |
and are mapped to IEEE quadruple precision format (128bit), |
2189 |
also called binary128. |
|
2190 |
||
4983 | 2191 |
If the underlying cpu supports them natively, the machine format (long double) is |
2192 |
used. Otherwise, a software emulation is done, which is much slower. |
|
2193 |
Thus only use them, if you really need the additional precision; |
|
2194 |
if not, use Float (which are doubles) or LongFloats which usually have IEEE extended precision (80bit). |
|
2195 |
||
2196 |
QuadFloats give you definite 128 bit quadruple floats, |
|
2197 |
thus, code using quadFloats is guaranteed to be portable from one architecture to another. |
|
2198 |
||
2199 |
Representation: |
|
4991 | 2200 |
128bit quadruple IEEE floats (16bytes); |
2201 |
112 bit mantissa, |
|
2202 |
16 bit exponent, |
|
2203 |
34 decimal digits (approx.) |
|
4983 | 2204 |
|
4992 | 2205 |
On Sparc CPUs, this is a native supported type (long double) and fast; |
2206 |
on x86 CPUs, this is emulated and slow. |
|
2207 |
||
4983 | 2208 |
Mixed mode arithmetic: |
5007 | 2209 |
quadFloat op anyFloat -> quadFloat |
2210 |
anyFloat op quadFloat -> quadFloat |
|
4983 | 2211 |
|
2212 |
Range and precision of storage formats: see LimitedPrecisionReal >> documentation |
|
2213 |
||
2214 |
[author:] |
|
4991 | 2215 |
Claus Gittinger |
4983 | 2216 |
|
2217 |
[see also:] |
|
4991 | 2218 |
Number |
2219 |
Float ShortFloat LongFloat Fraction FixedPoint Integer Complex |
|
2220 |
FloatArray DoubleArray |
|
2221 |
https://en.wikipedia.org/wiki/Extended_precision |
|
4983 | 2222 |
" |
2223 |
! ! |
|
2224 |
||
2225 |
!QuadFloat class methodsFor:'instance creation'! |
|
2226 |
||
2227 |
basicNew |
|
2228 |
"return a new quadFloat - here we return 0.0 |
|
2229 |
- QuadFloats are usually NOT created this way ... |
|
2230 |
Its implemented here to allow things like binary store & load |
|
2231 |
of quadFloats. |
|
2232 |
(but it is not a good idea to store the bits of a float - the reader might have a |
|
2233 |
totally different representation - so floats should be |
|
2234 |
binary stored in a device independent format)." |
|
2235 |
||
2236 |
%{ /* NOCONTEXT */ |
|
4993 | 2237 |
#ifdef SUPPORT_QUADFLOAT |
4983 | 2238 |
OBJ newFloat; |
4991 | 2239 |
|
2240 |
if (sizeof(long double) == sizeof(float128_t)) { |
|
2241 |
__qMKLFLOAT(newFloat, 0.0); /* OBJECT ALLOCATION */ |
|
4983 | 2242 |
} else { |
5269
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2243 |
float128_t qf; |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2244 |
f64_to_f128M(0.0, &qf); |
4991 | 2245 |
__qMKQFLOAT(newFloat, qf); /* OBJECT ALLOCATION */ |
4983 | 2246 |
} |
2247 |
RETURN (newFloat); |
|
4993 | 2248 |
#endif /* SUPPORT_QUADFLOAT */ |
2249 |
%}. |
|
2250 |
self error:'QuadFloats not supported on this patform' |
|
4983 | 2251 |
|
2252 |
"Created: / 06-06-2019 / 17:18:58 / Claus Gittinger" |
|
2253 |
! |
|
2254 |
||
2255 |
fromFloat:aFloat |
|
2256 |
"return a new quadFloat, given a float value" |
|
2257 |
||
2258 |
%{ /* NOCONTEXT */ |
|
4993 | 2259 |
#ifdef SUPPORT_QUADFLOAT |
4983 | 2260 |
OBJ newFloat; |
2261 |
||
2262 |
if (__isFloatLike(aFloat)) { |
|
5269
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2263 |
float64_t f = __floatVal(aFloat); |
4991 | 2264 |
float128_t qf; |
2265 |
||
5269
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2266 |
f64_to_f128M(f, &qf); |
4991 | 2267 |
__qMKQFLOAT(newFloat, qf); /* OBJECT ALLOCATION */ |
2268 |
RETURN (newFloat); |
|
4983 | 2269 |
} |
4993 | 2270 |
#endif /* SUPPORT_QUADFLOAT */ |
4983 | 2271 |
%}. |
4993 | 2272 |
aFloat isFloat ifTrue:[ |
4997 | 2273 |
self errorUnsupported |
4993 | 2274 |
]. |
4997 | 2275 |
ArgumentError raise |
4983 | 2276 |
|
2277 |
" |
|
2278 |
QuadFloat fromFloat:123.0 |
|
2279 |
123.0 asQuadFloat |
|
2280 |
123 asQuadFloat |
|
2281 |
" |
|
2282 |
||
2283 |
"Created: / 06-06-2019 / 18:01:03 / Claus Gittinger" |
|
5011 | 2284 |
! |
2285 |
||
5017 | 2286 |
fromInteger:anInteger |
2287 |
"return a new quadFloat, given an integer value" |
|
2288 |
||
2289 |
%{ /* NOCONTEXT */ |
|
2290 |
#ifdef SUPPORT_QUADFLOAT |
|
2291 |
OBJ newFloat; |
|
2292 |
||
2293 |
if (__isSmallInteger(anInteger)) { |
|
2294 |
INT iVal = __intVal(anInteger); |
|
2295 |
float128_t qf; |
|
2296 |
||
5269
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2297 |
#if __POINTER_SIZE__ == 4 |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2298 |
i32_to_f128M( iVal, &qf ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2299 |
else |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2300 |
i64_to_f128M( iVal, &qf ); |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2301 |
#endif |
5017 | 2302 |
__qMKQFLOAT(newFloat, qf); /* OBJECT ALLOCATION */ |
2303 |
RETURN (newFloat); |
|
2304 |
} |
|
2305 |
#endif /* SUPPORT_QUADFLOAT */ |
|
2306 |
%}. |
|
2307 |
^ super fromInteger:anInteger |
|
2308 |
||
2309 |
" |
|
2310 |
QuadFloat fromInteger:123 |
|
2311 |
123 asQuadFloat |
|
2312 |
" |
|
2313 |
! |
|
2314 |
||
5014 | 2315 |
fromLongFloat:aFloat |
2316 |
"return a new quadFloat, given a long float value" |
|
2317 |
||
2318 |
%{ /* NOCONTEXT */ |
|
5269
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2319 |
#ifdef SUPPORT_QUADFLOAT |
5014 | 2320 |
OBJ newFloat; |
2321 |
union { |
|
2322 |
LONGFLOAT_t lf; // is long double |
|
2323 |
extFloat80_t ef; // is 80bit ext |
|
2324 |
float128_t qf; // is 128bit quad |
|
2325 |
} u; |
|
2326 |
||
2327 |
if (__isLongFloat(aFloat)) { |
|
2328 |
u.lf = __longFloatVal(aFloat); |
|
2329 |
||
2330 |
if (sizeof(LONGFLOAT_t) == 16) { |
|
2331 |
// longFloat is already 128 bits in size (sparc) |
|
2332 |
__qMKQFLOAT(newFloat, u.qf); /* OBJECT ALLOCATION */ |
|
2333 |
RETURN (newFloat); |
|
2334 |
} |
|
2335 |
if (sizeof(LONGFLOAT_t) < 16) { |
|
2336 |
// assume 80bit extended float format (amd64, x86_64) |
|
2337 |
u.qf = extF80_to_f128( u.ef); |
|
2338 |
__qMKQFLOAT(newFloat, u.qf); /* OBJECT ALLOCATION */ |
|
2339 |
RETURN (newFloat); |
|
2340 |
} |
|
2341 |
// fall into error case |
|
2342 |
} |
|
2343 |
#endif /* SUPPORT_QUADFLOAT */ |
|
2344 |
%}. |
|
2345 |
aFloat isLongFloat ifTrue:[ |
|
2346 |
self errorUnsupported |
|
2347 |
]. |
|
2348 |
ArgumentError raise |
|
2349 |
||
2350 |
" |
|
2351 |
QuadFloat fromLongFloat:123.0 asLongFloat |
|
2352 |
" |
|
2353 |
! |
|
2354 |
||
5011 | 2355 |
fromShortFloat:aShortFloat |
2356 |
"return a new quadFloat, given a float value" |
|
2357 |
||
5013 | 2358 |
^ self fromFloat:(aShortFloat asFloat) |
5011 | 2359 |
|
2360 |
" |
|
2361 |
QuadFloat fromShortFloat:123.0 asShortFloat |
|
2362 |
" |
|
2363 |
||
2364 |
"Created: / 08-06-2019 / 03:28:37 / Claus Gittinger" |
|
4983 | 2365 |
! ! |
2366 |
||
2367 |
!QuadFloat class methodsFor:'coercing & converting'! |
|
2368 |
||
2369 |
coerce:aNumber |
|
2370 |
"convert the argument aNumber into an instance of the receiver's class and return it." |
|
2371 |
||
2372 |
^ aNumber asQuadFloat. |
|
2373 |
||
2374 |
"Created: / 06-06-2019 / 16:51:01 / Claus Gittinger" |
|
2375 |
! ! |
|
2376 |
||
2377 |
!QuadFloat class methodsFor:'constants'! |
|
2378 |
||
2379 |
NaN |
|
5011 | 2380 |
"return a quadFloat which represents not-a-Number (i.e. an invalid number)" |
2381 |
||
2382 |
|nan| |
|
4983 | 2383 |
|
2384 |
NaN isNil ifTrue:[ |
|
5011 | 2385 |
%{ /* NOCONTEXT */ |
5269
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2386 |
#ifdef SUPPORT_QUADFLOAT |
5011 | 2387 |
{ |
2388 |
OBJ newFloat; |
|
2389 |
float128_t qf; |
|
2390 |
||
5014 | 2391 |
softfloat_commonNaNToF128M( (uint32_t*)(&qf) ); |
5011 | 2392 |
__qMKQFLOAT(newFloat, qf); /* OBJECT ALLOCATION */ |
2393 |
nan = newFloat; |
|
2394 |
} |
|
2395 |
#endif /* SUPPORT_QUADFLOAT */ |
|
2396 |
%}. |
|
2397 |
NaN := nan |
|
4983 | 2398 |
]. |
2399 |
^ NaN |
|
2400 |
! |
|
2401 |
||
2402 |
e |
|
2403 |
"return the constant e as quadFloat" |
|
2404 |
||
2405 |
E isNil ifTrue:[ |
|
4991 | 2406 |
"/ eDigits has enough digits for 128bit IEEE quads |
2407 |
"/ do not use as a literal constant here - we cannot depend on the underlying C-compiler here... |
|
2408 |
E := self readFrom:(Number eDigits) |
|
4983 | 2409 |
]. |
2410 |
^ E |
|
2411 |
||
2412 |
"Created: / 06-06-2019 / 17:01:54 / Claus Gittinger" |
|
2413 |
! |
|
2414 |
||
5017 | 2415 |
infinity |
2416 |
"return a quadFloat which represents +INF" |
|
2417 |
||
2418 |
|inf| |
|
2419 |
||
2420 |
PositiveInfinity isNil ifTrue:[ |
|
2421 |
%{ /* NOCONTEXT */ |
|
5269
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2422 |
#ifdef SUPPORT_QUADFLOAT |
5017 | 2423 |
{ |
2424 |
OBJ newFloat; |
|
2425 |
struct uint128 uiZ; |
|
2426 |
union ui128_f128 uZ; |
|
2427 |
float128_t qf; |
|
2428 |
||
2429 |
uiZ.v64 = packToF128UI64( 0, 0x7FFF, 0 ); |
|
2430 |
uiZ.v0 = 0; |
|
2431 |
uZ.ui = uiZ; |
|
2432 |
qf = uZ.f; |
|
2433 |
__qMKQFLOAT(newFloat, qf); /* OBJECT ALLOCATION */ |
|
2434 |
inf = newFloat; |
|
2435 |
} |
|
2436 |
#endif /* SUPPORT_QUADFLOAT */ |
|
2437 |
%}. |
|
2438 |
PositiveInfinity := inf |
|
2439 |
]. |
|
2440 |
^ PositiveInfinity |
|
2441 |
||
2442 |
"Created: / 08-06-2019 / 14:05:26 / Claus Gittinger" |
|
2443 |
! |
|
2444 |
||
5012 | 2445 |
negativeInfinity |
2446 |
"return a quadFloat which represents -INF" |
|
2447 |
||
2448 |
|inf| |
|
2449 |
||
2450 |
NegativeInfinity isNil ifTrue:[ |
|
2451 |
%{ /* NOCONTEXT */ |
|
5269
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2452 |
#ifdef SUPPORT_QUADFLOAT |
5013 | 2453 |
{ |
2454 |
OBJ newFloat; |
|
2455 |
struct uint128 uiZ; |
|
2456 |
union ui128_f128 uZ; |
|
2457 |
float128_t qf; |
|
5012 | 2458 |
|
5013 | 2459 |
uiZ.v64 = packToF128UI64( 1, 0x7FFF, 0 ); |
2460 |
uiZ.v0 = 0; |
|
2461 |
uZ.ui = uiZ; |
|
2462 |
qf = uZ.f; |
|
2463 |
__qMKQFLOAT(newFloat, qf); /* OBJECT ALLOCATION */ |
|
2464 |
inf = newFloat; |
|
2465 |
} |
|
5012 | 2466 |
#endif /* SUPPORT_QUADFLOAT */ |
2467 |
%}. |
|
5013 | 2468 |
NegativeInfinity := inf |
5012 | 2469 |
]. |
2470 |
^ NegativeInfinity |
|
2471 |
||
2472 |
"Created: / 08-06-2019 / 14:05:50 / Claus Gittinger" |
|
2473 |
! |
|
2474 |
||
5264 | 2475 |
phi |
2476 |
"return the constant phi as quadFloat" |
|
2477 |
||
2478 |
Phi isNil ifTrue:[ |
|
5269
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2479 |
"/ phiDigits has enough digits for 128bit IEEE quads |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2480 |
"/ do not use as a literal constant here - we cannot depend on the underlying C-compiler here... |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2481 |
Phi := self readFrom:(Number phiDigits) |
5264 | 2482 |
]. |
2483 |
^ Phi |
|
2484 |
||
2485 |
||
2486 |
! |
|
2487 |
||
4983 | 2488 |
pi |
2489 |
"return the constant pi as quadFloat" |
|
2490 |
||
2491 |
Pi isNil ifTrue:[ |
|
4991 | 2492 |
"/ piDigits has enough digits for 128bit IEEE quads |
2493 |
"/ do not use as a literal constant here - we cannot depend on the underlying C-compiler here... |
|
2494 |
Pi := self readFrom:(Number piDigits) |
|
4983 | 2495 |
]. |
2496 |
^ Pi |
|
2497 |
||
2498 |
"Created: / 06-06-2019 / 17:09:51 / Claus Gittinger" |
|
5006 | 2499 |
! |
2500 |
||
2501 |
unity |
|
2502 |
"return the neutral element for multiplication (1.0) as QuadFloat" |
|
2503 |
||
2504 |
QuadFloatOne isNil ifTrue:[ |
|
5007 | 2505 |
QuadFloatOne := 1.0 asQuadFloat. |
5006 | 2506 |
]. |
2507 |
^ QuadFloatOne |
|
2508 |
||
2509 |
"Created: / 07-06-2019 / 03:26:38 / Claus Gittinger" |
|
5008 | 2510 |
! |
2511 |
||
2512 |
zero |
|
2513 |
"return the neutral element for addition (0.0) as QuadFloat" |
|
2514 |
||
2515 |
QuadFloatZero isNil ifTrue:[ |
|
5011 | 2516 |
QuadFloatZero := 0.0 asQuadFloat |
5008 | 2517 |
]. |
2518 |
^ QuadFloatZero |
|
2519 |
||
2520 |
"Created: / 07-06-2019 / 09:22:56 / Claus Gittinger" |
|
4983 | 2521 |
! ! |
2522 |
||
5003 | 2523 |
!QuadFloat class methodsFor:'error reportng'! |
4994 | 2524 |
|
4997 | 2525 |
errorUnsupported |
2526 |
self error:'QuadFloats not supported on this patform' |
|
2527 |
||
5003 | 2528 |
"Created: / 07-06-2019 / 02:44:39 / Claus Gittinger" |
4994 | 2529 |
! ! |
2530 |
||
5005 | 2531 |
!QuadFloat class methodsFor:'queries'! |
2532 |
||
5017 | 2533 |
epsilon |
2534 |
"return the maximum relative spacing of instances of mySelf |
|
2535 |
(i.e. the value-delta of the least significant bit)" |
|
2536 |
||
2537 |
Epsilon isNil ifTrue:[ |
|
5020 | 2538 |
Epsilon := self computeEpsilon. |
5017 | 2539 |
]. |
2540 |
^ Epsilon |
|
2541 |
||
2542 |
" |
|
2543 |
self epsilon |
|
2544 |
" |
|
2545 |
||
2546 |
"Created: / 10-06-2019 / 21:21:18 / Claus Gittinger" |
|
2547 |
! |
|
2548 |
||
5018 | 2549 |
exponentCharacter |
2550 |
"return the character used to print between mantissa an exponent. |
|
2551 |
Also used by the scanner when reading numbers." |
|
2552 |
||
2553 |
^ $Q |
|
2554 |
||
2555 |
"Created: / 10-06-2019 / 21:28:04 / Claus Gittinger" |
|
2556 |
! |
|
2557 |
||
5025 | 2558 |
numBitsInExponent |
2559 |
"answer the number of bits in the exponent |
|
2560 |
the hidden bit is not counted here: |
|
2561 |
||
2562 |
This is an 128bit quadfloat, |
|
5027 | 2563 |
where 15 bits are available in the exponent: |
2564 |
seeeeeee eeeeeeee mmmmmmmm mmmmmmmm mmmmmmmm mmmmmmmm mmmmmmmm mmmmmmmm mmmmmmmm mmmmmmmm mmmmmmmm mmmmmmmm mmmmmmmm mmmmmmmm mmmmmmmm mmmmmmmm... |
|
5025 | 2565 |
" |
2566 |
||
2567 |
^ 15 |
|
2568 |
||
2569 |
" |
|
2570 |
1.0 class numBitsInExponent -> 11 |
|
2571 |
1.0 asShortFloat class numBitsInExponent -> 8 |
|
2572 |
1.0 asLongFloat class numBitsInExponent -> 15 |
|
2573 |
1.0 asQuadFloat class numBitsInExponent -> 15 |
|
2574 |
" |
|
2575 |
||
2576 |
"Created: / 11-06-2019 / 00:14:55 / Claus Gittinger" |
|
2577 |
! |
|
2578 |
||
5005 | 2579 |
numBitsInMantissa |
2580 |
"answer the number of bits in the mantissa |
|
2581 |
the hidden bit is not counted here: |
|
2582 |
||
2583 |
This is an 128bit quadfloat, |
|
5007 | 2584 |
where 112 bits are available in the mantissa: |
2585 |
seeeeeee eeeeeeee mmmmmmmm mmmmmmmm mmmmmmmm mmmmmmmm mmmmmmmm mmmmmmmm mmmmmmmm mmmmmmmm mmmmmmmm mmmmmmmm mmmmmmmm mmmmmmmm mmmmmmmm mmmmmmmm... |
|
5005 | 2586 |
" |
2587 |
||
2588 |
^ 112 |
|
2589 |
||
2590 |
" |
|
2591 |
1.0 class numBitsInMantissa |
|
2592 |
1.0 asShortFloat class numBitsInMantissa |
|
2593 |
1.0 asLongFloat class numBitsInMantissa |
|
2594 |
1.0 asQuadFloat class numBitsInMantissa |
|
2595 |
" |
|
2596 |
||
2597 |
"Created: / 07-06-2019 / 03:24:20 / Claus Gittinger" |
|
5056 | 2598 |
! |
2599 |
||
2600 |
radix |
|
2601 |
"answer the radix of a QuadFloat's exponent |
|
2602 |
This is an IEEE float, which is represented as binary" |
|
2603 |
||
2604 |
^ 2 "must be careful here, whenever ST/X is used on VAX or a 370" |
|
2605 |
||
2606 |
"Created: / 19-07-2019 / 17:28:00 / Claus Gittinger" |
|
5005 | 2607 |
! ! |
2608 |
||
4994 | 2609 |
!QuadFloat methodsFor:'arithmetic'! |
2610 |
||
2611 |
* aNumber |
|
2612 |
"return the product of the receiver and the argument." |
|
2613 |
||
5074 | 2614 |
aNumber class == QuadFloat ifTrue:[ |
5269
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2615 |
^ aNumber productFromQuadFloat:self |
5074 | 2616 |
]. |
2617 |
||
5075 | 2618 |
thisContext isReallyRecursive ifTrue:[self error]. |
4994 | 2619 |
^ aNumber productFromQuadFloat:self |
2620 |
! |
|
2621 |
||
2622 |
+ aNumber |
|
2623 |
"return the sum of the receiver and the argument, aNumber" |
|
2624 |
||
2625 |
^ aNumber sumFromQuadFloat:self |
|
2626 |
! |
|
2627 |
||
2628 |
- aNumber |
|
2629 |
"return the difference of the receiver and the argument, aNumber" |
|
2630 |
||
2631 |
^ aNumber differenceFromQuadFloat:self |
|
2632 |
! |
|
2633 |
||
2634 |
/ aNumber |
|
2635 |
"return the quotient of the receiver and the argument, aNumber" |
|
2636 |
||
2637 |
aNumber isZero ifTrue:[ |
|
2638 |
" |
|
2639 |
No, you shalt not divide by zero |
|
2640 |
" |
|
2641 |
^ ZeroDivide raiseRequestWith:thisContext. |
|
2642 |
]. |
|
2643 |
^ aNumber quotientFromQuadFloat:self |
|
2644 |
! |
|
2645 |
||
5021 | 2646 |
negated |
2647 |
"return the receiver negated" |
|
2648 |
||
2649 |
%{ /* NOCONTEXT */ |
|
2650 |
#ifdef SUPPORT_QUADFLOAT |
|
2651 |
OBJ newFloat; |
|
2652 |
float128_t result, myVal; |
|
2653 |
||
2654 |
myVal = __quadFloatVal(self); |
|
5269
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2655 |
f128M_negate( &myVal, &result ); |
5021 | 2656 |
__qMKQFLOAT(newFloat, result); |
2657 |
RETURN ( newFloat ); |
|
2658 |
#endif |
|
2659 |
%}. |
|
5025 | 2660 |
! |
2661 |
||
2662 |
rem: aNumber |
|
2663 |
"return the floating point remainder of the receiver and the argument, aNumber" |
|
2664 |
||
2665 |
aNumber isZero ifTrue:[ |
|
2666 |
" |
|
2667 |
No, you shalt not divide by zero |
|
2668 |
" |
|
2669 |
^ ZeroDivide raiseRequestWith:thisContext. |
|
2670 |
]. |
|
2671 |
^ aNumber remainderFromLongFloat:self |
|
4994 | 2672 |
! ! |
2673 |
||
5008 | 2674 |
!QuadFloat methodsFor:'coercing & converting'! |
2675 |
||
2676 |
generality |
|
2677 |
"return the generality value - see ArithmeticValue>>retry:coercing:" |
|
2678 |
||
2679 |
^ 93 |
|
2680 |
||
2681 |
"Created: / 07-06-2019 / 09:30:58 / Claus Gittinger" |
|
2682 |
! ! |
|
2683 |
||
2684 |
!QuadFloat methodsFor:'comparing'! |
|
2685 |
||
2686 |
< aNumber |
|
2687 |
"return true, if the argument is greater" |
|
2688 |
||
2689 |
^ aNumber lessFromQuadFloat:self |
|
2690 |
||
2691 |
"Created: / 07-06-2019 / 09:25:47 / Claus Gittinger" |
|
2692 |
! |
|
2693 |
||
2694 |
= aNumber |
|
2695 |
"return true, if the argument represents the same numeric value |
|
2696 |
as the receiver, false otherwise" |
|
2697 |
||
2698 |
^ aNumber equalFromQuadFloat:self |
|
2699 |
||
2700 |
"Created: / 07-06-2019 / 09:25:27 / Claus Gittinger" |
|
2701 |
! |
|
2702 |
||
2703 |
hash |
|
2704 |
"return a number for hashing; redefined, since floats compare |
|
2705 |
by numeric value (i.e. 3.0 = 3), therefore 3.0 hash must be the same |
|
2706 |
as 3 hash." |
|
2707 |
||
2708 |
|i| |
|
2709 |
||
2710 |
(self >= SmallInteger minVal and:[self <= SmallInteger maxVal]) ifTrue:[ |
|
5011 | 2711 |
i := self asInteger. |
2712 |
self = i ifTrue:[ |
|
2713 |
^ i hash |
|
2714 |
]. |
|
5008 | 2715 |
]. |
2716 |
||
2717 |
^ self asFloat hash |
|
2718 |
||
2719 |
" |
|
2720 |
1.2345 hash |
|
2721 |
1.2345 asShortFloat hash |
|
2722 |
1.2345 asLongFloat hash |
|
2723 |
1.2345 asQuadFloat hash |
|
5011 | 2724 |
|
5008 | 2725 |
1.0 hash |
2726 |
1.0 asShortFloat hash |
|
2727 |
1.0 asLongFloat hash |
|
2728 |
1.0 asQuadFloat hash |
|
5011 | 2729 |
|
5008 | 2730 |
0.5 asShortFloat hash |
2731 |
0.5 asShortFloat hash |
|
2732 |
0.5 asLongFloat hash |
|
2733 |
0.5 asQuadFloat hash |
|
2734 |
||
2735 |
0.25 asShortFloat hash |
|
2736 |
0.25 asShortFloat hash |
|
2737 |
0.25 asLongFloat hash |
|
2738 |
0.25 asQuadFloat hash |
|
2739 |
" |
|
2740 |
||
2741 |
"Created: / 07-06-2019 / 09:28:07 / Claus Gittinger" |
|
2742 |
! ! |
|
2743 |
||
5003 | 2744 |
!QuadFloat methodsFor:'double dispatching'! |
2745 |
||
2746 |
differenceFromQuadFloat:aQuadFloat |
|
2747 |
%{ |
|
2748 |
#ifdef SUPPORT_QUADFLOAT |
|
2749 |
OBJ newFloat; |
|
2750 |
float128_t result, myVal, argVal; |
|
2751 |
||
2752 |
myVal = __quadFloatVal(self); |
|
2753 |
argVal = __quadFloatVal(aQuadFloat); |
|
5269
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2754 |
f128M_sub( &myVal, &argVal, &result ); |
5003 | 2755 |
__qMKQFLOAT(newFloat, result); |
2756 |
RETURN ( newFloat ); |
|
2757 |
#endif // SUPPORT_QUADFLOAT |
|
2758 |
%}. |
|
2759 |
self errorUnsupported |
|
2760 |
! |
|
2761 |
||
5005 | 2762 |
equalFromQuadFloat:aQuadFloat |
2763 |
"sent when aQuadFloat does not know how to compare agaist the receiver, self" |
|
5003 | 2764 |
|
2765 |
%{ |
|
2766 |
#ifdef SUPPORT_QUADFLOAT |
|
2767 |
OBJ newFloat; |
|
2768 |
float128_t result, myVal, argVal; |
|
2769 |
||
2770 |
myVal = __quadFloatVal(self); |
|
2771 |
argVal = __quadFloatVal(aQuadFloat); |
|
5269
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2772 |
RETURN (f128M_eq( &argVal, &myVal ) ? true : false); |
5003 | 2773 |
#endif // SUPPORT_QUADFLOAT |
2774 |
%}. |
|
2775 |
self errorUnsupported |
|
5011 | 2776 |
|
2777 |
"Modified: / 08-06-2019 / 13:31:48 / Claus Gittinger" |
|
5004 | 2778 |
! |
2779 |
||
5005 | 2780 |
lessFromQuadFloat:aQuadFloat |
2781 |
"sent when aQuadFloat does not know how to compare agaist the receiver, self" |
|
2782 |
||
2783 |
%{ |
|
2784 |
#ifdef SUPPORT_QUADFLOAT |
|
2785 |
OBJ newFloat; |
|
2786 |
float128_t result, myVal, argVal; |
|
2787 |
||
2788 |
myVal = __quadFloatVal(self); |
|
2789 |
argVal = __quadFloatVal(aQuadFloat); |
|
5269
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2790 |
RETURN (f128M_lt( &argVal, &myVal ) ? true : false); |
5005 | 2791 |
#endif // SUPPORT_QUADFLOAT |
2792 |
%}. |
|
2793 |
self errorUnsupported |
|
2794 |
! |
|
2795 |
||
5004 | 2796 |
productFromQuadFloat:aQuadFloat |
2797 |
"sent when aQuadFloat does not know how to multiply the receiver, self" |
|
2798 |
||
2799 |
%{ |
|
2800 |
#ifdef SUPPORT_QUADFLOAT |
|
2801 |
OBJ newFloat; |
|
2802 |
float128_t result, myVal, argVal; |
|
2803 |
||
2804 |
myVal = __quadFloatVal(self); |
|
2805 |
argVal = __quadFloatVal(aQuadFloat); |
|
5269
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2806 |
f128M_mul( &myVal, &argVal, &result ); |
5004 | 2807 |
__qMKQFLOAT(newFloat, result); |
2808 |
RETURN ( newFloat ); |
|
2809 |
#endif // SUPPORT_QUADFLOAT |
|
2810 |
%}. |
|
2811 |
self errorUnsupported |
|
2812 |
! |
|
2813 |
||
2814 |
quotientFromQuadFloat:aQuadFloat |
|
2815 |
"sent when aQuadFloat does not know how to multiply the receiver, self" |
|
2816 |
||
2817 |
%{ |
|
2818 |
#ifdef SUPPORT_QUADFLOAT |
|
2819 |
OBJ newFloat; |
|
2820 |
float128_t result, myVal, argVal; |
|
2821 |
||
2822 |
myVal = __quadFloatVal(self); |
|
2823 |
argVal = __quadFloatVal(aQuadFloat); |
|
5269
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2824 |
f128M_div( &myVal, &argVal, &result ); |
5004 | 2825 |
__qMKQFLOAT(newFloat, result); |
2826 |
RETURN ( newFloat ); |
|
2827 |
#endif // SUPPORT_QUADFLOAT |
|
2828 |
%}. |
|
2829 |
self errorUnsupported |
|
2830 |
! |
|
2831 |
||
5005 | 2832 |
sumFromQuadFloat:aQuadFloat |
2833 |
"sent when aQuadFloat does not know how to add the receiver, self" |
|
5004 | 2834 |
|
2835 |
%{ |
|
2836 |
#ifdef SUPPORT_QUADFLOAT |
|
2837 |
OBJ newFloat; |
|
2838 |
float128_t result, myVal, argVal; |
|
2839 |
||
2840 |
myVal = __quadFloatVal(self); |
|
2841 |
argVal = __quadFloatVal(aQuadFloat); |
|
5269
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2842 |
f128M_add( &myVal, &argVal, &result ); |
5005 | 2843 |
__qMKQFLOAT(newFloat, result); |
5004 | 2844 |
RETURN ( newFloat ); |
2845 |
#endif // SUPPORT_QUADFLOAT |
|
2846 |
%}. |
|
2847 |
self errorUnsupported |
|
5003 | 2848 |
! ! |
2849 |
||
2850 |
!QuadFloat methodsFor:'error reportng'! |
|
2851 |
||
2852 |
errorUnsupported |
|
2853 |
self class errorUnsupported |
|
2854 |
||
2855 |
"Modified: / 07-06-2019 / 02:44:51 / Claus Gittinger" |
|
2856 |
! ! |
|
2857 |
||
5025 | 2858 |
!QuadFloat methodsFor:'printing'! |
2859 |
||
2860 |
printOn:aStream |
|
5269
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2861 |
|mantissa exponent| |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2862 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2863 |
mantissa := self mantissa. |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2864 |
exponent := self exponent. |
5027 | 2865 |
|
5269
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2866 |
self exponent == 0 ifTrue:[ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2867 |
mantissa printOn:aStream. |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2868 |
aStream nextPutAll:'.0'. |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2869 |
^ self |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2870 |
]. |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2871 |
mantissa == 0 ifTrue:[ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2872 |
"/ a zero mantissa is impossible - except for zero and a few others |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2873 |
exponent == 0 ifTrue:[ aStream nextPutAll:'0.0'. ^ self]. |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2874 |
self == NaN ifTrue:[ aStream nextPutAll:'NAN'. ^ self ]. |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2875 |
self == NegativeInfinity ifTrue:[ aStream nextPutAll:'-INF'. ^ self]. |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2876 |
self == PositiveInfinity ifTrue:[ aStream nextPutAll:'INF'. ^ self]. |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2877 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2878 |
self error:'invalid largeFloat' mayProceed:true. |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2879 |
aStream nextPutAll:'Invalid'. ^ self. |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2880 |
]. |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2881 |
|
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2882 |
exponent >= 0 ifTrue:[ |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2883 |
(mantissa bitShift:exponent) printOn:aStream. |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2884 |
aStream nextPutAll:'.0'. |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2885 |
^ self |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2886 |
]. |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2887 |
((mantissa / (1 bitShift:exponent negated)) asFixedPoint:6) printOn:aStream. |
5025 | 2888 |
|
2889 |
"Created: / 11-06-2019 / 00:13:00 / Claus Gittinger" |
|
2890 |
! ! |
|
2891 |
||
5011 | 2892 |
!QuadFloat methodsFor:'queries'! |
2893 |
||
2894 |
isFinite |
|
5194 | 2895 |
"return true, if the receiver is a finite float (not NaN and not +/-INF)" |
5011 | 2896 |
|
2897 |
%{ /* NOCONTEXT */ |
|
5016 | 2898 |
#ifdef SUPPORT_QUADFLOAT |
5011 | 2899 |
float128_t myVal; |
2900 |
||
2901 |
myVal = __quadFloatVal(self); |
|
5269
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2902 |
RETURN ((f128_isInf(myVal) || f128_isNan(myVal)) ? false : true); |
5016 | 2903 |
#endif // SUPPORT_QUADFLOAT |
5011 | 2904 |
%}. |
2905 |
||
2906 |
" |
|
5269
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2907 |
1.0 isFinite |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2908 |
self NaN isFinite |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2909 |
self infinity isFinite |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2910 |
self negativeInfinity isFinite |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2911 |
(0.0 uncheckedDivide: 0.0) isFinite |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2912 |
(1.0 uncheckedDivide: 0.0) isFinite |
5020 | 2913 |
" |
2914 |
! |
|
2915 |
||
2916 |
isInfinite |
|
5194 | 2917 |
"return true, if the receiver is an infinite float (+Inf or -Inf)." |
5020 | 2918 |
|
2919 |
%{ /* NOCONTEXT */ |
|
2920 |
#ifdef SUPPORT_QUADFLOAT |
|
2921 |
float128_t myVal; |
|
2922 |
||
2923 |
myVal = __quadFloatVal(self); |
|
5269
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2924 |
RETURN (f128_isInf(myVal) ? true : false); |
5020 | 2925 |
#endif // SUPPORT_QUADFLOAT |
2926 |
%}. |
|
2927 |
||
2928 |
" |
|
5269
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2929 |
1.0 isFinite |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2930 |
1.0 isInfinite |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2931 |
self NaN isFinite |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2932 |
self NaN isInfinite |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2933 |
self infinity isFinite |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2934 |
self infinity isInfinite |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2935 |
self negativeInfinity isFinite |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2936 |
self negativeInfinity isInfinite |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2937 |
(0.0 uncheckedDivide: 0.0) isFinite |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2938 |
(1.0 uncheckedDivide: 0.0) isFinite |
5011 | 2939 |
" |
2940 |
! |
|
2941 |
||
2942 |
isNaN |
|
5194 | 2943 |
"return true, if the receiver is an invalid float (NaN - not a number). |
2944 |
These are not created by ST/X float operations (they raise an exception); |
|
2945 |
however, inline C-code could produce them." |
|
5011 | 2946 |
|
2947 |
%{ /* NOCONTEXT */ |
|
5016 | 2948 |
#ifdef SUPPORT_QUADFLOAT |
5011 | 2949 |
float128_t myVal; |
2950 |
||
2951 |
myVal = __quadFloatVal(self); |
|
5269
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2952 |
RETURN (f128_isNan(myVal) ? true : false); |
5016 | 2953 |
#endif // SUPPORT_QUADFLOAT |
5011 | 2954 |
%}. |
2955 |
||
2956 |
" |
|
5269
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2957 |
1.0 isFinite |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2958 |
self NaN isFinite |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2959 |
self infinity isFinite |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2960 |
(0.0 uncheckedDivide: 0.0) isFinite |
83163a7005f1
Fallback to version 1.36 - mingw couldn't compile
Stefan Vogel <sv@exept.de>
parents:
5268
diff
changeset
|
2961 |
(1.0 uncheckedDivide: 0.0) isFinite |
5011 | 2962 |
" |
2963 |
! ! |
|
2964 |
||
4983 | 2965 |
!QuadFloat class methodsFor:'documentation'! |
2966 |
||
2967 |
version_CVS |
|
2968 |
^ '$Header$' |
|
2969 |
! ! |
|
5268 | 2970 |