diff options
| author | Luciano Dittgen <luciano.dittgen@ossystems.com.br> | 2026-09-18 10:44:00 -0300 |
|---|---|---|
| committer | Luciano Dittgen <luciano.dittgen@ossystems.com.br> | 2026-09-21 16:12:45 -0300 |
| commit | a9341d1b77c0f77235e69eba59cd2144b3360ef7 (patch) | |
| tree | 7f6e244b0e72c685568f77d84a2c6fd29b99adaa | |
| parent | fc4e2822a38b60d1d053f1a8ad136a2755b9f5c6 (diff) | |
| download | meta-freescale-a9341d1b77c0f77235e69eba59cd2144b3360ef7.tar.gz | |
testfloat: Drop the 2a pin and use meta-oe's TestFloat 3e
The bundled 2a recipe cannot build on any current toolchain: its SPE
patch calls __builtin_spe_mfspefscr, removed in GCC 9, and includes
bits/nan.h, removed in glibc 2.26. qoriq-base.inc is included by the
arm, arm64 and ppc configs, so the pin also blocked meta-oe's portable
testfloat_3e on machines 2a could never build for anyway. Tested with
bitbake testfloat on p2020rdb: 3e builds and ships five binaries.
Signed-off-by: Luciano Dittgen <luciano.dittgen@ossystems.com.br>
(cherry picked from commit 75244dac69e48dbfdbfbae85e4fbb24c37d3b4de)
5 files changed, 0 insertions, 3190 deletions
diff --git a/conf/machine/include/qoriq-base.inc b/conf/machine/include/qoriq-base.inc index 4a42a8bd3..b71f3a580 100644 --- a/conf/machine/include/qoriq-base.inc +++ b/conf/machine/include/qoriq-base.inc | |||
| @@ -6,7 +6,6 @@ PREFERRED_PROVIDER_u-boot-tools-native ??= "u-boot-tools-native" | |||
| 6 | PREFERRED_PROVIDER_u-boot-mkimage-native ??= "u-boot-tools-native" | 6 | PREFERRED_PROVIDER_u-boot-mkimage-native ??= "u-boot-tools-native" |
| 7 | PREFERRED_PROVIDER_u-boot-mkimage ??= "u-boot-tools" | 7 | PREFERRED_PROVIDER_u-boot-mkimage ??= "u-boot-tools" |
| 8 | PREFERRED_PROVIDER_nativesdk-u-boot-mkimage ??= "nativesdk-u-boot-tools" | 8 | PREFERRED_PROVIDER_nativesdk-u-boot-mkimage ??= "nativesdk-u-boot-tools" |
| 9 | PREFERRED_VERSION_testfloat = "2a" | ||
| 10 | 9 | ||
| 11 | SOC_DEFAULT_IMAGE_FSTYPES = "tar.gz" | 10 | SOC_DEFAULT_IMAGE_FSTYPES = "tar.gz" |
| 12 | SOC_DEFAULT_IMAGE_FSTYPES:append:ls1043a = " wic.bz2" | 11 | SOC_DEFAULT_IMAGE_FSTYPES:append:ls1043a = " wic.bz2" |
diff --git a/recipes-extended/testfloat/files/SoftFloat-powerpc-1.patch b/recipes-extended/testfloat/files/SoftFloat-powerpc-1.patch deleted file mode 100644 index 51a0da191..000000000 --- a/recipes-extended/testfloat/files/SoftFloat-powerpc-1.patch +++ /dev/null | |||
| @@ -1,1428 +0,0 @@ | |||
| 1 | This patch adds PowerPC support in SoftFloat. | ||
| 2 | |||
| 3 | Upstream-Status: Pending | ||
| 4 | Signed-off-by: Ebony Zhu <ebony.zhu@freescale.com> | ||
| 5 | Signed-off-by: Liu Yu <Yu.Liu@freescale.com> | ||
| 6 | --- | ||
| 7 | SoftFloat-2b/processors/powerpc-GCC.h | 87 ++++ | ||
| 8 | SoftFloat-2b/softfloat/bits32/powerpc-GCC/Makefile | 26 ++ | ||
| 9 | SoftFloat-2b/softfloat/bits32/powerpc-GCC/milieu.h | 55 +++ | ||
| 10 | .../bits32/powerpc-GCC/softfloat-specialize | 252 ++++++++++++ | ||
| 11 | .../softfloat/bits32/powerpc-GCC/softfloat.h | 155 +++++++ | ||
| 12 | SoftFloat-2b/softfloat/bits64/powerpc-GCC/Makefile | 24 ++ | ||
| 13 | SoftFloat-2b/softfloat/bits64/powerpc-GCC/milieu.h | 55 +++ | ||
| 14 | .../bits64/powerpc-GCC/softfloat-specialize | 422 ++++++++++++++++++++ | ||
| 15 | .../softfloat/bits64/powerpc-GCC/softfloat.h | 269 +++++++++++++ | ||
| 16 | 9 files changed, 1345 insertions(+), 0 deletions(-) | ||
| 17 | create mode 100644 SoftFloat-2b/processors/powerpc-GCC.h | ||
| 18 | create mode 100644 SoftFloat-2b/softfloat/bits32/powerpc-GCC/Makefile | ||
| 19 | create mode 100644 SoftFloat-2b/softfloat/bits32/powerpc-GCC/milieu.h | ||
| 20 | create mode 100644 SoftFloat-2b/softfloat/bits32/powerpc-GCC/softfloat-specialize | ||
| 21 | create mode 100644 SoftFloat-2b/softfloat/bits32/powerpc-GCC/softfloat.h | ||
| 22 | create mode 100644 SoftFloat-2b/softfloat/bits64/powerpc-GCC/Makefile | ||
| 23 | create mode 100644 SoftFloat-2b/softfloat/bits64/powerpc-GCC/milieu.h | ||
| 24 | create mode 100644 SoftFloat-2b/softfloat/bits64/powerpc-GCC/softfloat-specialize | ||
| 25 | create mode 100644 SoftFloat-2b/softfloat/bits64/powerpc-GCC/softfloat.h | ||
| 26 | |||
| 27 | diff --git a/SoftFloat-2b/processors/powerpc-GCC.h b/SoftFloat-2b/processors/powerpc-GCC.h | ||
| 28 | new file mode 100644 | ||
| 29 | index 0000000..002a786 | ||
| 30 | --- /dev/null | ||
| 31 | +++ b/SoftFloat-2b/processors/powerpc-GCC.h | ||
| 32 | @@ -0,0 +1,87 @@ | ||
| 33 | +/* | ||
| 34 | + * This file is derived from processors/386-gcc.h, | ||
| 35 | + * the copyright for that material belongs to the original owners. | ||
| 36 | + * | ||
| 37 | + * Additional material and changes where applicable is: | ||
| 38 | + * Copyright (C) 2008 Freescale Semiconductor, Inc. All rights reserved. | ||
| 39 | + * | ||
| 40 | + * Author: Ebony Zhu, <ebony.zhu@freescale.com> | ||
| 41 | + * Yu Liu, <yu.liu@freescale.com> | ||
| 42 | + * | ||
| 43 | + * THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort has | ||
| 44 | + * been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT TIMES | ||
| 45 | + * RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO PERSONS | ||
| 46 | + * AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ALL LOSSES, | ||
| 47 | + * COSTS, OR OTHER PROBLEMS THEY INCUR DUE TO THE SOFTWARE, AND WHO FURTHERMORE | ||
| 48 | + * EFFECTIVELY INDEMNIFY JOHN HAUSER AND THE INTERNATIONAL COMPUTER SCIENCE | ||
| 49 | + * INSTITUTE (possibly via similar legal warning) AGAINST ALL LOSSES, COSTS, OR | ||
| 50 | + * OTHER PROBLEMS INCURRED BY THEIR CUSTOMERS AND CLIENTS DUE TO THE SOFTWARE. | ||
| 51 | + */ | ||
| 52 | + | ||
| 53 | +/*---------------------------------------------------------------------------- | ||
| 54 | +| One of the macros `BIGENDIAN' or `LITTLEENDIAN' must be defined. | ||
| 55 | +*----------------------------------------------------------------------------*/ | ||
| 56 | +#define BIGENDIAN | ||
| 57 | + | ||
| 58 | +/*---------------------------------------------------------------------------- | ||
| 59 | +| The macro `BITS64' can be defined to indicate that 64-bit integer types are | ||
| 60 | +| supported by the compiler. | ||
| 61 | +*----------------------------------------------------------------------------*/ | ||
| 62 | +#define BITS32 | ||
| 63 | + | ||
| 64 | +/*---------------------------------------------------------------------------- | ||
| 65 | +| Each of the following `typedef's defines the most convenient type that holds | ||
| 66 | +| integers of at least as many bits as specified. For example, `uint8' should | ||
| 67 | +| be the most convenient type that can hold unsigned integers of as many as | ||
| 68 | +| 8 bits. The `flag' type must be able to hold either a 0 or 1. For most | ||
| 69 | +| implementations of C, `flag', `uint8', and `int8' should all be `typedef'ed | ||
| 70 | +| to the same as `int'. | ||
| 71 | +*----------------------------------------------------------------------------*/ | ||
| 72 | +typedef int flag; | ||
| 73 | +typedef int uint8; | ||
| 74 | +typedef int int8; | ||
| 75 | +typedef int uint16; | ||
| 76 | +typedef int int16; | ||
| 77 | +typedef unsigned int uint32; | ||
| 78 | +typedef signed int int32; | ||
| 79 | +#ifdef BITS64 | ||
| 80 | +typedef unsigned long long int uint64; | ||
| 81 | +typedef signed long long int int64; | ||
| 82 | +#endif | ||
| 83 | + | ||
| 84 | +/*---------------------------------------------------------------------------- | ||
| 85 | +| Each of the following `typedef's defines a type that holds integers | ||
| 86 | +| of _exactly_ the number of bits specified. For instance, for most | ||
| 87 | +| implementation of C, `bits16' and `sbits16' should be `typedef'ed to | ||
| 88 | +| `unsigned short int' and `signed short int' (or `short int'), respectively. | ||
| 89 | +*----------------------------------------------------------------------------*/ | ||
| 90 | +typedef unsigned char bits8; | ||
| 91 | +typedef signed char sbits8; | ||
| 92 | +typedef unsigned short int bits16; | ||
| 93 | +typedef signed short int sbits16; | ||
| 94 | +typedef unsigned int bits32; | ||
| 95 | +typedef signed int sbits32; | ||
| 96 | +#ifdef BITS64 | ||
| 97 | +typedef unsigned long long int bits64; | ||
| 98 | +typedef signed long long int sbits64; | ||
| 99 | +#endif | ||
| 100 | + | ||
| 101 | +#ifdef BITS64 | ||
| 102 | +/*---------------------------------------------------------------------------- | ||
| 103 | +| The `LIT64' macro takes as its argument a textual integer literal and | ||
| 104 | +| if necessary ``marks'' the literal as having a 64-bit integer type. | ||
| 105 | +| For example, the GNU C Compiler (`gcc') requires that 64-bit literals be | ||
| 106 | +| appended with the letters `LL' standing for `long long', which is `gcc's | ||
| 107 | +| name for the 64-bit integer type. Some compilers may allow `LIT64' to be | ||
| 108 | +| defined as the identity macro: `#define LIT64( a ) a'. | ||
| 109 | +*----------------------------------------------------------------------------*/ | ||
| 110 | +#define LIT64( a ) a##LL | ||
| 111 | +#endif | ||
| 112 | + | ||
| 113 | +/*---------------------------------------------------------------------------- | ||
| 114 | +| The macro `INLINE' can be used before functions that should be inlined. If | ||
| 115 | +| a compiler does not support explicit inlining, this macro should be defined | ||
| 116 | +| to be `static'. | ||
| 117 | +*----------------------------------------------------------------------------*/ | ||
| 118 | +#define INLINE extern inline | ||
| 119 | + | ||
| 120 | diff --git a/SoftFloat-2b/softfloat/bits32/powerpc-GCC/Makefile b/SoftFloat-2b/softfloat/bits32/powerpc-GCC/Makefile | ||
| 121 | new file mode 100644 | ||
| 122 | index 0000000..28f1e33 | ||
| 123 | --- /dev/null | ||
| 124 | +++ b/SoftFloat-2b/softfloat/bits32/powerpc-GCC/Makefile | ||
| 125 | @@ -0,0 +1,26 @@ | ||
| 126 | + | ||
| 127 | +PROCESSOR_H = ../../../processors/powerpc-GCC.h | ||
| 128 | +SOFTFLOAT_MACROS = ../softfloat-macros | ||
| 129 | + | ||
| 130 | +OBJ = .o | ||
| 131 | +EXE = | ||
| 132 | +INCLUDES = -I. -I.. | ||
| 133 | +COMPILE_C = $(COMPILE_PREFIX)gcc -msoft-float -c -o $@ $(INCLUDES) -I- -O2 | ||
| 134 | +LINK = $(COMPILE_PREFIX)gcc -o $@ | ||
| 135 | + | ||
| 136 | +ALL: softfloat$(OBJ) timesoftfloat$(EXE) | ||
| 137 | + | ||
| 138 | +milieu.h: $(PROCESSOR_H) | ||
| 139 | + touch milieu.h | ||
| 140 | + | ||
| 141 | +softfloat$(OBJ): milieu.h softfloat.h softfloat-specialize $(SOFTFLOAT_MACROS) ../softfloat.c | ||
| 142 | + $(COMPILE_C) ../softfloat.c | ||
| 143 | + | ||
| 144 | +timesoftfloat$(OBJ): milieu.h softfloat.h ../timesoftfloat.c | ||
| 145 | + $(COMPILE_C) ../timesoftfloat.c | ||
| 146 | + | ||
| 147 | +timesoftfloat$(EXE): softfloat$(OBJ) timesoftfloat$(OBJ) | ||
| 148 | + $(LINK) softfloat$(OBJ) timesoftfloat$(OBJ) | ||
| 149 | + | ||
| 150 | +clean: | ||
| 151 | + rm -f *.o timesoftfloat$(EXE) | ||
| 152 | diff --git a/SoftFloat-2b/softfloat/bits32/powerpc-GCC/milieu.h b/SoftFloat-2b/softfloat/bits32/powerpc-GCC/milieu.h | ||
| 153 | new file mode 100644 | ||
| 154 | index 0000000..d8b6012 | ||
| 155 | --- /dev/null | ||
| 156 | +++ b/SoftFloat-2b/softfloat/bits32/powerpc-GCC/milieu.h | ||
| 157 | @@ -0,0 +1,55 @@ | ||
| 158 | +/* | ||
| 159 | + * This file is derived from softfloat/bits32/386-Win32-GCC/milieu.h, | ||
| 160 | + * the copyright for that material belongs to the original owners. | ||
| 161 | + * | ||
| 162 | + * Additional material and changes where applicable is: | ||
| 163 | + * Copyright (C) 2008 Freescale Semiconductor, Inc. All rights reserved. | ||
| 164 | + * | ||
| 165 | + * Author: Ebony Zhu, <ebony.zhu@freescale.com> | ||
| 166 | + * Yu Liu, <yu.liu@freescale.com> | ||
| 167 | + */ | ||
| 168 | + | ||
| 169 | +/*============================================================================ | ||
| 170 | + | ||
| 171 | +This C header file is part of the SoftFloat IEC/IEEE Floating-point Arithmetic | ||
| 172 | +Package, Release 2b. | ||
| 173 | + | ||
| 174 | +Written by John R. Hauser. This work was made possible in part by the | ||
| 175 | +International Computer Science Institute, located at Suite 600, 1947 Center | ||
| 176 | +Street, Berkeley, California 94704. Funding was partially provided by the | ||
| 177 | +National Science Foundation under grant MIP-9311980. The original version | ||
| 178 | +of this code was written as part of a project to build a fixed-point vector | ||
| 179 | +processor in collaboration with the University of California at Berkeley, | ||
| 180 | +overseen by Profs. Nelson Morgan and John Wawrzynek. More information | ||
| 181 | +is available through the Web page `http://www.cs.berkeley.edu/~jhauser/ | ||
| 182 | +arithmetic/SoftFloat.html'. | ||
| 183 | + | ||
| 184 | +THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort has | ||
| 185 | +been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT TIMES | ||
| 186 | +RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO PERSONS | ||
| 187 | +AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ALL LOSSES, | ||
| 188 | +COSTS, OR OTHER PROBLEMS THEY INCUR DUE TO THE SOFTWARE, AND WHO FURTHERMORE | ||
| 189 | +EFFECTIVELY INDEMNIFY JOHN HAUSER AND THE INTERNATIONAL COMPUTER SCIENCE | ||
| 190 | +INSTITUTE (possibly via similar legal warning) AGAINST ALL LOSSES, COSTS, OR | ||
| 191 | +OTHER PROBLEMS INCURRED BY THEIR CUSTOMERS AND CLIENTS DUE TO THE SOFTWARE. | ||
| 192 | + | ||
| 193 | +Derivative works are acceptable, even for commercial purposes, so long as | ||
| 194 | +(1) the source code for the derivative work includes prominent notice that | ||
| 195 | +the work is derivative, and (2) the source code includes prominent notice with | ||
| 196 | +these four paragraphs for those parts of this code that are retained. | ||
| 197 | + | ||
| 198 | +=============================================================================*/ | ||
| 199 | + | ||
| 200 | +/*---------------------------------------------------------------------------- | ||
| 201 | +| Include common integer types and flags. | ||
| 202 | +*----------------------------------------------------------------------------*/ | ||
| 203 | +#include "../../../processors/powerpc-GCC.h" | ||
| 204 | + | ||
| 205 | +/*---------------------------------------------------------------------------- | ||
| 206 | +| Symbolic Boolean literals. | ||
| 207 | +*----------------------------------------------------------------------------*/ | ||
| 208 | +enum { | ||
| 209 | + FALSE = 0, | ||
| 210 | + TRUE = 1 | ||
| 211 | +}; | ||
| 212 | + | ||
| 213 | diff --git a/SoftFloat-2b/softfloat/bits32/powerpc-GCC/softfloat-specialize b/SoftFloat-2b/softfloat/bits32/powerpc-GCC/softfloat-specialize | ||
| 214 | new file mode 100644 | ||
| 215 | index 0000000..fd2caa4 | ||
| 216 | --- /dev/null | ||
| 217 | +++ b/SoftFloat-2b/softfloat/bits32/powerpc-GCC/softfloat-specialize | ||
| 218 | @@ -0,0 +1,252 @@ | ||
| 219 | +/* | ||
| 220 | + * This file is derived from softfloat/bits32/386-Win32-GCC/softfloat-specialize, | ||
| 221 | + * the copyright for that material belongs to the original owners. | ||
| 222 | + * | ||
| 223 | + * Additional material and changes where applicable is: | ||
| 224 | + * Copyright (C) 2008 Freescale Semiconductor, Inc. All rights reserved. | ||
| 225 | + * | ||
| 226 | + * Author: Ebony Zhu, <ebony.zhu@freescale.com> | ||
| 227 | + * Yu Liu, <yu.liu@freescale.com> | ||
| 228 | + */ | ||
| 229 | + | ||
| 230 | +/*============================================================================ | ||
| 231 | + | ||
| 232 | +This C source fragment is part of the SoftFloat IEC/IEEE Floating-point | ||
| 233 | +Arithmetic Package, Release 2b. | ||
| 234 | + | ||
| 235 | +Written by John R. Hauser. This work was made possible in part by the | ||
| 236 | +International Computer Science Institute, located at Suite 600, 1947 Center | ||
| 237 | +Street, Berkeley, California 94704. Funding was partially provided by the | ||
| 238 | +National Science Foundation under grant MIP-9311980. The original version | ||
| 239 | +of this code was written as part of a project to build a fixed-point vector | ||
| 240 | +processor in collaboration with the University of California at Berkeley, | ||
| 241 | +overseen by Profs. Nelson Morgan and John Wawrzynek. More information | ||
| 242 | +is available through the Web page `http://www.cs.berkeley.edu/~jhauser/ | ||
| 243 | +arithmetic/SoftFloat.html'. | ||
| 244 | + | ||
| 245 | +THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort has | ||
| 246 | +been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT TIMES | ||
| 247 | +RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO PERSONS | ||
| 248 | +AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ALL LOSSES, | ||
| 249 | +COSTS, OR OTHER PROBLEMS THEY INCUR DUE TO THE SOFTWARE, AND WHO FURTHERMORE | ||
| 250 | +EFFECTIVELY INDEMNIFY JOHN HAUSER AND THE INTERNATIONAL COMPUTER SCIENCE | ||
| 251 | +INSTITUTE (possibly via similar legal warning) AGAINST ALL LOSSES, COSTS, OR | ||
| 252 | +OTHER PROBLEMS INCURRED BY THEIR CUSTOMERS AND CLIENTS DUE TO THE SOFTWARE. | ||
| 253 | + | ||
| 254 | +Derivative works are acceptable, even for commercial purposes, so long as | ||
| 255 | +(1) the source code for the derivative work includes prominent notice that | ||
| 256 | +the work is derivative, and (2) the source code includes prominent notice with | ||
| 257 | +these four paragraphs for those parts of this code that are retained. | ||
| 258 | + | ||
| 259 | +=============================================================================*/ | ||
| 260 | + | ||
| 261 | +/*---------------------------------------------------------------------------- | ||
| 262 | +| Underflow tininess-detection mode, statically initialized to default value. | ||
| 263 | +| (The declaration in `softfloat.h' must match the `int8' type here.) | ||
| 264 | +*----------------------------------------------------------------------------*/ | ||
| 265 | +int8 float_detect_tininess = float_tininess_after_rounding; | ||
| 266 | + | ||
| 267 | +/*---------------------------------------------------------------------------- | ||
| 268 | +| Raises the exceptions specified by `flags'. Floating-point traps can be | ||
| 269 | +| defined here if desired. It is currently not possible for such a trap | ||
| 270 | +| to substitute a result value. If traps are not implemented, this routine | ||
| 271 | +| should be simply `float_exception_flags |= flags;'. | ||
| 272 | +*----------------------------------------------------------------------------*/ | ||
| 273 | + | ||
| 274 | +void float_raise( int8 flags ) | ||
| 275 | +{ | ||
| 276 | + | ||
| 277 | + float_exception_flags |= flags; | ||
| 278 | + | ||
| 279 | +} | ||
| 280 | + | ||
| 281 | +/*---------------------------------------------------------------------------- | ||
| 282 | +| Internal canonical NaN format. | ||
| 283 | +*----------------------------------------------------------------------------*/ | ||
| 284 | +typedef struct { | ||
| 285 | + flag sign; | ||
| 286 | + bits32 high, low; | ||
| 287 | +} commonNaNT; | ||
| 288 | + | ||
| 289 | +/*---------------------------------------------------------------------------- | ||
| 290 | +| The pattern for a default generated single-precision NaN. | ||
| 291 | +*----------------------------------------------------------------------------*/ | ||
| 292 | +enum { | ||
| 293 | + float32_default_nan = 0xFFFFFFFF | ||
| 294 | +}; | ||
| 295 | + | ||
| 296 | +/*---------------------------------------------------------------------------- | ||
| 297 | +| Returns 1 if the single-precision floating-point value `a' is a NaN; | ||
| 298 | +| otherwise returns 0. | ||
| 299 | +*----------------------------------------------------------------------------*/ | ||
| 300 | + | ||
| 301 | +flag float32_is_nan( float32 a ) | ||
| 302 | +{ | ||
| 303 | + | ||
| 304 | + return ( 0xFF000000 < (bits32) ( a<<1 ) ); | ||
| 305 | + | ||
| 306 | +} | ||
| 307 | + | ||
| 308 | +/*---------------------------------------------------------------------------- | ||
| 309 | +| Returns 1 if the single-precision floating-point value `a' is a signaling | ||
| 310 | +| NaN; otherwise returns 0. | ||
| 311 | +*----------------------------------------------------------------------------*/ | ||
| 312 | + | ||
| 313 | +flag float32_is_signaling_nan( float32 a ) | ||
| 314 | +{ | ||
| 315 | + | ||
| 316 | + return ( ( ( a>>22 ) & 0x1FF ) == 0x1FE ) && ( a & 0x003FFFFF ); | ||
| 317 | + | ||
| 318 | +} | ||
| 319 | + | ||
| 320 | +/*---------------------------------------------------------------------------- | ||
| 321 | +| Returns the result of converting the single-precision floating-point NaN | ||
| 322 | +| `a' to the canonical NaN format. If `a' is a signaling NaN, the invalid | ||
| 323 | +| exception is raised. | ||
| 324 | +*----------------------------------------------------------------------------*/ | ||
| 325 | + | ||
| 326 | +static commonNaNT float32ToCommonNaN( float32 a ) | ||
| 327 | +{ | ||
| 328 | + commonNaNT z; | ||
| 329 | + | ||
| 330 | + if ( float32_is_signaling_nan( a ) ) float_raise( float_flag_invalid ); | ||
| 331 | + z.sign = a>>31; | ||
| 332 | + z.low = 0; | ||
| 333 | + z.high = a<<9; | ||
| 334 | + return z; | ||
| 335 | + | ||
| 336 | +} | ||
| 337 | + | ||
| 338 | +/*---------------------------------------------------------------------------- | ||
| 339 | +| Returns the result of converting the canonical NaN `a' to the single- | ||
| 340 | +| precision floating-point format. | ||
| 341 | +*----------------------------------------------------------------------------*/ | ||
| 342 | + | ||
| 343 | +static float32 commonNaNToFloat32( commonNaNT a ) | ||
| 344 | +{ | ||
| 345 | + | ||
| 346 | + return ( ( (bits32) a.sign )<<31 ) | 0x7FC00000 | ( a.high>>9 ); | ||
| 347 | + | ||
| 348 | +} | ||
| 349 | + | ||
| 350 | +/*---------------------------------------------------------------------------- | ||
| 351 | +| Takes two single-precision floating-point values `a' and `b', one of which | ||
| 352 | +| is a NaN, and returns the appropriate NaN result. If either `a' or `b' is a | ||
| 353 | +| signaling NaN, the invalid exception is raised. | ||
| 354 | +*----------------------------------------------------------------------------*/ | ||
| 355 | + | ||
| 356 | +static float32 propagateFloat32NaN( float32 a, float32 b ) | ||
| 357 | +{ | ||
| 358 | + flag aIsNaN, aIsSignalingNaN, bIsNaN, bIsSignalingNaN; | ||
| 359 | + | ||
| 360 | + aIsNaN = float32_is_nan( a ); | ||
| 361 | + aIsSignalingNaN = float32_is_signaling_nan( a ); | ||
| 362 | + bIsNaN = float32_is_nan( b ); | ||
| 363 | + bIsSignalingNaN = float32_is_signaling_nan( b ); | ||
| 364 | + a |= 0x00400000; | ||
| 365 | + b |= 0x00400000; | ||
| 366 | + if ( aIsSignalingNaN | bIsSignalingNaN ) float_raise( float_flag_invalid ); | ||
| 367 | + if ( aIsNaN ) { | ||
| 368 | + return ( aIsSignalingNaN & bIsNaN ) ? b : a; | ||
| 369 | + } | ||
| 370 | + else { | ||
| 371 | + return b; | ||
| 372 | + } | ||
| 373 | + | ||
| 374 | +} | ||
| 375 | + | ||
| 376 | +/*---------------------------------------------------------------------------- | ||
| 377 | +| The pattern for a default generated double-precision NaN. The `high' and | ||
| 378 | +| `low' values hold the most- and least-significant bits, respectively. | ||
| 379 | +*----------------------------------------------------------------------------*/ | ||
| 380 | +enum { | ||
| 381 | + float64_default_nan_high = 0xFFFFFFFF, | ||
| 382 | + float64_default_nan_low = 0xFFFFFFFF | ||
| 383 | +}; | ||
| 384 | + | ||
| 385 | +/*---------------------------------------------------------------------------- | ||
| 386 | +| Returns 1 if the double-precision floating-point value `a' is a NaN; | ||
| 387 | +| otherwise returns 0. | ||
| 388 | +*----------------------------------------------------------------------------*/ | ||
| 389 | + | ||
| 390 | +flag float64_is_nan( float64 a ) | ||
| 391 | +{ | ||
| 392 | + | ||
| 393 | + return | ||
| 394 | + ( 0xFFE00000 <= (bits32) ( a.high<<1 ) ) | ||
| 395 | + && ( a.low || ( a.high & 0x000FFFFF ) ); | ||
| 396 | + | ||
| 397 | +} | ||
| 398 | + | ||
| 399 | +/*---------------------------------------------------------------------------- | ||
| 400 | +| Returns 1 if the double-precision floating-point value `a' is a signaling | ||
| 401 | +| NaN; otherwise returns 0. | ||
| 402 | +*----------------------------------------------------------------------------*/ | ||
| 403 | + | ||
| 404 | +flag float64_is_signaling_nan( float64 a ) | ||
| 405 | +{ | ||
| 406 | + | ||
| 407 | + return | ||
| 408 | + ( ( ( a.high>>19 ) & 0xFFF ) == 0xFFE ) | ||
| 409 | + && ( a.low || ( a.high & 0x0007FFFF ) ); | ||
| 410 | + | ||
| 411 | +} | ||
| 412 | + | ||
| 413 | +/*---------------------------------------------------------------------------- | ||
| 414 | +| Returns the result of converting the double-precision floating-point NaN | ||
| 415 | +| `a' to the canonical NaN format. If `a' is a signaling NaN, the invalid | ||
| 416 | +| exception is raised. | ||
| 417 | +*----------------------------------------------------------------------------*/ | ||
| 418 | + | ||
| 419 | +static commonNaNT float64ToCommonNaN( float64 a ) | ||
| 420 | +{ | ||
| 421 | + commonNaNT z; | ||
| 422 | + | ||
| 423 | + if ( float64_is_signaling_nan( a ) ) float_raise( float_flag_invalid ); | ||
| 424 | + z.sign = a.high>>31; | ||
| 425 | + shortShift64Left( a.high, a.low, 12, &z.high, &z.low ); | ||
| 426 | + return z; | ||
| 427 | + | ||
| 428 | +} | ||
| 429 | + | ||
| 430 | +/*---------------------------------------------------------------------------- | ||
| 431 | +| Returns the result of converting the canonical NaN `a' to the double- | ||
| 432 | +| precision floating-point format. | ||
| 433 | +*----------------------------------------------------------------------------*/ | ||
| 434 | + | ||
| 435 | +static float64 commonNaNToFloat64( commonNaNT a ) | ||
| 436 | +{ | ||
| 437 | + float64 z; | ||
| 438 | + | ||
| 439 | + shift64Right( a.high, a.low, 12, &z.high, &z.low ); | ||
| 440 | + z.high |= ( ( (bits32) a.sign )<<31 ) | 0x7FF80000; | ||
| 441 | + return z; | ||
| 442 | + | ||
| 443 | +} | ||
| 444 | + | ||
| 445 | +/*---------------------------------------------------------------------------- | ||
| 446 | +| Takes two double-precision floating-point values `a' and `b', one of which | ||
| 447 | +| is a NaN, and returns the appropriate NaN result. If either `a' or `b' is a | ||
| 448 | +| signaling NaN, the invalid exception is raised. | ||
| 449 | +*----------------------------------------------------------------------------*/ | ||
| 450 | + | ||
| 451 | +static float64 propagateFloat64NaN( float64 a, float64 b ) | ||
| 452 | +{ | ||
| 453 | + flag aIsNaN, aIsSignalingNaN, bIsNaN, bIsSignalingNaN; | ||
| 454 | + | ||
| 455 | + aIsNaN = float64_is_nan( a ); | ||
| 456 | + aIsSignalingNaN = float64_is_signaling_nan( a ); | ||
| 457 | + bIsNaN = float64_is_nan( b ); | ||
| 458 | + bIsSignalingNaN = float64_is_signaling_nan( b ); | ||
| 459 | + a.high |= 0x00080000; | ||
| 460 | + b.high |= 0x00080000; | ||
| 461 | + if ( aIsSignalingNaN | bIsSignalingNaN ) float_raise( float_flag_invalid ); | ||
| 462 | + if ( aIsNaN ) { | ||
| 463 | + return ( aIsSignalingNaN & bIsNaN ) ? b : a; | ||
| 464 | + } | ||
| 465 | + else { | ||
| 466 | + return b; | ||
| 467 | + } | ||
| 468 | + | ||
| 469 | +} | ||
| 470 | + | ||
| 471 | diff --git a/SoftFloat-2b/softfloat/bits32/powerpc-GCC/softfloat.h b/SoftFloat-2b/softfloat/bits32/powerpc-GCC/softfloat.h | ||
| 472 | new file mode 100644 | ||
| 473 | index 0000000..0015b8e | ||
| 474 | --- /dev/null | ||
| 475 | +++ b/SoftFloat-2b/softfloat/bits32/powerpc-GCC/softfloat.h | ||
| 476 | @@ -0,0 +1,155 @@ | ||
| 477 | +/* | ||
| 478 | + * This file is derived from softfloat/bits32/386-Win32-GCC/softfloat.h, | ||
| 479 | + * the copyright for that material belongs to the original owners. | ||
| 480 | + * | ||
| 481 | + * Additional material and changes where applicable is: | ||
| 482 | + * Copyright (C) 2008 Freescale Semiconductor, Inc. All rights reserved. | ||
| 483 | + * | ||
| 484 | + * Author: Ebony Zhu, <ebony.zhu@freescale.com> | ||
| 485 | + * Yu Liu, <yu.liu@freescale.com> | ||
| 486 | + */ | ||
| 487 | + | ||
| 488 | +/*============================================================================ | ||
| 489 | + | ||
| 490 | +This C header file is part of the SoftFloat IEC/IEEE Floating-point Arithmetic | ||
| 491 | +Package, Release 2b. | ||
| 492 | + | ||
| 493 | +Written by John R. Hauser. This work was made possible in part by the | ||
| 494 | +International Computer Science Institute, located at Suite 600, 1947 Center | ||
| 495 | +Street, Berkeley, California 94704. Funding was partially provided by the | ||
| 496 | +National Science Foundation under grant MIP-9311980. The original version | ||
| 497 | +of this code was written as part of a project to build a fixed-point vector | ||
| 498 | +processor in collaboration with the University of California at Berkeley, | ||
| 499 | +overseen by Profs. Nelson Morgan and John Wawrzynek. More information | ||
| 500 | +is available through the Web page `http://www.cs.berkeley.edu/~jhauser/ | ||
| 501 | +arithmetic/SoftFloat.html'. | ||
| 502 | + | ||
| 503 | +THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort has | ||
| 504 | +been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT TIMES | ||
| 505 | +RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO PERSONS | ||
| 506 | +AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ALL LOSSES, | ||
| 507 | +COSTS, OR OTHER PROBLEMS THEY INCUR DUE TO THE SOFTWARE, AND WHO FURTHERMORE | ||
| 508 | +EFFECTIVELY INDEMNIFY JOHN HAUSER AND THE INTERNATIONAL COMPUTER SCIENCE | ||
| 509 | +INSTITUTE (possibly via similar legal warning) AGAINST ALL LOSSES, COSTS, OR | ||
| 510 | +OTHER PROBLEMS INCURRED BY THEIR CUSTOMERS AND CLIENTS DUE TO THE SOFTWARE. | ||
| 511 | + | ||
| 512 | +Derivative works are acceptable, even for commercial purposes, so long as | ||
| 513 | +(1) the source code for the derivative work includes prominent notice that | ||
| 514 | +the work is derivative, and (2) the source code includes prominent notice with | ||
| 515 | +these four paragraphs for those parts of this code that are retained. | ||
| 516 | + | ||
| 517 | +=============================================================================*/ | ||
| 518 | + | ||
| 519 | +/*---------------------------------------------------------------------------- | ||
| 520 | +| Software IEC/IEEE floating-point types. | ||
| 521 | +*----------------------------------------------------------------------------*/ | ||
| 522 | +typedef bits32 float32; | ||
| 523 | +typedef struct { | ||
| 524 | + bits32 high, low; | ||
| 525 | +} float64; | ||
| 526 | + | ||
| 527 | +/*---------------------------------------------------------------------------- | ||
| 528 | +| Software IEC/IEEE floating-point underflow tininess-detection mode. | ||
| 529 | +*----------------------------------------------------------------------------*/ | ||
| 530 | +extern int8 float_detect_tininess; | ||
| 531 | +enum { | ||
| 532 | + float_tininess_after_rounding = 0, | ||
| 533 | + float_tininess_before_rounding = 1 | ||
| 534 | +}; | ||
| 535 | + | ||
| 536 | +/*---------------------------------------------------------------------------- | ||
| 537 | +| Software IEC/IEEE floating-point rounding mode. | ||
| 538 | +*----------------------------------------------------------------------------*/ | ||
| 539 | +extern int8 float_rounding_mode; | ||
| 540 | +enum { | ||
| 541 | + float_round_nearest_even = 0, | ||
| 542 | + float_round_to_zero = 1, | ||
| 543 | + float_round_up = 2, | ||
| 544 | + float_round_down = 3 | ||
| 545 | +}; | ||
| 546 | + | ||
| 547 | +/*---------------------------------------------------------------------------- | ||
| 548 | +| Software IEC/IEEE floating-point exception flags. | ||
| 549 | +*----------------------------------------------------------------------------*/ | ||
| 550 | +/* | ||
| 551 | +extern int8 float_exception_flags; | ||
| 552 | +enum { | ||
| 553 | + float_flag_inexact = 1, | ||
| 554 | + float_flag_underflow = 2, | ||
| 555 | + float_flag_overflow = 4, | ||
| 556 | + float_flag_divbyzero = 8, | ||
| 557 | + float_flag_invalid = 16 | ||
| 558 | +}; | ||
| 559 | +*/ | ||
| 560 | + | ||
| 561 | +extern int8 float_exception_flags; | ||
| 562 | +enum { | ||
| 563 | + float_flag_inexact = 16, | ||
| 564 | + float_flag_underflow = 2, | ||
| 565 | + float_flag_overflow = 1, | ||
| 566 | + float_flag_divbyzero = 4, | ||
| 567 | + float_flag_invalid = 8 | ||
| 568 | +}; | ||
| 569 | + | ||
| 570 | +/*---------------------------------------------------------------------------- | ||
| 571 | +| Routine to raise any or all of the software IEC/IEEE floating-point | ||
| 572 | +| exception flags. | ||
| 573 | +*----------------------------------------------------------------------------*/ | ||
| 574 | +void float_raise( int8 ); | ||
| 575 | + | ||
| 576 | +/*---------------------------------------------------------------------------- | ||
| 577 | +| Software IEC/IEEE integer-to-floating-point conversion routines. | ||
| 578 | +*----------------------------------------------------------------------------*/ | ||
| 579 | +float32 int32_to_float32( int32 ); | ||
| 580 | +float64 int32_to_float64( int32 ); | ||
| 581 | + | ||
| 582 | +/*---------------------------------------------------------------------------- | ||
| 583 | +| Software IEC/IEEE single-precision conversion routines. | ||
| 584 | +*----------------------------------------------------------------------------*/ | ||
| 585 | +int32 float32_to_int32( float32 ); | ||
| 586 | +int32 float32_to_int32_round_to_zero( float32 ); | ||
| 587 | +float64 float32_to_float64( float32 ); | ||
| 588 | + | ||
| 589 | +/*---------------------------------------------------------------------------- | ||
| 590 | +| Software IEC/IEEE single-precision operations. | ||
| 591 | +*----------------------------------------------------------------------------*/ | ||
| 592 | +float32 float32_round_to_int( float32 ); | ||
| 593 | +float32 float32_add( float32, float32 ); | ||
| 594 | +float32 float32_sub( float32, float32 ); | ||
| 595 | +float32 float32_mul( float32, float32 ); | ||
| 596 | +float32 float32_div( float32, float32 ); | ||
| 597 | +float32 float32_rem( float32, float32 ); | ||
| 598 | +float32 float32_sqrt( float32 ); | ||
| 599 | +flag float32_eq( float32, float32 ); | ||
| 600 | +flag float32_le( float32, float32 ); | ||
| 601 | +flag float32_lt( float32, float32 ); | ||
| 602 | +flag float32_eq_signaling( float32, float32 ); | ||
| 603 | +flag float32_le_quiet( float32, float32 ); | ||
| 604 | +flag float32_lt_quiet( float32, float32 ); | ||
| 605 | +flag float32_is_signaling_nan( float32 ); | ||
| 606 | + | ||
| 607 | +/*---------------------------------------------------------------------------- | ||
| 608 | +| Software IEC/IEEE double-precision conversion routines. | ||
| 609 | +*----------------------------------------------------------------------------*/ | ||
| 610 | +int32 float64_to_int32( float64 ); | ||
| 611 | +int32 float64_to_int32_round_to_zero( float64 ); | ||
| 612 | +float32 float64_to_float32( float64 ); | ||
| 613 | + | ||
| 614 | +/*---------------------------------------------------------------------------- | ||
| 615 | +| Software IEC/IEEE double-precision operations. | ||
| 616 | +*----------------------------------------------------------------------------*/ | ||
| 617 | +float64 float64_round_to_int( float64 ); | ||
| 618 | +float64 float64_add( float64, float64 ); | ||
| 619 | +float64 float64_sub( float64, float64 ); | ||
| 620 | +float64 float64_mul( float64, float64 ); | ||
| 621 | +float64 float64_div( float64, float64 ); | ||
| 622 | +float64 float64_rem( float64, float64 ); | ||
| 623 | +float64 float64_sqrt( float64 ); | ||
| 624 | +flag float64_eq( float64, float64 ); | ||
| 625 | +flag float64_le( float64, float64 ); | ||
| 626 | +flag float64_lt( float64, float64 ); | ||
| 627 | +flag float64_eq_signaling( float64, float64 ); | ||
| 628 | +flag float64_le_quiet( float64, float64 ); | ||
| 629 | +flag float64_lt_quiet( float64, float64 ); | ||
| 630 | +flag float64_is_signaling_nan( float64 ); | ||
| 631 | + | ||
| 632 | diff --git a/SoftFloat-2b/softfloat/bits64/powerpc-GCC/Makefile b/SoftFloat-2b/softfloat/bits64/powerpc-GCC/Makefile | ||
| 633 | new file mode 100644 | ||
| 634 | index 0000000..a5e2cc7 | ||
| 635 | --- /dev/null | ||
| 636 | +++ b/SoftFloat-2b/softfloat/bits64/powerpc-GCC/Makefile | ||
| 637 | @@ -0,0 +1,24 @@ | ||
| 638 | + | ||
| 639 | +PROCESSOR_H = ../../../processors/powerpc-GCC.h | ||
| 640 | +SOFTFLOAT_MACROS = ../softfloat-macros | ||
| 641 | + | ||
| 642 | +OBJ = .o | ||
| 643 | +EXE = | ||
| 644 | +INCLUDES = -I. -I.. | ||
| 645 | +COMPILE_C = $(COMPILE_PREFIX) -mcpu=8548 -mhard-float -mfloat-gprs=double -o $@ $(INCLUDES) -I- -O2 | ||
| 646 | +LINK = $(COMPILE_PREFIX) -o $@ | ||
| 647 | + | ||
| 648 | +ALL: softfloat$(OBJ) timesoftfloat$(EXE) | ||
| 649 | + | ||
| 650 | +milieu.h: $(PROCESSOR_H) | ||
| 651 | + touch milieu.h | ||
| 652 | + | ||
| 653 | +softfloat$(OBJ): milieu.h softfloat.h softfloat-specialize $(SOFTFLOAT_MACROS) ../softfloat.c | ||
| 654 | + $(COMPILE_C) ../softfloat.c | ||
| 655 | + | ||
| 656 | +timesoftfloat$(OBJ): milieu.h softfloat.h ../timesoftfloat.c | ||
| 657 | + $(COMPILE_C) ../timesoftfloat.c | ||
| 658 | + | ||
| 659 | +timesoftfloat$(EXE): softfloat$(OBJ) timesoftfloat$(OBJ) | ||
| 660 | + $(LINK) softfloat$(OBJ) timesoftfloat$(OBJ) | ||
| 661 | + | ||
| 662 | diff --git a/SoftFloat-2b/softfloat/bits64/powerpc-GCC/milieu.h b/SoftFloat-2b/softfloat/bits64/powerpc-GCC/milieu.h | ||
| 663 | new file mode 100644 | ||
| 664 | index 0000000..1b66490 | ||
| 665 | --- /dev/null | ||
| 666 | +++ b/SoftFloat-2b/softfloat/bits64/powerpc-GCC/milieu.h | ||
| 667 | @@ -0,0 +1,55 @@ | ||
| 668 | +/* | ||
| 669 | + * This file is derived from softfloat/bits64/386-Win32-GCC/milieu.h, | ||
| 670 | + * the copyright for that material belongs to the original owners. | ||
| 671 | + * | ||
| 672 | + * Additional material and changes where applicable is: | ||
| 673 | + * Copyright (C) 2008 Freescale Semiconductor, Inc. All rights reserved. | ||
| 674 | + * | ||
| 675 | + * Author: Ebony Zhu, <ebony.zhu@freescale.com> | ||
| 676 | + * Yu Liu, <yu.liu@freescale.com> | ||
| 677 | + */ | ||
| 678 | + | ||
| 679 | +/*============================================================================ | ||
| 680 | + | ||
| 681 | +This C header file is part of the SoftFloat IEC/IEEE Floating-point Arithmetic | ||
| 682 | +Package, Release 2b. | ||
| 683 | + | ||
| 684 | +Written by John R. Hauser. This work was made possible in part by the | ||
| 685 | +International Computer Science Institute, located at Suite 600, 1947 Center | ||
| 686 | +Street, Berkeley, California 94704. Funding was partially provided by the | ||
| 687 | +National Science Foundation under grant MIP-9311980. The original version | ||
| 688 | +of this code was written as part of a project to build a fixed-point vector | ||
| 689 | +processor in collaboration with the University of California at Berkeley, | ||
| 690 | +overseen by Profs. Nelson Morgan and John Wawrzynek. More information | ||
| 691 | +is available through the Web page `http://www.cs.berkeley.edu/~jhauser/ | ||
| 692 | +arithmetic/SoftFloat.html'. | ||
| 693 | + | ||
| 694 | +THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort has | ||
| 695 | +been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT TIMES | ||
| 696 | +RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO PERSONS | ||
| 697 | +AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ALL LOSSES, | ||
| 698 | +COSTS, OR OTHER PROBLEMS THEY INCUR DUE TO THE SOFTWARE, AND WHO FURTHERMORE | ||
| 699 | +EFFECTIVELY INDEMNIFY JOHN HAUSER AND THE INTERNATIONAL COMPUTER SCIENCE | ||
| 700 | +INSTITUTE (possibly via similar legal warning) AGAINST ALL LOSSES, COSTS, OR | ||
| 701 | +OTHER PROBLEMS INCURRED BY THEIR CUSTOMERS AND CLIENTS DUE TO THE SOFTWARE. | ||
| 702 | + | ||
| 703 | +Derivative works are acceptable, even for commercial purposes, so long as | ||
| 704 | +(1) the source code for the derivative work includes prominent notice that | ||
| 705 | +the work is derivative, and (2) the source code includes prominent notice with | ||
| 706 | +these four paragraphs for those parts of this code that are retained. | ||
| 707 | + | ||
| 708 | +=============================================================================*/ | ||
| 709 | + | ||
| 710 | +/*---------------------------------------------------------------------------- | ||
| 711 | +| Include common integer types and flags. | ||
| 712 | +*----------------------------------------------------------------------------*/ | ||
| 713 | +#include "../../../processors/SPARC-GCC.h" | ||
| 714 | + | ||
| 715 | +/*---------------------------------------------------------------------------- | ||
| 716 | +| Symbolic Boolean literals. | ||
| 717 | +*----------------------------------------------------------------------------*/ | ||
| 718 | +enum { | ||
| 719 | + FALSE = 0, | ||
| 720 | + TRUE = 1 | ||
| 721 | +}; | ||
| 722 | + | ||
| 723 | diff --git a/SoftFloat-2b/softfloat/bits64/powerpc-GCC/softfloat-specialize b/SoftFloat-2b/softfloat/bits64/powerpc-GCC/softfloat-specialize | ||
| 724 | new file mode 100644 | ||
| 725 | index 0000000..b1d0bc8 | ||
| 726 | --- /dev/null | ||
| 727 | +++ b/SoftFloat-2b/softfloat/bits64/powerpc-GCC/softfloat-specialize | ||
| 728 | @@ -0,0 +1,422 @@ | ||
| 729 | +/* | ||
| 730 | + * This file is derived from softfloat/bits64/386-Win32-GCC/softfloat-specialize, | ||
| 731 | + * the copyright for that material belongs to the original owners. | ||
| 732 | + * | ||
| 733 | + * Additional material and changes where applicable is: | ||
| 734 | + * Copyright (C) 2008 Freescale Semiconductor, Inc. All rights reserved. | ||
| 735 | + * | ||
| 736 | + * Author: Ebony Zhu, <ebony.zhu@freescale.com> | ||
| 737 | + * Yu Liu, <yu.liu@freescale.com> | ||
| 738 | + */ | ||
| 739 | + | ||
| 740 | +/*============================================================================ | ||
| 741 | + | ||
| 742 | +This C source fragment is part of the SoftFloat IEC/IEEE Floating-point | ||
| 743 | +Arithmetic Package, Release 2b. | ||
| 744 | + | ||
| 745 | +Written by John R. Hauser. This work was made possible in part by the | ||
| 746 | +International Computer Science Institute, located at Suite 600, 1947 Center | ||
| 747 | +Street, Berkeley, California 94704. Funding was partially provided by the | ||
| 748 | +National Science Foundation under grant MIP-9311980. The original version | ||
| 749 | +of this code was written as part of a project to build a fixed-point vector | ||
| 750 | +processor in collaboration with the University of California at Berkeley, | ||
| 751 | +overseen by Profs. Nelson Morgan and John Wawrzynek. More information | ||
| 752 | +is available through the Web page `http://www.cs.berkeley.edu/~jhauser/ | ||
| 753 | +arithmetic/SoftFloat.html'. | ||
| 754 | + | ||
| 755 | +THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort has | ||
| 756 | +been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT TIMES | ||
| 757 | +RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO PERSONS | ||
| 758 | +AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ALL LOSSES, | ||
| 759 | +COSTS, OR OTHER PROBLEMS THEY INCUR DUE TO THE SOFTWARE, AND WHO FURTHERMORE | ||
| 760 | +EFFECTIVELY INDEMNIFY JOHN HAUSER AND THE INTERNATIONAL COMPUTER SCIENCE | ||
| 761 | +INSTITUTE (possibly via similar legal warning) AGAINST ALL LOSSES, COSTS, OR | ||
| 762 | +OTHER PROBLEMS INCURRED BY THEIR CUSTOMERS AND CLIENTS DUE TO THE SOFTWARE. | ||
| 763 | + | ||
| 764 | +Derivative works are acceptable, even for commercial purposes, so long as | ||
| 765 | +(1) the source code for the derivative work includes prominent notice that | ||
| 766 | +the work is derivative, and (2) the source code includes prominent notice with | ||
| 767 | +these four paragraphs for those parts of this code that are retained. | ||
| 768 | + | ||
| 769 | +=============================================================================*/ | ||
| 770 | + | ||
| 771 | +/*---------------------------------------------------------------------------- | ||
| 772 | +| Underflow tininess-detection mode, statically initialized to default value. | ||
| 773 | +| (The declaration in `softfloat.h' must match the `int8' type here.) | ||
| 774 | +*----------------------------------------------------------------------------*/ | ||
| 775 | +int8 float_detect_tininess = float_tininess_before_rounding; | ||
| 776 | + | ||
| 777 | +/*---------------------------------------------------------------------------- | ||
| 778 | +| Raises the exceptions specified by `flags'. Floating-point traps can be | ||
| 779 | +| defined here if desired. It is currently not possible for such a trap | ||
| 780 | +| to substitute a result value. If traps are not implemented, this routine | ||
| 781 | +| should be simply `float_exception_flags |= flags;'. | ||
| 782 | +*----------------------------------------------------------------------------*/ | ||
| 783 | + | ||
| 784 | +void float_raise( int8 flags ) | ||
| 785 | +{ | ||
| 786 | + | ||
| 787 | + float_exception_flags |= flags; | ||
| 788 | + | ||
| 789 | +} | ||
| 790 | + | ||
| 791 | +/*---------------------------------------------------------------------------- | ||
| 792 | +| Internal canonical NaN format. | ||
| 793 | +*----------------------------------------------------------------------------*/ | ||
| 794 | +typedef struct { | ||
| 795 | + flag sign; | ||
| 796 | + bits64 high, low; | ||
| 797 | +} commonNaNT; | ||
| 798 | + | ||
| 799 | +/*---------------------------------------------------------------------------- | ||
| 800 | +| The pattern for a default generated single-precision NaN. | ||
| 801 | +*----------------------------------------------------------------------------*/ | ||
| 802 | +#define float32_default_nan 0x7FFFFFFF | ||
| 803 | + | ||
| 804 | +/*---------------------------------------------------------------------------- | ||
| 805 | +| Returns 1 if the single-precision floating-point value `a' is a NaN; | ||
| 806 | +| otherwise returns 0. | ||
| 807 | +*----------------------------------------------------------------------------*/ | ||
| 808 | + | ||
| 809 | +flag float32_is_nan( float32 a ) | ||
| 810 | +{ | ||
| 811 | + | ||
| 812 | + return ( 0xFF000000 < (bits32) ( a<<1 ) ); | ||
| 813 | + | ||
| 814 | +} | ||
| 815 | + | ||
| 816 | +/*---------------------------------------------------------------------------- | ||
| 817 | +| Returns 1 if the single-precision floating-point value `a' is a signaling | ||
| 818 | +| NaN; otherwise returns 0. | ||
| 819 | +*----------------------------------------------------------------------------*/ | ||
| 820 | + | ||
| 821 | +flag float32_is_signaling_nan( float32 a ) | ||
| 822 | +{ | ||
| 823 | + | ||
| 824 | + return ( ( ( a>>22 ) & 0x1FF ) == 0x1FE ) && ( a & 0x003FFFFF ); | ||
| 825 | + | ||
| 826 | +} | ||
| 827 | + | ||
| 828 | +/*---------------------------------------------------------------------------- | ||
| 829 | +| Returns the result of converting the single-precision floating-point NaN | ||
| 830 | +| `a' to the canonical NaN format. If `a' is a signaling NaN, the invalid | ||
| 831 | +| exception is raised. | ||
| 832 | +*----------------------------------------------------------------------------*/ | ||
| 833 | + | ||
| 834 | +static commonNaNT float32ToCommonNaN( float32 a ) | ||
| 835 | +{ | ||
| 836 | + commonNaNT z; | ||
| 837 | + | ||
| 838 | + if ( float32_is_signaling_nan( a ) ) float_raise( float_flag_invalid ); | ||
| 839 | + z.sign = a>>31; | ||
| 840 | + z.low = 0; | ||
| 841 | + z.high = ( (bits64) a )<<41; | ||
| 842 | + return z; | ||
| 843 | + | ||
| 844 | +} | ||
| 845 | + | ||
| 846 | +/*---------------------------------------------------------------------------- | ||
| 847 | +| Returns the result of converting the canonical NaN `a' to the single- | ||
| 848 | +| precision floating-point format. | ||
| 849 | +*----------------------------------------------------------------------------*/ | ||
| 850 | + | ||
| 851 | +static float32 commonNaNToFloat32( commonNaNT a ) | ||
| 852 | +{ | ||
| 853 | + | ||
| 854 | + return ( ( (bits32) a.sign )<<31 ) | 0x7FC00000 | ( a.high>>41 ); | ||
| 855 | + | ||
| 856 | +} | ||
| 857 | + | ||
| 858 | +/*---------------------------------------------------------------------------- | ||
| 859 | +| Takes two single-precision floating-point values `a' and `b', one of which | ||
| 860 | +| is a NaN, and returns the appropriate NaN result. If either `a' or `b' is a | ||
| 861 | +| signaling NaN, the invalid exception is raised. | ||
| 862 | +*----------------------------------------------------------------------------*/ | ||
| 863 | + | ||
| 864 | +static float32 propagateFloat32NaN( float32 a, float32 b ) | ||
| 865 | +{ | ||
| 866 | + flag aIsNaN, aIsSignalingNaN, bIsNaN, bIsSignalingNaN; | ||
| 867 | + | ||
| 868 | + aIsNaN = float32_is_nan( a ); | ||
| 869 | + aIsSignalingNaN = float32_is_signaling_nan( a ); | ||
| 870 | + bIsNaN = float32_is_nan( b ); | ||
| 871 | + bIsSignalingNaN = float32_is_signaling_nan( b ); | ||
| 872 | + a |= 0x00400000; | ||
| 873 | + b |= 0x00400000; | ||
| 874 | + if ( aIsSignalingNaN | bIsSignalingNaN ) float_raise( float_flag_invalid ); | ||
| 875 | + return bIsSignalingNaN ? b : aIsSignalingNaN ? a : bIsNaN ? b : a; | ||
| 876 | + | ||
| 877 | +} | ||
| 878 | + | ||
| 879 | +/*---------------------------------------------------------------------------- | ||
| 880 | +| The pattern for a default generated double-precision NaN. | ||
| 881 | +*----------------------------------------------------------------------------*/ | ||
| 882 | +#define float64_default_nan LIT64( 0x7FFFFFFFFFFFFFFF ) | ||
| 883 | + | ||
| 884 | +/*---------------------------------------------------------------------------- | ||
| 885 | +| Returns 1 if the double-precision floating-point value `a' is a NaN; | ||
| 886 | +| otherwise returns 0. | ||
| 887 | +*----------------------------------------------------------------------------*/ | ||
| 888 | + | ||
| 889 | +flag float64_is_nan( float64 a ) | ||
| 890 | +{ | ||
| 891 | + | ||
| 892 | + return ( LIT64( 0xFFE0000000000000 ) < (bits64) ( a<<1 ) ); | ||
| 893 | + | ||
| 894 | +} | ||
| 895 | + | ||
| 896 | +/*---------------------------------------------------------------------------- | ||
| 897 | +| Returns 1 if the double-precision floating-point value `a' is a signaling | ||
| 898 | +| NaN; otherwise returns 0. | ||
| 899 | +*----------------------------------------------------------------------------*/ | ||
| 900 | + | ||
| 901 | +flag float64_is_signaling_nan( float64 a ) | ||
| 902 | +{ | ||
| 903 | + | ||
| 904 | + return | ||
| 905 | + ( ( ( a>>51 ) & 0xFFF ) == 0xFFE ) | ||
| 906 | + && ( a & LIT64( 0x0007FFFFFFFFFFFF ) ); | ||
| 907 | + | ||
| 908 | +} | ||
| 909 | + | ||
| 910 | +/*---------------------------------------------------------------------------- | ||
| 911 | +| Returns the result of converting the double-precision floating-point NaN | ||
| 912 | +| `a' to the canonical NaN format. If `a' is a signaling NaN, the invalid | ||
| 913 | +| exception is raised. | ||
| 914 | +*----------------------------------------------------------------------------*/ | ||
| 915 | + | ||
| 916 | +static commonNaNT float64ToCommonNaN( float64 a ) | ||
| 917 | +{ | ||
| 918 | + commonNaNT z; | ||
| 919 | + | ||
| 920 | + if ( float64_is_signaling_nan( a ) ) float_raise( float_flag_invalid ); | ||
| 921 | + z.sign = a>>63; | ||
| 922 | + z.low = 0; | ||
| 923 | + z.high = a<<12; | ||
| 924 | + return z; | ||
| 925 | + | ||
| 926 | +} | ||
| 927 | + | ||
| 928 | +/*---------------------------------------------------------------------------- | ||
| 929 | +| Returns the result of converting the canonical NaN `a' to the double- | ||
| 930 | +| precision floating-point format. | ||
| 931 | +*----------------------------------------------------------------------------*/ | ||
| 932 | + | ||
| 933 | +static float64 commonNaNToFloat64( commonNaNT a ) | ||
| 934 | +{ | ||
| 935 | + | ||
| 936 | + return | ||
| 937 | + ( ( (bits64) a.sign )<<63 ) | ||
| 938 | + | LIT64( 0x7FF8000000000000 ) | ||
| 939 | + | ( a.high>>12 ); | ||
| 940 | + | ||
| 941 | +} | ||
| 942 | + | ||
| 943 | +/*---------------------------------------------------------------------------- | ||
| 944 | +| Takes two double-precision floating-point values `a' and `b', one of which | ||
| 945 | +| is a NaN, and returns the appropriate NaN result. If either `a' or `b' is a | ||
| 946 | +| signaling NaN, the invalid exception is raised. | ||
| 947 | +*----------------------------------------------------------------------------*/ | ||
| 948 | + | ||
| 949 | +static float64 propagateFloat64NaN( float64 a, float64 b ) | ||
| 950 | +{ | ||
| 951 | + flag aIsNaN, aIsSignalingNaN, bIsNaN, bIsSignalingNaN; | ||
| 952 | + | ||
| 953 | + aIsNaN = float64_is_nan( a ); | ||
| 954 | + aIsSignalingNaN = float64_is_signaling_nan( a ); | ||
| 955 | + bIsNaN = float64_is_nan( b ); | ||
| 956 | + bIsSignalingNaN = float64_is_signaling_nan( b ); | ||
| 957 | + a |= LIT64( 0x0008000000000000 ); | ||
| 958 | + b |= LIT64( 0x0008000000000000 ); | ||
| 959 | + if ( aIsSignalingNaN | bIsSignalingNaN ) float_raise( float_flag_invalid ); | ||
| 960 | + return bIsSignalingNaN ? b : aIsSignalingNaN ? a : bIsNaN ? b : a; | ||
| 961 | + | ||
| 962 | +} | ||
| 963 | + | ||
| 964 | +#ifdef FLOATX80 | ||
| 965 | + | ||
| 966 | +/*---------------------------------------------------------------------------- | ||
| 967 | +| The pattern for a default generated extended double-precision NaN. The | ||
| 968 | +| `high' and `low' values hold the most- and least-significant bits, | ||
| 969 | +| respectively. | ||
| 970 | +*----------------------------------------------------------------------------*/ | ||
| 971 | +#define floatx80_default_nan_high 0x7FFF | ||
| 972 | +#define floatx80_default_nan_low LIT64( 0xFFFFFFFFFFFFFFFF ) | ||
| 973 | + | ||
| 974 | +/*---------------------------------------------------------------------------- | ||
| 975 | +| Returns 1 if the extended double-precision floating-point value `a' is a | ||
| 976 | +| NaN; otherwise returns 0. | ||
| 977 | +*----------------------------------------------------------------------------*/ | ||
| 978 | + | ||
| 979 | +flag floatx80_is_nan( floatx80 a ) | ||
| 980 | +{ | ||
| 981 | + | ||
| 982 | + return ( ( a.high & 0x7FFF ) == 0x7FFF ) && (bits64) ( a.low<<1 ); | ||
| 983 | + | ||
| 984 | +} | ||
| 985 | + | ||
| 986 | +/*---------------------------------------------------------------------------- | ||
| 987 | +| Returns 1 if the extended double-precision floating-point value `a' is a | ||
| 988 | +| signaling NaN; otherwise returns 0. | ||
| 989 | +*----------------------------------------------------------------------------*/ | ||
| 990 | + | ||
| 991 | +flag floatx80_is_signaling_nan( floatx80 a ) | ||
| 992 | +{ | ||
| 993 | + bits64 aLow; | ||
| 994 | + | ||
| 995 | + aLow = a.low & ~ LIT64( 0x4000000000000000 ); | ||
| 996 | + return | ||
| 997 | + ( ( a.high & 0x7FFF ) == 0x7FFF ) | ||
| 998 | + && (bits64) ( aLow<<1 ) | ||
| 999 | + && ( a.low == aLow ); | ||
| 1000 | + | ||
| 1001 | +} | ||
| 1002 | + | ||
| 1003 | +/*---------------------------------------------------------------------------- | ||
| 1004 | +| Returns the result of converting the extended double-precision floating- | ||
| 1005 | +| point NaN `a' to the canonical NaN format. If `a' is a signaling NaN, the | ||
| 1006 | +| invalid exception is raised. | ||
| 1007 | +*----------------------------------------------------------------------------*/ | ||
| 1008 | + | ||
| 1009 | +static commonNaNT floatx80ToCommonNaN( floatx80 a ) | ||
| 1010 | +{ | ||
| 1011 | + commonNaNT z; | ||
| 1012 | + | ||
| 1013 | + if ( floatx80_is_signaling_nan( a ) ) float_raise( float_flag_invalid ); | ||
| 1014 | + z.sign = a.high>>15; | ||
| 1015 | + z.low = 0; | ||
| 1016 | + z.high = a.low<<1; | ||
| 1017 | + return z; | ||
| 1018 | + | ||
| 1019 | +} | ||
| 1020 | + | ||
| 1021 | +/*---------------------------------------------------------------------------- | ||
| 1022 | +| Returns the result of converting the canonical NaN `a' to the extended | ||
| 1023 | +| double-precision floating-point format. | ||
| 1024 | +*----------------------------------------------------------------------------*/ | ||
| 1025 | + | ||
| 1026 | +static floatx80 commonNaNToFloatx80( commonNaNT a ) | ||
| 1027 | +{ | ||
| 1028 | + floatx80 z; | ||
| 1029 | + | ||
| 1030 | + z.low = LIT64( 0xC000000000000000 ) | ( a.high>>1 ); | ||
| 1031 | + z.high = ( ( (bits16) a.sign )<<15 ) | 0x7FFF; | ||
| 1032 | + return z; | ||
| 1033 | + | ||
| 1034 | +} | ||
| 1035 | + | ||
| 1036 | +/*---------------------------------------------------------------------------- | ||
| 1037 | +| Takes two extended double-precision floating-point values `a' and `b', one | ||
| 1038 | +| of which is a NaN, and returns the appropriate NaN result. If either `a' or | ||
| 1039 | +| `b' is a signaling NaN, the invalid exception is raised. | ||
| 1040 | +*----------------------------------------------------------------------------*/ | ||
| 1041 | + | ||
| 1042 | +static floatx80 propagateFloatx80NaN( floatx80 a, floatx80 b ) | ||
| 1043 | +{ | ||
| 1044 | + flag aIsNaN, aIsSignalingNaN, bIsNaN, bIsSignalingNaN; | ||
| 1045 | + | ||
| 1046 | + aIsNaN = floatx80_is_nan( a ); | ||
| 1047 | + aIsSignalingNaN = floatx80_is_signaling_nan( a ); | ||
| 1048 | + bIsNaN = floatx80_is_nan( b ); | ||
| 1049 | + bIsSignalingNaN = floatx80_is_signaling_nan( b ); | ||
| 1050 | + a.low |= LIT64( 0xC000000000000000 ); | ||
| 1051 | + b.low |= LIT64( 0xC000000000000000 ); | ||
| 1052 | + if ( aIsSignalingNaN | bIsSignalingNaN ) float_raise( float_flag_invalid ); | ||
| 1053 | + return bIsSignalingNaN ? b : aIsSignalingNaN ? a : bIsNaN ? b : a; | ||
| 1054 | + | ||
| 1055 | +} | ||
| 1056 | + | ||
| 1057 | +#endif | ||
| 1058 | + | ||
| 1059 | +#ifdef FLOAT128 | ||
| 1060 | + | ||
| 1061 | +/*---------------------------------------------------------------------------- | ||
| 1062 | +| The pattern for a default generated quadruple-precision NaN. The `high' and | ||
| 1063 | +| `low' values hold the most- and least-significant bits, respectively. | ||
| 1064 | +*----------------------------------------------------------------------------*/ | ||
| 1065 | +#define float128_default_nan_high LIT64( 0x7FFFFFFFFFFFFFFF ) | ||
| 1066 | +#define float128_default_nan_low LIT64( 0xFFFFFFFFFFFFFFFF ) | ||
| 1067 | + | ||
| 1068 | +/*---------------------------------------------------------------------------- | ||
| 1069 | +| Returns 1 if the quadruple-precision floating-point value `a' is a NaN; | ||
| 1070 | +| otherwise returns 0. | ||
| 1071 | +*----------------------------------------------------------------------------*/ | ||
| 1072 | + | ||
| 1073 | +flag float128_is_nan( float128 a ) | ||
| 1074 | +{ | ||
| 1075 | + | ||
| 1076 | + return | ||
| 1077 | + ( LIT64( 0xFFFE000000000000 ) <= (bits64) ( a.high<<1 ) ) | ||
| 1078 | + && ( a.low || ( a.high & LIT64( 0x0000FFFFFFFFFFFF ) ) ); | ||
| 1079 | + | ||
| 1080 | +} | ||
| 1081 | + | ||
| 1082 | +/*---------------------------------------------------------------------------- | ||
| 1083 | +| Returns 1 if the quadruple-precision floating-point value `a' is a | ||
| 1084 | +| signaling NaN; otherwise returns 0. | ||
| 1085 | +*----------------------------------------------------------------------------*/ | ||
| 1086 | + | ||
| 1087 | +flag float128_is_signaling_nan( float128 a ) | ||
| 1088 | +{ | ||
| 1089 | + | ||
| 1090 | + return | ||
| 1091 | + ( ( ( a.high>>47 ) & 0xFFFF ) == 0xFFFE ) | ||
| 1092 | + && ( a.low || ( a.high & LIT64( 0x00007FFFFFFFFFFF ) ) ); | ||
| 1093 | + | ||
| 1094 | +} | ||
| 1095 | + | ||
| 1096 | +/*---------------------------------------------------------------------------- | ||
| 1097 | +| Returns the result of converting the quadruple-precision floating-point NaN | ||
| 1098 | +| `a' to the canonical NaN format. If `a' is a signaling NaN, the invalid | ||
| 1099 | +| exception is raised. | ||
| 1100 | +*----------------------------------------------------------------------------*/ | ||
| 1101 | + | ||
| 1102 | +static commonNaNT float128ToCommonNaN( float128 a ) | ||
| 1103 | +{ | ||
| 1104 | + commonNaNT z; | ||
| 1105 | + | ||
| 1106 | + if ( float128_is_signaling_nan( a ) ) float_raise( float_flag_invalid ); | ||
| 1107 | + z.sign = a.high>>63; | ||
| 1108 | + shortShift128Left( a.high, a.low, 16, &z.high, &z.low ); | ||
| 1109 | + return z; | ||
| 1110 | + | ||
| 1111 | +} | ||
| 1112 | + | ||
| 1113 | +/*---------------------------------------------------------------------------- | ||
| 1114 | +| Returns the result of converting the canonical NaN `a' to the quadruple- | ||
| 1115 | +| precision floating-point format. | ||
| 1116 | +*----------------------------------------------------------------------------*/ | ||
| 1117 | + | ||
| 1118 | +static float128 commonNaNToFloat128( commonNaNT a ) | ||
| 1119 | +{ | ||
| 1120 | + float128 z; | ||
| 1121 | + | ||
| 1122 | + shift128Right( a.high, a.low, 16, &z.high, &z.low ); | ||
| 1123 | + z.high |= ( ( (bits64) a.sign )<<63 ) | LIT64( 0x7FFF800000000000 ); | ||
| 1124 | + return z; | ||
| 1125 | + | ||
| 1126 | +} | ||
| 1127 | + | ||
| 1128 | +/*---------------------------------------------------------------------------- | ||
| 1129 | +| Takes two quadruple-precision floating-point values `a' and `b', one of | ||
| 1130 | +| which is a NaN, and returns the appropriate NaN result. If either `a' or | ||
| 1131 | +| `b' is a signaling NaN, the invalid exception is raised. | ||
| 1132 | +*----------------------------------------------------------------------------*/ | ||
| 1133 | + | ||
| 1134 | +static float128 propagateFloat128NaN( float128 a, float128 b ) | ||
| 1135 | +{ | ||
| 1136 | + flag aIsNaN, aIsSignalingNaN, bIsNaN, bIsSignalingNaN; | ||
| 1137 | + | ||
| 1138 | + aIsNaN = float128_is_nan( a ); | ||
| 1139 | + aIsSignalingNaN = float128_is_signaling_nan( a ); | ||
| 1140 | + bIsNaN = float128_is_nan( b ); | ||
| 1141 | + bIsSignalingNaN = float128_is_signaling_nan( b ); | ||
| 1142 | + a.high |= LIT64( 0x0000800000000000 ); | ||
| 1143 | + b.high |= LIT64( 0x0000800000000000 ); | ||
| 1144 | + if ( aIsSignalingNaN | bIsSignalingNaN ) float_raise( float_flag_invalid ); | ||
| 1145 | + return bIsSignalingNaN ? b : aIsSignalingNaN ? a : bIsNaN ? b : a; | ||
| 1146 | + | ||
| 1147 | +} | ||
| 1148 | + | ||
| 1149 | +#endif | ||
| 1150 | + | ||
| 1151 | diff --git a/SoftFloat-2b/softfloat/bits64/powerpc-GCC/softfloat.h b/SoftFloat-2b/softfloat/bits64/powerpc-GCC/softfloat.h | ||
| 1152 | new file mode 100644 | ||
| 1153 | index 0000000..5b7cb1c | ||
| 1154 | --- /dev/null | ||
| 1155 | +++ b/SoftFloat-2b/softfloat/bits64/powerpc-GCC/softfloat.h | ||
| 1156 | @@ -0,0 +1,269 @@ | ||
| 1157 | +/* | ||
| 1158 | + * This file is derived from softfloat/bits64/386-Win32-GCC/softfloat.h, | ||
| 1159 | + * the copyright for that material belongs to the original owners. | ||
| 1160 | + * | ||
| 1161 | + * Additional material and changes where applicable is: | ||
| 1162 | + * Copyright (C) 2008 Freescale Semiconductor, Inc. All rights reserved. | ||
| 1163 | + * | ||
| 1164 | + * Author: Ebony Zhu, <ebony.zhu@freescale.com> | ||
| 1165 | + * Yu Liu, <yu.liu@freescale.com> | ||
| 1166 | + */ | ||
| 1167 | + | ||
| 1168 | +/*============================================================================ | ||
| 1169 | + | ||
| 1170 | +This C header file is part of the SoftFloat IEC/IEEE Floating-point Arithmetic | ||
| 1171 | +Package, Release 2b. | ||
| 1172 | + | ||
| 1173 | +Written by John R. Hauser. This work was made possible in part by the | ||
| 1174 | +International Computer Science Institute, located at Suite 600, 1947 Center | ||
| 1175 | +Street, Berkeley, California 94704. Funding was partially provided by the | ||
| 1176 | +National Science Foundation under grant MIP-9311980. The original version | ||
| 1177 | +of this code was written as part of a project to build a fixed-point vector | ||
| 1178 | +processor in collaboration with the University of California at Berkeley, | ||
| 1179 | +overseen by Profs. Nelson Morgan and John Wawrzynek. More information | ||
| 1180 | +is available through the Web page `http://www.cs.berkeley.edu/~jhauser/ | ||
| 1181 | +arithmetic/SoftFloat.html'. | ||
| 1182 | + | ||
| 1183 | +THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort has | ||
| 1184 | +been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT TIMES | ||
| 1185 | +RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO PERSONS | ||
| 1186 | +AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ALL LOSSES, | ||
| 1187 | +COSTS, OR OTHER PROBLEMS THEY INCUR DUE TO THE SOFTWARE, AND WHO FURTHERMORE | ||
| 1188 | +EFFECTIVELY INDEMNIFY JOHN HAUSER AND THE INTERNATIONAL COMPUTER SCIENCE | ||
| 1189 | +INSTITUTE (possibly via similar legal warning) AGAINST ALL LOSSES, COSTS, OR | ||
| 1190 | +OTHER PROBLEMS INCURRED BY THEIR CUSTOMERS AND CLIENTS DUE TO THE SOFTWARE. | ||
| 1191 | + | ||
| 1192 | +Derivative works are acceptable, even for commercial purposes, so long as | ||
| 1193 | +(1) the source code for the derivative work includes prominent notice that | ||
| 1194 | +the work is derivative, and (2) the source code includes prominent notice with | ||
| 1195 | +these four paragraphs for those parts of this code that are retained. | ||
| 1196 | + | ||
| 1197 | +=============================================================================*/ | ||
| 1198 | + | ||
| 1199 | +/*---------------------------------------------------------------------------- | ||
| 1200 | +| The macro `FLOATX80' must be defined to enable the extended double-precision | ||
| 1201 | +| floating-point format `floatx80'. If this macro is not defined, the | ||
| 1202 | +| `floatx80' type will not be defined, and none of the functions that either | ||
| 1203 | +| input or output the `floatx80' type will be defined. The same applies to | ||
| 1204 | +| the `FLOAT128' macro and the quadruple-precision format `float128'. | ||
| 1205 | +*----------------------------------------------------------------------------*/ | ||
| 1206 | +#define FLOATX80 | ||
| 1207 | +#define FLOAT128 | ||
| 1208 | + | ||
| 1209 | +/*---------------------------------------------------------------------------- | ||
| 1210 | +| Software IEC/IEEE floating-point types. | ||
| 1211 | +*----------------------------------------------------------------------------*/ | ||
| 1212 | +typedef unsigned int float32; | ||
| 1213 | +typedef unsigned long long float64; | ||
| 1214 | +#ifdef FLOATX80 | ||
| 1215 | +typedef struct { | ||
| 1216 | + unsigned short high; | ||
| 1217 | + unsigned long long low; | ||
| 1218 | +} floatx80; | ||
| 1219 | +#endif | ||
| 1220 | +#ifdef FLOAT128 | ||
| 1221 | +typedef struct { | ||
| 1222 | + unsigned long long high, low; | ||
| 1223 | +} float128; | ||
| 1224 | +#endif | ||
| 1225 | + | ||
| 1226 | +/*---------------------------------------------------------------------------- | ||
| 1227 | +| Software IEC/IEEE floating-point underflow tininess-detection mode. | ||
| 1228 | +*----------------------------------------------------------------------------*/ | ||
| 1229 | +extern int float_detect_tininess; | ||
| 1230 | +enum { | ||
| 1231 | + float_tininess_after_rounding = 0, | ||
| 1232 | + float_tininess_before_rounding = 1 | ||
| 1233 | +}; | ||
| 1234 | + | ||
| 1235 | +/*---------------------------------------------------------------------------- | ||
| 1236 | +| Software IEC/IEEE floating-point rounding mode. | ||
| 1237 | +*----------------------------------------------------------------------------*/ | ||
| 1238 | +extern int float_rounding_mode; | ||
| 1239 | +enum { | ||
| 1240 | + float_round_nearest_even = 0, | ||
| 1241 | + float_round_to_zero = 1, | ||
| 1242 | + float_round_up = 2, | ||
| 1243 | + float_round_down = 3 | ||
| 1244 | +}; | ||
| 1245 | + | ||
| 1246 | +/*---------------------------------------------------------------------------- | ||
| 1247 | +| Software IEC/IEEE floating-point exception flags. | ||
| 1248 | +*----------------------------------------------------------------------------*/ | ||
| 1249 | +extern int float_exception_flags; | ||
| 1250 | +enum { | ||
| 1251 | + float_flag_inexact = 1, | ||
| 1252 | + float_flag_divbyzero = 2, | ||
| 1253 | + float_flag_underflow = 4, | ||
| 1254 | + float_flag_overflow = 8, | ||
| 1255 | + float_flag_invalid = 16 | ||
| 1256 | +}; | ||
| 1257 | + | ||
| 1258 | +/*---------------------------------------------------------------------------- | ||
| 1259 | +| Routine to raise any or all of the software IEC/IEEE floating-point | ||
| 1260 | +| exception flags. | ||
| 1261 | +*----------------------------------------------------------------------------*/ | ||
| 1262 | +void float_raise( int ); | ||
| 1263 | + | ||
| 1264 | +/*---------------------------------------------------------------------------- | ||
| 1265 | +| Software IEC/IEEE integer-to-floating-point conversion routines. | ||
| 1266 | +*----------------------------------------------------------------------------*/ | ||
| 1267 | +float32 int32_to_float32( int ); | ||
| 1268 | +float64 int32_to_float64( int ); | ||
| 1269 | +#ifdef FLOATX80 | ||
| 1270 | +floatx80 int32_to_floatx80( int ); | ||
| 1271 | +#endif | ||
| 1272 | +#ifdef FLOAT128 | ||
| 1273 | +float128 int32_to_float128( int ); | ||
| 1274 | +#endif | ||
| 1275 | +float32 int64_to_float32( long long ); | ||
| 1276 | +float64 int64_to_float64( long long ); | ||
| 1277 | +#ifdef FLOATX80 | ||
| 1278 | +floatx80 int64_to_floatx80( long long ); | ||
| 1279 | +#endif | ||
| 1280 | +#ifdef FLOAT128 | ||
| 1281 | +float128 int64_to_float128( long long ); | ||
| 1282 | +#endif | ||
| 1283 | + | ||
| 1284 | +/*---------------------------------------------------------------------------- | ||
| 1285 | +| Software IEC/IEEE single-precision conversion routines. | ||
| 1286 | +*----------------------------------------------------------------------------*/ | ||
| 1287 | +int float32_to_int32( float32 ); | ||
| 1288 | +int float32_to_int32_round_to_zero( float32 ); | ||
| 1289 | +long long float32_to_int64( float32 ); | ||
| 1290 | +long long float32_to_int64_round_to_zero( float32 ); | ||
| 1291 | +float64 float32_to_float64( float32 ); | ||
| 1292 | +#ifdef FLOATX80 | ||
| 1293 | +floatx80 float32_to_floatx80( float32 ); | ||
| 1294 | +#endif | ||
| 1295 | +#ifdef FLOAT128 | ||
| 1296 | +float128 float32_to_float128( float32 ); | ||
| 1297 | +#endif | ||
| 1298 | + | ||
| 1299 | +/*---------------------------------------------------------------------------- | ||
| 1300 | +| Software IEC/IEEE single-precision operations. | ||
| 1301 | +*----------------------------------------------------------------------------*/ | ||
| 1302 | +float32 float32_round_to_int( float32 ); | ||
| 1303 | +float32 float32_add( float32, float32 ); | ||
| 1304 | +float32 float32_sub( float32, float32 ); | ||
| 1305 | +float32 float32_mul( float32, float32 ); | ||
| 1306 | +float32 float32_div( float32, float32 ); | ||
| 1307 | +float32 float32_rem( float32, float32 ); | ||
| 1308 | +float32 float32_sqrt( float32 ); | ||
| 1309 | +int float32_eq( float32, float32 ); | ||
| 1310 | +int float32_le( float32, float32 ); | ||
| 1311 | +int float32_lt( float32, float32 ); | ||
| 1312 | +int float32_eq_signaling( float32, float32 ); | ||
| 1313 | +int float32_le_quiet( float32, float32 ); | ||
| 1314 | +int float32_lt_quiet( float32, float32 ); | ||
| 1315 | +int float32_is_signaling_nan( float32 ); | ||
| 1316 | + | ||
| 1317 | +/*---------------------------------------------------------------------------- | ||
| 1318 | +| Software IEC/IEEE double-precision conversion routines. | ||
| 1319 | +*----------------------------------------------------------------------------*/ | ||
| 1320 | +int float64_to_int32( float64 ); | ||
| 1321 | +int float64_to_int32_round_to_zero( float64 ); | ||
| 1322 | +long long float64_to_int64( float64 ); | ||
| 1323 | +long long float64_to_int64_round_to_zero( float64 ); | ||
| 1324 | +float32 float64_to_float32( float64 ); | ||
| 1325 | +#ifdef FLOATX80 | ||
| 1326 | +floatx80 float64_to_floatx80( float64 ); | ||
| 1327 | +#endif | ||
| 1328 | +#ifdef FLOAT128 | ||
| 1329 | +float128 float64_to_float128( float64 ); | ||
| 1330 | +#endif | ||
| 1331 | + | ||
| 1332 | +/*---------------------------------------------------------------------------- | ||
| 1333 | +| Software IEC/IEEE double-precision operations. | ||
| 1334 | +*----------------------------------------------------------------------------*/ | ||
| 1335 | +float64 float64_round_to_int( float64 ); | ||
| 1336 | +float64 float64_add( float64, float64 ); | ||
| 1337 | +float64 float64_sub( float64, float64 ); | ||
| 1338 | +float64 float64_mul( float64, float64 ); | ||
| 1339 | +float64 float64_div( float64, float64 ); | ||
| 1340 | +float64 float64_rem( float64, float64 ); | ||
| 1341 | +float64 float64_sqrt( float64 ); | ||
| 1342 | +int float64_eq( float64, float64 ); | ||
| 1343 | +int float64_le( float64, float64 ); | ||
| 1344 | +int float64_lt( float64, float64 ); | ||
| 1345 | +int float64_eq_signaling( float64, float64 ); | ||
| 1346 | +int float64_le_quiet( float64, float64 ); | ||
| 1347 | +int float64_lt_quiet( float64, float64 ); | ||
| 1348 | +int float64_is_signaling_nan( float64 ); | ||
| 1349 | + | ||
| 1350 | +#ifdef FLOATX80 | ||
| 1351 | + | ||
| 1352 | +/*---------------------------------------------------------------------------- | ||
| 1353 | +| Software IEC/IEEE extended double-precision conversion routines. | ||
| 1354 | +*----------------------------------------------------------------------------*/ | ||
| 1355 | +int floatx80_to_int32( floatx80 ); | ||
| 1356 | +int floatx80_to_int32_round_to_zero( floatx80 ); | ||
| 1357 | +long long floatx80_to_int64( floatx80 ); | ||
| 1358 | +long long floatx80_to_int64_round_to_zero( floatx80 ); | ||
| 1359 | +float32 floatx80_to_float32( floatx80 ); | ||
| 1360 | +float64 floatx80_to_float64( floatx80 ); | ||
| 1361 | +#ifdef FLOAT128 | ||
| 1362 | +float128 floatx80_to_float128( floatx80 ); | ||
| 1363 | +#endif | ||
| 1364 | + | ||
| 1365 | +/*---------------------------------------------------------------------------- | ||
| 1366 | +| Software IEC/IEEE extended double-precision rounding precision. Valid | ||
| 1367 | +| values are 32, 64, and 80. | ||
| 1368 | +*----------------------------------------------------------------------------*/ | ||
| 1369 | +extern int floatx80_rounding_precision; | ||
| 1370 | + | ||
| 1371 | +/*---------------------------------------------------------------------------- | ||
| 1372 | +| Software IEC/IEEE extended double-precision operations. | ||
| 1373 | +*----------------------------------------------------------------------------*/ | ||
| 1374 | +floatx80 floatx80_round_to_int( floatx80 ); | ||
| 1375 | +floatx80 floatx80_add( floatx80, floatx80 ); | ||
| 1376 | +floatx80 floatx80_sub( floatx80, floatx80 ); | ||
| 1377 | +floatx80 floatx80_mul( floatx80, floatx80 ); | ||
| 1378 | +floatx80 floatx80_div( floatx80, floatx80 ); | ||
| 1379 | +floatx80 floatx80_rem( floatx80, floatx80 ); | ||
| 1380 | +floatx80 floatx80_sqrt( floatx80 ); | ||
| 1381 | +int floatx80_eq( floatx80, floatx80 ); | ||
| 1382 | +int floatx80_le( floatx80, floatx80 ); | ||
| 1383 | +int floatx80_lt( floatx80, floatx80 ); | ||
| 1384 | +int floatx80_eq_signaling( floatx80, floatx80 ); | ||
| 1385 | +int floatx80_le_quiet( floatx80, floatx80 ); | ||
| 1386 | +int floatx80_lt_quiet( floatx80, floatx80 ); | ||
| 1387 | +int floatx80_is_signaling_nan( floatx80 ); | ||
| 1388 | + | ||
| 1389 | +#endif | ||
| 1390 | + | ||
| 1391 | +#ifdef FLOAT128 | ||
| 1392 | + | ||
| 1393 | +/*---------------------------------------------------------------------------- | ||
| 1394 | +| Software IEC/IEEE quadruple-precision conversion routines. | ||
| 1395 | +*----------------------------------------------------------------------------*/ | ||
| 1396 | +int float128_to_int32( float128 ); | ||
| 1397 | +int float128_to_int32_round_to_zero( float128 ); | ||
| 1398 | +long long float128_to_int64( float128 ); | ||
| 1399 | +long long float128_to_int64_round_to_zero( float128 ); | ||
| 1400 | +float32 float128_to_float32( float128 ); | ||
| 1401 | +float64 float128_to_float64( float128 ); | ||
| 1402 | +#ifdef FLOATX80 | ||
| 1403 | +floatx80 float128_to_floatx80( float128 ); | ||
| 1404 | +#endif | ||
| 1405 | + | ||
| 1406 | +/*---------------------------------------------------------------------------- | ||
| 1407 | +| Software IEC/IEEE quadruple-precision operations. | ||
| 1408 | +*----------------------------------------------------------------------------*/ | ||
| 1409 | +float128 float128_round_to_int( float128 ); | ||
| 1410 | +float128 float128_add( float128, float128 ); | ||
| 1411 | +float128 float128_sub( float128, float128 ); | ||
| 1412 | +float128 float128_mul( float128, float128 ); | ||
| 1413 | +float128 float128_div( float128, float128 ); | ||
| 1414 | +float128 float128_rem( float128, float128 ); | ||
| 1415 | +float128 float128_sqrt( float128 ); | ||
| 1416 | +int float128_eq( float128, float128 ); | ||
| 1417 | +int float128_le( float128, float128 ); | ||
| 1418 | +int float128_lt( float128, float128 ); | ||
| 1419 | +int float128_eq_signaling( float128, float128 ); | ||
| 1420 | +int float128_le_quiet( float128, float128 ); | ||
| 1421 | +int float128_lt_quiet( float128, float128 ); | ||
| 1422 | +int float128_is_signaling_nan( float128 ); | ||
| 1423 | + | ||
| 1424 | +#endif | ||
| 1425 | + | ||
| 1426 | -- | ||
| 1427 | 1.5.4 | ||
| 1428 | |||
diff --git a/recipes-extended/testfloat/files/TestFloat-powerpc-E500v2-SPE-1.patch b/recipes-extended/testfloat/files/TestFloat-powerpc-E500v2-SPE-1.patch deleted file mode 100644 index 2e9041749..000000000 --- a/recipes-extended/testfloat/files/TestFloat-powerpc-E500v2-SPE-1.patch +++ /dev/null | |||
| @@ -1,1645 +0,0 @@ | |||
| 1 | This patch adds PowerPC E500v2 SPE support in TestFloat. | ||
| 2 | And it disables the testing for hardware that can not trigger SPE interrupt. | ||
| 3 | |||
| 4 | Upstream-Status: Pending | ||
| 5 | Signed-off-by: Ebony Zhu <ebony.zhu@freescale.com> | ||
| 6 | Signed-off-by: Liu Yu <Yu.Liu@freescale.com> | ||
| 7 | --- | ||
| 8 | processors/POWERPC-gcc.h | 99 +++++ | ||
| 9 | testfloat/powerpc-linux-gcc/Makefile | 83 +++++ | ||
| 10 | testfloat/powerpc-linux-gcc/milieu.h | 71 ++++ | ||
| 11 | testfloat/powerpc-linux-gcc/systflags.c | 107 ++++++ | ||
| 12 | testfloat/powerpc-linux-gcc/systfloat.c | 595 +++++++++++++++++++++++++++++++ | ||
| 13 | testfloat/powerpc-linux-gcc/systmodes.c | 67 ++++ | ||
| 14 | testfloat/templates/Makefile | 18 +- | ||
| 15 | testfloat/templates/milieu.h | 2 +- | ||
| 16 | testfloat/testFunction.h | 2 +- | ||
| 17 | testfloat/testLoops.c | 216 +++++++++++ | ||
| 18 | 10 files changed, 1252 insertions(+), 8 deletions(-) | ||
| 19 | create mode 100644 processors/POWERPC-gcc.h | ||
| 20 | create mode 100644 testfloat/powerpc-linux-gcc/Makefile | ||
| 21 | create mode 100644 testfloat/powerpc-linux-gcc/milieu.h | ||
| 22 | create mode 100644 testfloat/powerpc-linux-gcc/systflags.c | ||
| 23 | create mode 100644 testfloat/powerpc-linux-gcc/systfloat.c | ||
| 24 | create mode 100644 testfloat/powerpc-linux-gcc/systmodes.c | ||
| 25 | |||
| 26 | diff --git a/processors/POWERPC-gcc.h b/processors/POWERPC-gcc.h | ||
| 27 | new file mode 100644 | ||
| 28 | index 0000000..4201faa | ||
| 29 | --- /dev/null | ||
| 30 | +++ b/processors/POWERPC-gcc.h | ||
| 31 | @@ -0,0 +1,99 @@ | ||
| 32 | +/* | ||
| 33 | + * This file is derived from processors/i386-GCC.h, | ||
| 34 | + * the copyright for that material belongs to the original owners. | ||
| 35 | + * | ||
| 36 | + * Additional material and changes where applicable is: | ||
| 37 | + * Copyright (C) 2008 Freescale Semiconductor, Inc. All rights reserved. | ||
| 38 | + * | ||
| 39 | + * Author: Ebony Zhu, <ebony.zhu@freescale.com> | ||
| 40 | + * Yu Liu, <yu.liu@freescale.com> | ||
| 41 | + * | ||
| 42 | + * THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort has | ||
| 43 | + * been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT TIMES | ||
| 44 | + * RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO PERSONS | ||
| 45 | + * AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ALL LOSSES, | ||
| 46 | + * COSTS, OR OTHER PROBLEMS THEY INCUR DUE TO THE SOFTWARE, AND WHO FURTHERMORE | ||
| 47 | + * EFFECTIVELY INDEMNIFY JOHN HAUSER AND THE INTERNATIONAL COMPUTER SCIENCE | ||
| 48 | + * INSTITUTE (possibly via similar legal warning) AGAINST ALL LOSSES, COSTS, OR | ||
| 49 | + * OTHER PROBLEMS INCURRED BY THEIR CUSTOMERS AND CLIENTS DUE TO THE SOFTWARE. | ||
| 50 | + */ | ||
| 51 | + | ||
| 52 | +/* | ||
| 53 | +------------------------------------------------------------------------------- | ||
| 54 | +One of the macros `BIGENDIAN' or `LITTLEENDIAN' must be defined. | ||
| 55 | +------------------------------------------------------------------------------- | ||
| 56 | +*/ | ||
| 57 | +#define BIGENDIAN | ||
| 58 | + | ||
| 59 | +/* | ||
| 60 | +------------------------------------------------------------------------------- | ||
| 61 | +The macro `BITS64' can be defined to indicate that 64-bit integer types are | ||
| 62 | +supported by the compiler. | ||
| 63 | +------------------------------------------------------------------------------- | ||
| 64 | +*/ | ||
| 65 | +#undef BITS64 | ||
| 66 | + | ||
| 67 | +/* | ||
| 68 | +------------------------------------------------------------------------------- | ||
| 69 | +Each of the following `typedef's defines the most convenient type that holds | ||
| 70 | +integers of at least as many bits as specified. For example, `uint8' should | ||
| 71 | +be the most convenient type that can hold unsigned integers of as many as | ||
| 72 | +8 bits. The `flag' type must be able to hold either a 0 or 1. For most | ||
| 73 | +implementations of C, `flag', `uint8', and `int8' should all be `typedef'ed | ||
| 74 | +to the same as `int'. | ||
| 75 | +------------------------------------------------------------------------------- | ||
| 76 | +*/ | ||
| 77 | +typedef int flag; | ||
| 78 | +typedef int uint8; | ||
| 79 | +typedef int int8; | ||
| 80 | +typedef int uint16; | ||
| 81 | +typedef int int16; | ||
| 82 | +typedef unsigned int uint32; | ||
| 83 | +typedef signed int int32; | ||
| 84 | +#ifdef BITS64 | ||
| 85 | +typedef unsigned long long int uint64; | ||
| 86 | +typedef signed long long int int64; | ||
| 87 | +#endif | ||
| 88 | + | ||
| 89 | +/* | ||
| 90 | +------------------------------------------------------------------------------- | ||
| 91 | +Each of the following `typedef's defines a type that holds integers | ||
| 92 | +of _exactly_ the number of bits specified. For instance, for most | ||
| 93 | +implementation of C, `bits16' and `sbits16' should be `typedef'ed to | ||
| 94 | +`unsigned short int' and `signed short int' (or `short int'), respectively. | ||
| 95 | +------------------------------------------------------------------------------- | ||
| 96 | +*/ | ||
| 97 | +typedef unsigned char bits8; | ||
| 98 | +typedef signed char sbits8; | ||
| 99 | +typedef unsigned short int bits16; | ||
| 100 | +typedef signed short int sbits16; | ||
| 101 | +typedef unsigned int bits32; | ||
| 102 | +typedef signed int sbits32; | ||
| 103 | +#ifdef BITS64 | ||
| 104 | +typedef unsigned long long int bits64; | ||
| 105 | +typedef signed long long int sbits64; | ||
| 106 | +#endif | ||
| 107 | + | ||
| 108 | +#ifdef BITS64 | ||
| 109 | +/* | ||
| 110 | +------------------------------------------------------------------------------- | ||
| 111 | +The `LIT64' macro takes as its argument a textual integer literal and | ||
| 112 | +if necessary ``marks'' the literal as having a 64-bit integer type. | ||
| 113 | +For example, the GNU C Compiler (`gcc') requires that 64-bit literals be | ||
| 114 | +appended with the letters `LL' standing for `long long', which is `gcc's | ||
| 115 | +name for the 64-bit integer type. Some compilers may allow `LIT64' to be | ||
| 116 | +defined as the identity macro: `#define LIT64( a ) a'. | ||
| 117 | +------------------------------------------------------------------------------- | ||
| 118 | +*/ | ||
| 119 | +#define LIT64( a ) a##LL | ||
| 120 | +#endif | ||
| 121 | + | ||
| 122 | +/* | ||
| 123 | +------------------------------------------------------------------------------- | ||
| 124 | +The macro `INLINE' can be used before functions that should be inlined. If | ||
| 125 | +a compiler does not support explicit inlining, this macro should be defined | ||
| 126 | +to be `static'. | ||
| 127 | +------------------------------------------------------------------------------- | ||
| 128 | +*/ | ||
| 129 | +#define INLINE extern inline | ||
| 130 | + | ||
| 131 | diff --git a/testfloat/powerpc-linux-gcc/Makefile b/testfloat/powerpc-linux-gcc/Makefile | ||
| 132 | new file mode 100644 | ||
| 133 | index 0000000..de50aad | ||
| 134 | --- /dev/null | ||
| 135 | +++ b/testfloat/powerpc-linux-gcc/Makefile | ||
| 136 | @@ -0,0 +1,83 @@ | ||
| 137 | + | ||
| 138 | +PROCESSOR_H = ../../processors/POWERPC-gcc.h | ||
| 139 | +SOFTFLOAT_VERSION = bits32 | ||
| 140 | +TARGET = powerpc-GCC | ||
| 141 | +SOFTFLOAT_DIR = ../../SoftFloat-2b/softfloat/$(SOFTFLOAT_VERSION)/$(TARGET) | ||
| 142 | + | ||
| 143 | +OBJ = .o | ||
| 144 | +EXE = | ||
| 145 | +INCLUDES = -I. -I.. -I$(SOFTFLOAT_DIR) | ||
| 146 | + | ||
| 147 | +COMPILE_C = $(COMPILE_PREFIX)gcc -c -o $@ $(INCLUDES) -I- -O $(EXTRA_CFLAGS) | ||
| 148 | + | ||
| 149 | +COMPILE_C_HARD = $(COMPILE_PREFIX)gcc -c -te500v2 -o $@ $(INCLUDES) | ||
| 150 | + | ||
| 151 | +COMPILE_SLOWFLOAT_C = $(COMPILE_PREFIX)gcc -c -o $@ $(INCLUDES) -I- -O | ||
| 152 | + | ||
| 153 | +LINK = $(COMPILE_PREFIX)gcc -lm -o $@ | ||
| 154 | + | ||
| 155 | +SOFTFLOAT_H = $(SOFTFLOAT_DIR)/softfloat.h | ||
| 156 | +SOFTFLOAT_OBJ = $(SOFTFLOAT_DIR)/softfloat$(OBJ) | ||
| 157 | + | ||
| 158 | +ALL: testsoftfloat$(EXE) testfloat$(EXE) | ||
| 159 | + | ||
| 160 | +systmodes$(OBJ): milieu.h systmodes.c | ||
| 161 | + $(COMPILE_C) systmodes.c | ||
| 162 | + | ||
| 163 | +systflags$(OBJ): milieu.h ../systflags.h systflags.c | ||
| 164 | + $(COMPILE_C) systflags.c | ||
| 165 | + | ||
| 166 | +systfloat$(OBJ): milieu.h $(SOFTFLOAT_H) ../systfloat.h systfloat.c | ||
| 167 | + $(COMPILE_C_HARD) systfloat.c | ||
| 168 | + | ||
| 169 | +#------------------------------------------------------------------------------ | ||
| 170 | +# Probably O.K. below here. | ||
| 171 | +#------------------------------------------------------------------------------ | ||
| 172 | + | ||
| 173 | +milieu.h: $(PROCESSOR_H) | ||
| 174 | + touch milieu.h | ||
| 175 | + | ||
| 176 | +fail$(OBJ): milieu.h ../fail.h | ||
| 177 | + $(COMPILE_C) ../fail.c | ||
| 178 | + | ||
| 179 | +random$(OBJ): milieu.h ../random.h | ||
| 180 | + $(COMPILE_C) ../random.c | ||
| 181 | + | ||
| 182 | +testCases$(OBJ): milieu.h ../fail.h ../random.h $(SOFTFLOAT_H) ../testCases.h ../testCases.c | ||
| 183 | + $(COMPILE_C) ../testCases.c | ||
| 184 | + | ||
| 185 | +writeHex$(OBJ): milieu.h $(SOFTFLOAT_H) ../writeHex.h ../writeHex.c | ||
| 186 | + $(COMPILE_C) ../writeHex.c | ||
| 187 | + | ||
| 188 | +testLoops$(OBJ): milieu.h $(SOFTFLOAT_H) ../testCases.h ../writeHex.h ../testLoops.h ../testLoops.c | ||
| 189 | + $(COMPILE_C) ../testLoops.c | ||
| 190 | + | ||
| 191 | +slowfloat$(OBJ): milieu.h $(SOFTFLOAT_H) ../slowfloat.h ../slowfloat-32.c ../slowfloat-64.c ../slowfloat.c | ||
| 192 | + $(COMPILE_SLOWFLOAT_C) ../slowfloat.c | ||
| 193 | + | ||
| 194 | +testsoftfloat$(OBJ): milieu.h ../fail.h $(SOFTFLOAT_H) ../testCases.h ../testLoops.h ../slowfloat.h ../testsoftfloat.c | ||
| 195 | + $(COMPILE_C) ../testsoftfloat.c | ||
| 196 | + | ||
| 197 | +testsoftfloat$(EXE): fail$(OBJ) random$(OBJ) $(SOFTFLOAT_OBJ) testCases$(OBJ) writeHex$(OBJ) testLoops$(OBJ) slowfloat$(OBJ) testsoftfloat$(OBJ) systflags$(OBJ) systmodes$(OBJ) | ||
| 198 | + $(LINK) fail$(OBJ) random$(OBJ) $(SOFTFLOAT_OBJ) testCases$(OBJ) writeHex$(OBJ) testLoops$(OBJ) slowfloat$(OBJ) testsoftfloat$(OBJ) systflags$(OBJ) systmodes$(OBJ) | ||
| 199 | + | ||
| 200 | +testFunction$(OBJ): milieu.h $(SOFTFLOAT_H) ../testCases.h ../testLoops.h ../systmodes.h ../systflags.h ../systfloat.h ../testFunction.h ../testFunction.c | ||
| 201 | + $(COMPILE_C) ../testFunction.c | ||
| 202 | + | ||
| 203 | +testfloat$(OBJ): milieu.h ../fail.h $(SOFTFLOAT_H) ../testCases.h ../testLoops.h ../systflags.h ../testFunction.h ../testfloat.c | ||
| 204 | + $(COMPILE_C) ../testfloat.c | ||
| 205 | + | ||
| 206 | +testfloat$(EXE): fail$(OBJ) random$(OBJ) $(SOFTFLOAT_OBJ) testCases$(OBJ) writeHex$(OBJ) testLoops$(OBJ) systmodes$(OBJ) systflags$(OBJ) systfloat$(OBJ) testFunction$(OBJ) testfloat$(OBJ) | ||
| 207 | + $(LINK) fail$(OBJ) random$(OBJ) $(SOFTFLOAT_OBJ) testCases$(OBJ) writeHex$(OBJ) testLoops$(OBJ) systmodes$(OBJ) systflags$(OBJ) systfloat$(OBJ) testFunction$(OBJ) testfloat$(OBJ) | ||
| 208 | + | ||
| 209 | +$(SOFTFLOAT_OBJ): | ||
| 210 | + make -C $(SOFTFLOAT_DIR) | ||
| 211 | + | ||
| 212 | +cp: ALL | ||
| 213 | + cp testsoftfloat$(EXE) ../../test_softfloat$(EXE) | ||
| 214 | + cp testfloat$(EXE) ../../test_float$(EXE) | ||
| 215 | + | ||
| 216 | +clean: | ||
| 217 | + make -C $(SOFTFLOAT_DIR) clean | ||
| 218 | + rm -f *.o testfloat$(EXE) testsoftfloat$(EXE) | ||
| 219 | + rm -f ../../test_softfloat$(EXE) ../../test_float$(EXE) | ||
| 220 | diff --git a/testfloat/powerpc-linux-gcc/milieu.h b/testfloat/powerpc-linux-gcc/milieu.h | ||
| 221 | new file mode 100644 | ||
| 222 | index 0000000..29d2b18 | ||
| 223 | --- /dev/null | ||
| 224 | +++ b/testfloat/powerpc-linux-gcc/milieu.h | ||
| 225 | @@ -0,0 +1,71 @@ | ||
| 226 | +/* | ||
| 227 | + * This file is derived from testfloat/386-Win32-gcc/milieu.h, | ||
| 228 | + * the copyright for that material belongs to the original owners. | ||
| 229 | + * | ||
| 230 | + * Additional material and changes where applicable is: | ||
| 231 | + * Copyright (C) 2008 Freescale Semiconductor, Inc. All rights reserved. | ||
| 232 | + * | ||
| 233 | + * Author: Ebony Zhu, <ebony.zhu@freescale.com> | ||
| 234 | + * Yu Liu, <yu.liu@freescale.com> | ||
| 235 | + */ | ||
| 236 | + | ||
| 237 | +/* | ||
| 238 | +=============================================================================== | ||
| 239 | + | ||
| 240 | +This C header file is part of TestFloat, Release 2a, a package of programs | ||
| 241 | +for testing the correctness of floating-point arithmetic complying to the | ||
| 242 | +IEC/IEEE Standard for Floating-Point. | ||
| 243 | + | ||
| 244 | +Written by John R. Hauser. More information is available through the Web | ||
| 245 | +page `http://HTTP.CS.Berkeley.EDU/~jhauser/arithmetic/TestFloat.html'. | ||
| 246 | + | ||
| 247 | +THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort | ||
| 248 | +has been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT | ||
| 249 | +TIMES RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO | ||
| 250 | +PERSONS AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ANY | ||
| 251 | +AND ALL LOSSES, COSTS, OR OTHER PROBLEMS ARISING FROM ITS USE. | ||
| 252 | + | ||
| 253 | +Derivative works are acceptable, even for commercial purposes, so long as | ||
| 254 | +(1) they include prominent notice that the work is derivative, and (2) they | ||
| 255 | +include prominent notice akin to these four paragraphs for those parts of | ||
| 256 | +this code that are retained. | ||
| 257 | + | ||
| 258 | +=============================================================================== | ||
| 259 | +*/ | ||
| 260 | + | ||
| 261 | +/* | ||
| 262 | +------------------------------------------------------------------------------- | ||
| 263 | +Include common integer types and flags. | ||
| 264 | +------------------------------------------------------------------------------- | ||
| 265 | +*/ | ||
| 266 | +#include "../../processors/POWERPC-gcc.h" | ||
| 267 | +/* | ||
| 268 | +------------------------------------------------------------------------------- | ||
| 269 | +If the `BITS64' macro is defined by the processor header file but the | ||
| 270 | +version of SoftFloat being used/tested is the 32-bit one (`bits32'), the | ||
| 271 | +`BITS64' macro must be undefined here. | ||
| 272 | +------------------------------------------------------------------------------- | ||
| 273 | +*/ | ||
| 274 | + | ||
| 275 | +#undef BITS64 | ||
| 276 | +/* | ||
| 277 | +------------------------------------------------------------------------------- | ||
| 278 | +The macro `LONG_DOUBLE_IS_FLOATX80' can be defined to indicate that the | ||
| 279 | +C compiler supports the type `long double' as an extended double-precision | ||
| 280 | +format. Alternatively, the macro `LONG_DOUBLE_IS_FLOAT128' can be defined | ||
| 281 | +to indicate that `long double' is a quadruple-precision format. If neither | ||
| 282 | +of these macros is defined, `long double' will be ignored. | ||
| 283 | +------------------------------------------------------------------------------- | ||
| 284 | +#define LONG_DOUBLE_IS_FLOATX80 | ||
| 285 | +*/ | ||
| 286 | + | ||
| 287 | +/* | ||
| 288 | +------------------------------------------------------------------------------- | ||
| 289 | +Symbolic Boolean literals. | ||
| 290 | +------------------------------------------------------------------------------- | ||
| 291 | +*/ | ||
| 292 | +enum { | ||
| 293 | + FALSE = 0, | ||
| 294 | + TRUE = 1 | ||
| 295 | +}; | ||
| 296 | + | ||
| 297 | diff --git a/testfloat/powerpc-linux-gcc/systflags.c b/testfloat/powerpc-linux-gcc/systflags.c | ||
| 298 | new file mode 100644 | ||
| 299 | index 0000000..c382442 | ||
| 300 | --- /dev/null | ||
| 301 | +++ b/testfloat/powerpc-linux-gcc/systflags.c | ||
| 302 | @@ -0,0 +1,107 @@ | ||
| 303 | +/* | ||
| 304 | + * This file is derived from testfloat/386-Win32-gcc/systflags.c, | ||
| 305 | + * the copyright for that material belongs to the original owners. | ||
| 306 | + * | ||
| 307 | + * Additional material and changes where applicable is: | ||
| 308 | + * Copyright (C) 2008 Freescale Semiconductor, Inc. All rights reserved. | ||
| 309 | + * | ||
| 310 | + * Author: Ebony Zhu, <ebony.zhu@freescale.com> | ||
| 311 | + * Yu Liu, <yu.liu@freescale.com> | ||
| 312 | + */ | ||
| 313 | + | ||
| 314 | +/* | ||
| 315 | +=============================================================================== | ||
| 316 | + | ||
| 317 | +This C source file is part of TestFloat, Release 2a, a package of programs | ||
| 318 | +for testing the correctness of floating-point arithmetic complying to the | ||
| 319 | +IEC/IEEE Standard for Floating-Point. | ||
| 320 | + | ||
| 321 | +Written by John R. Hauser. More information is available through the Web | ||
| 322 | +page `http://HTTP.CS.Berkeley.EDU/~jhauser/arithmetic/TestFloat.html'. | ||
| 323 | + | ||
| 324 | +THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort | ||
| 325 | +has been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT | ||
| 326 | +TIMES RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO | ||
| 327 | +PERSONS AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ANY | ||
| 328 | +AND ALL LOSSES, COSTS, OR OTHER PROBLEMS ARISING FROM ITS USE. | ||
| 329 | + | ||
| 330 | +Derivative works are acceptable, even for commercial purposes, so long as | ||
| 331 | +(1) they include prominent notice that the work is derivative, and (2) they | ||
| 332 | +include prominent notice akin to these four paragraphs for those parts of | ||
| 333 | +this code that are retained. | ||
| 334 | + | ||
| 335 | +=============================================================================== | ||
| 336 | +*/ | ||
| 337 | + | ||
| 338 | +#include "milieu.h" | ||
| 339 | +#include "systflags.h" | ||
| 340 | +#include <fenv.h> | ||
| 341 | +#include <stdio.h> | ||
| 342 | +#include <math.h> | ||
| 343 | +#include <bits/nan.h> | ||
| 344 | +#include <bits/inf.h> | ||
| 345 | + | ||
| 346 | +#ifdef __SPE__ | ||
| 347 | + | ||
| 348 | +#include <spe.h> | ||
| 349 | + | ||
| 350 | + | ||
| 351 | +#define SPE_FINV_ENABLE (1UL << 5) | ||
| 352 | +#define SPE_FDBZ_ENABLE (1UL << 4) | ||
| 353 | +#define SPE_FUNF_ENABLE (1UL << 3) | ||
| 354 | +#define SPE_FOVF_ENABLE (1UL << 2) | ||
| 355 | + | ||
| 356 | +#define SPE_FG (1UL << 13) | ||
| 357 | +#define SPE_FX (1UL << 12) | ||
| 358 | +#define SPE_FINV (1UL << 11) | ||
| 359 | +#define SPE_FDBZ (1UL << 10) | ||
| 360 | +#define SPE_FUNF (1UL << 9) | ||
| 361 | +#define SPE_FOVF (1UL << 8) | ||
| 362 | + | ||
| 363 | +#define SPE_FG_H (1UL << 29) | ||
| 364 | +#define SPE_FX_H (1UL << 28) | ||
| 365 | +#define SPE_FINV_H (1UL << 27) | ||
| 366 | +#define SPE_FDBZ_H (1UL << 26) | ||
| 367 | +#define SPE_FUNF_H (1UL << 25) | ||
| 368 | +#define SPE_FOVF_H (1UL << 24) | ||
| 369 | + | ||
| 370 | +static int is_soft_emu = 0; | ||
| 371 | + | ||
| 372 | +#endif | ||
| 373 | +/* | ||
| 374 | +------------------------------------------------------------------------------- | ||
| 375 | +Clears the system's IEC/IEEE floating-point exception flags. Returns the | ||
| 376 | +previous value of the flags. | ||
| 377 | +------------------------------------------------------------------------------- | ||
| 378 | +*/ | ||
| 379 | +extern int rounding; | ||
| 380 | +unsigned int spefscr = 0; | ||
| 381 | + | ||
| 382 | +int8 syst_float_flags_clear( void ) | ||
| 383 | +{ | ||
| 384 | +#ifdef TEST_KERNEL_EMU | ||
| 385 | + if( (spefscr & (SPE_FINV | SPE_FINV_H)) | ||
| 386 | + || (spefscr & (SPE_FDBZ | SPE_FDBZ_H)) | ||
| 387 | + || (spefscr & (SPE_FUNF | SPE_FUNF_H)) | ||
| 388 | + || (spefscr & (SPE_FOVF | SPE_FOVF_H)) | ||
| 389 | + || (spefscr & (SPE_FX | SPE_FG | SPE_FX_H | SPE_FG_H))){ | ||
| 390 | + is_soft_emu = 1; | ||
| 391 | + } else { | ||
| 392 | + is_soft_emu = 0; | ||
| 393 | + } | ||
| 394 | +#endif | ||
| 395 | + __builtin_spe_mtspefscr(0x3c|(rounding & 0x3)); | ||
| 396 | + | ||
| 397 | + return ((spefscr>>17) & 0x1f); | ||
| 398 | +} | ||
| 399 | + | ||
| 400 | +int syst_float_is_soft_emu(void) | ||
| 401 | +{ | ||
| 402 | + int ret = 0; | ||
| 403 | +#ifdef TEST_KERNEL_EMU | ||
| 404 | + ret = is_soft_emu; | ||
| 405 | +#endif | ||
| 406 | + return ret; | ||
| 407 | +} | ||
| 408 | + | ||
| 409 | + | ||
| 410 | diff --git a/testfloat/powerpc-linux-gcc/systfloat.c b/testfloat/powerpc-linux-gcc/systfloat.c | ||
| 411 | new file mode 100644 | ||
| 412 | index 0000000..8d06f9f | ||
| 413 | --- /dev/null | ||
| 414 | +++ b/testfloat/powerpc-linux-gcc/systfloat.c | ||
| 415 | @@ -0,0 +1,595 @@ | ||
| 416 | +/* | ||
| 417 | + * This file is derived from testfloat/systfloat.c, | ||
| 418 | + * the copyright for that material belongs to the original owners. | ||
| 419 | + * | ||
| 420 | + * Additional material and changes where applicable is: | ||
| 421 | + * Copyright (C) 2008 Freescale Semiconductor, Inc. All rights reserved. | ||
| 422 | + * | ||
| 423 | + * Author: Ebony Zhu, <ebony.zhu@freescale.com> | ||
| 424 | + * Yu Liu, <yu.liu@freescale.com> | ||
| 425 | + */ | ||
| 426 | + | ||
| 427 | +/* | ||
| 428 | +=============================================================================== | ||
| 429 | + | ||
| 430 | +This C source file is part of TestFloat, Release 2a, a package of programs | ||
| 431 | +for testing the correctness of floating-point arithmetic complying to the | ||
| 432 | +IEC/IEEE Standard for Floating-Point. | ||
| 433 | + | ||
| 434 | +Written by John R. Hauser. More information is available through the Web | ||
| 435 | +page `http://HTTP.CS.Berkeley.EDU/~jhauser/arithmetic/TestFloat.html'. | ||
| 436 | + | ||
| 437 | +THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort | ||
| 438 | +has been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT | ||
| 439 | +TIMES RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO | ||
| 440 | +PERSONS AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ANY | ||
| 441 | +AND ALL LOSSES, COSTS, OR OTHER PROBLEMS ARISING FROM ITS USE. | ||
| 442 | + | ||
| 443 | +Derivative works are acceptable, even for commercial purposes, so long as | ||
| 444 | +(1) they include prominent notice that the work is derivative, and (2) they | ||
| 445 | +include prominent notice akin to these four paragraphs for those parts of | ||
| 446 | +this code that are retained. | ||
| 447 | + | ||
| 448 | +=============================================================================== | ||
| 449 | +*/ | ||
| 450 | + | ||
| 451 | +#include <math.h> | ||
| 452 | +#include "milieu.h" | ||
| 453 | +#include "softfloat.h" | ||
| 454 | +#include "systfloat.h" | ||
| 455 | + | ||
| 456 | +extern unsigned int spefscr; | ||
| 457 | + | ||
| 458 | +float32 syst_int32_to_float32( int32 a ) | ||
| 459 | +{ | ||
| 460 | + float32 z; | ||
| 461 | + | ||
| 462 | + *( (float *) &z ) = a; | ||
| 463 | + spefscr = __builtin_spe_mfspefscr(); | ||
| 464 | + return z; | ||
| 465 | + | ||
| 466 | +} | ||
| 467 | + | ||
| 468 | +float64 syst_int32_to_float64( int32 a ) | ||
| 469 | +{ | ||
| 470 | + float64 z; | ||
| 471 | + | ||
| 472 | + *( (double *) &z ) = a; | ||
| 473 | + spefscr = __builtin_spe_mfspefscr(); | ||
| 474 | + return z; | ||
| 475 | + | ||
| 476 | +} | ||
| 477 | + | ||
| 478 | +#if defined( FLOATX80 ) && defined( LONG_DOUBLE_IS_FLOATX80 ) | ||
| 479 | + | ||
| 480 | +floatx80 syst_int32_to_floatx80( int32 a ) | ||
| 481 | +{ | ||
| 482 | + floatx80 z; | ||
| 483 | + | ||
| 484 | + *( (long double *) &z ) = a; | ||
| 485 | + return z; | ||
| 486 | + | ||
| 487 | +} | ||
| 488 | + | ||
| 489 | +#endif | ||
| 490 | + | ||
| 491 | +#if defined( FLOAT128 ) && defined( LONG_DOUBLE_IS_FLOAT128 ) | ||
| 492 | + | ||
| 493 | +float128 syst_int32_to_float128( int32 a ) | ||
| 494 | +{ | ||
| 495 | + float128 z; | ||
| 496 | + | ||
| 497 | + *( (long double *) &z ) = a; | ||
| 498 | + return z; | ||
| 499 | + | ||
| 500 | +} | ||
| 501 | + | ||
| 502 | +#endif | ||
| 503 | + | ||
| 504 | +#ifdef BITS64 | ||
| 505 | + | ||
| 506 | +float32 syst_int64_to_float32( int64 a ) | ||
| 507 | +{ | ||
| 508 | + float32 z; | ||
| 509 | + | ||
| 510 | + *( (float *) &z ) = a; | ||
| 511 | + spefscr = __builtin_spe_mfspefscr(); | ||
| 512 | + return z; | ||
| 513 | + | ||
| 514 | +} | ||
| 515 | + | ||
| 516 | +float64 syst_int64_to_float64( int64 a ) | ||
| 517 | +{ | ||
| 518 | + float64 z; | ||
| 519 | + | ||
| 520 | + *( (double *) &z ) = a; | ||
| 521 | + spefscr = __builtin_spe_mfspefscr(); | ||
| 522 | + return z; | ||
| 523 | + | ||
| 524 | +} | ||
| 525 | + | ||
| 526 | +#if defined( FLOATX80 ) && defined( LONG_DOUBLE_IS_FLOATX80 ) | ||
| 527 | + | ||
| 528 | +floatx80 syst_int64_to_floatx80( int64 a ) | ||
| 529 | +{ | ||
| 530 | + floatx80 z; | ||
| 531 | + | ||
| 532 | + *( (long double *) &z ) = a; | ||
| 533 | + return z; | ||
| 534 | + | ||
| 535 | +} | ||
| 536 | + | ||
| 537 | +#endif | ||
| 538 | + | ||
| 539 | +#if defined( FLOAT128 ) && defined( LONG_DOUBLE_IS_FLOAT128 ) | ||
| 540 | + | ||
| 541 | +float128 syst_int64_to_float128( int64 a ) | ||
| 542 | +{ | ||
| 543 | + float128 z; | ||
| 544 | + | ||
| 545 | + *( (long double *) &z ) = a; | ||
| 546 | + return z; | ||
| 547 | + | ||
| 548 | +} | ||
| 549 | + | ||
| 550 | +#endif | ||
| 551 | + | ||
| 552 | +#endif | ||
| 553 | + | ||
| 554 | +int32 syst_float32_to_int32_round_to_zero( float32 a ) | ||
| 555 | +{ | ||
| 556 | + int32 z = *( (float *) &a ); | ||
| 557 | + spefscr = __builtin_spe_mfspefscr(); | ||
| 558 | + | ||
| 559 | + return z; | ||
| 560 | + | ||
| 561 | +} | ||
| 562 | + | ||
| 563 | +#ifdef BITS64 | ||
| 564 | + | ||
| 565 | +int64 syst_float32_to_int64_round_to_zero( float32 a ) | ||
| 566 | +{ | ||
| 567 | + int64 z = *( (float *) &a ); | ||
| 568 | + spefscr = __builtin_spe_mfspefscr(); | ||
| 569 | + return z; | ||
| 570 | + | ||
| 571 | +} | ||
| 572 | + | ||
| 573 | +#endif | ||
| 574 | + | ||
| 575 | +float64 syst_float32_to_float64( float32 a ) | ||
| 576 | +{ | ||
| 577 | + float64 z; | ||
| 578 | + | ||
| 579 | + *( (double *) &z ) = *( (float *) &a ); | ||
| 580 | + spefscr = __builtin_spe_mfspefscr(); | ||
| 581 | + return z; | ||
| 582 | + | ||
| 583 | +} | ||
| 584 | + | ||
| 585 | +#if defined( FLOATX80 ) && defined( LONG_DOUBLE_IS_FLOATX80 ) | ||
| 586 | + | ||
| 587 | +floatx80 syst_float32_to_floatx80( float32 a ) | ||
| 588 | +{ | ||
| 589 | + floatx80 z; | ||
| 590 | + | ||
| 591 | + *( (long double *) &z ) = *( (float *) &a ); | ||
| 592 | + return z; | ||
| 593 | + | ||
| 594 | +} | ||
| 595 | + | ||
| 596 | +#endif | ||
| 597 | + | ||
| 598 | +#if defined( FLOAT128 ) && defined( LONG_DOUBLE_IS_FLOAT128 ) | ||
| 599 | + | ||
| 600 | +float128 syst_float32_to_float128( float32 a ) | ||
| 601 | +{ | ||
| 602 | + float128 z; | ||
| 603 | + | ||
| 604 | + *( (long double *) &z ) = *( (float *) &a ); | ||
| 605 | + return z; | ||
| 606 | + | ||
| 607 | +} | ||
| 608 | + | ||
| 609 | +#endif | ||
| 610 | + | ||
| 611 | +float32 syst_float32_add( float32 a, float32 b ) | ||
| 612 | +{ | ||
| 613 | + float32 z; | ||
| 614 | + | ||
| 615 | + *( (float *) &z ) = *( (float *) &a ) + *( (float *) &b ); | ||
| 616 | + spefscr = __builtin_spe_mfspefscr(); | ||
| 617 | + return z; | ||
| 618 | + | ||
| 619 | +} | ||
| 620 | + | ||
| 621 | +float32 syst_float32_sub( float32 a, float32 b ) | ||
| 622 | +{ | ||
| 623 | + float32 z; | ||
| 624 | + | ||
| 625 | + *( (float *) &z ) = *( (float *) &a ) - *( (float *) &b ); | ||
| 626 | + spefscr = __builtin_spe_mfspefscr(); | ||
| 627 | + return z; | ||
| 628 | + | ||
| 629 | +} | ||
| 630 | + | ||
| 631 | +float32 syst_float32_mul( float32 a, float32 b ) | ||
| 632 | +{ | ||
| 633 | + float32 z; | ||
| 634 | + | ||
| 635 | + *( (float *) &z ) = *( (float *) &a ) * *( (float *) &b ); | ||
| 636 | + spefscr = __builtin_spe_mfspefscr(); | ||
| 637 | + return z; | ||
| 638 | + | ||
| 639 | +} | ||
| 640 | + | ||
| 641 | +float32 syst_float32_div( float32 a, float32 b ) | ||
| 642 | +{ | ||
| 643 | + float32 z; | ||
| 644 | + | ||
| 645 | + *( (float *) &z ) = *( (float *) &a ) / *( (float *) &b ); | ||
| 646 | + spefscr = __builtin_spe_mfspefscr(); | ||
| 647 | + return z; | ||
| 648 | + | ||
| 649 | +} | ||
| 650 | + | ||
| 651 | +flag syst_float32_eq( float32 a, float32 b ) | ||
| 652 | +{ | ||
| 653 | + flag f = ( *( (float *) &a ) == *( (float *) &b ) ); | ||
| 654 | + spefscr = __builtin_spe_mfspefscr(); | ||
| 655 | + return f; | ||
| 656 | + | ||
| 657 | +} | ||
| 658 | + | ||
| 659 | +flag syst_float32_le( float32 a, float32 b ) | ||
| 660 | +{ | ||
| 661 | + flag f = ( *( (float *) &a ) <= *( (float *) &b ) ); | ||
| 662 | + spefscr = __builtin_spe_mfspefscr(); | ||
| 663 | + return f; | ||
| 664 | + | ||
| 665 | +} | ||
| 666 | + | ||
| 667 | +flag syst_float32_lt( float32 a, float32 b ) | ||
| 668 | +{ | ||
| 669 | + flag f = ( *( (float *) &a ) < *( (float *) &b ) ); | ||
| 670 | + spefscr = __builtin_spe_mfspefscr(); | ||
| 671 | + return f; | ||
| 672 | + | ||
| 673 | +} | ||
| 674 | + | ||
| 675 | +int32 syst_float64_to_int32_round_to_zero( float64 a ) | ||
| 676 | +{ | ||
| 677 | + int32 z = *( (double *) &a ); | ||
| 678 | + spefscr = __builtin_spe_mfspefscr(); | ||
| 679 | + return z; | ||
| 680 | + | ||
| 681 | +} | ||
| 682 | + | ||
| 683 | +#ifdef BITS64 | ||
| 684 | + | ||
| 685 | +int64 syst_float64_to_int64_round_to_zero( float64 a ) | ||
| 686 | +{ | ||
| 687 | + int64 z = *( (double *) &a ); | ||
| 688 | + spefscr = __builtin_spe_mfspefscr(); | ||
| 689 | + return z; | ||
| 690 | + | ||
| 691 | +} | ||
| 692 | + | ||
| 693 | +#endif | ||
| 694 | + | ||
| 695 | +float32 syst_float64_to_float32( float64 a ) | ||
| 696 | +{ | ||
| 697 | + float32 z; | ||
| 698 | + | ||
| 699 | + *( (float *) &z ) = *( (double *) &a ); | ||
| 700 | + spefscr = __builtin_spe_mfspefscr(); | ||
| 701 | + return z; | ||
| 702 | + | ||
| 703 | +} | ||
| 704 | + | ||
| 705 | +#if defined( FLOATX80 ) && defined( LONG_DOUBLE_IS_FLOATX80 ) | ||
| 706 | + | ||
| 707 | +floatx80 syst_float64_to_floatx80( float64 a ) | ||
| 708 | +{ | ||
| 709 | + floatx80 z; | ||
| 710 | + | ||
| 711 | + *( (long double *) &z ) = *( (double *) &a ); | ||
| 712 | + return z; | ||
| 713 | + | ||
| 714 | +} | ||
| 715 | + | ||
| 716 | +#endif | ||
| 717 | + | ||
| 718 | +#if defined( FLOAT128 ) && defined( LONG_DOUBLE_IS_FLOAT128 ) | ||
| 719 | + | ||
| 720 | +float128 syst_float64_to_float128( float64 a ) | ||
| 721 | +{ | ||
| 722 | + float128 z; | ||
| 723 | + | ||
| 724 | + *( (long double *) &z ) = *( (double *) &a ); | ||
| 725 | + return z; | ||
| 726 | + | ||
| 727 | +} | ||
| 728 | + | ||
| 729 | +#endif | ||
| 730 | + | ||
| 731 | +float64 syst_float64_add( float64 a, float64 b ) | ||
| 732 | +{ | ||
| 733 | + float64 z; | ||
| 734 | + | ||
| 735 | + *( (double *) &z ) = *( (double *) &a ) + *( (double *) &b ); | ||
| 736 | + spefscr = __builtin_spe_mfspefscr(); | ||
| 737 | + return z; | ||
| 738 | + | ||
| 739 | +} | ||
| 740 | + | ||
| 741 | +float64 syst_float64_sub( float64 a, float64 b ) | ||
| 742 | +{ | ||
| 743 | + float64 z; | ||
| 744 | + | ||
| 745 | + *( (double *) &z ) = *( (double *) &a ) - *( (double *) &b ); | ||
| 746 | + spefscr = __builtin_spe_mfspefscr(); | ||
| 747 | + return z; | ||
| 748 | + | ||
| 749 | +} | ||
| 750 | + | ||
| 751 | +float64 syst_float64_mul( float64 a, float64 b ) | ||
| 752 | +{ | ||
| 753 | + float64 z; | ||
| 754 | + | ||
| 755 | + *( (double *) &z ) = *( (double *) &a ) * *( (double *) &b ); | ||
| 756 | + spefscr = __builtin_spe_mfspefscr(); | ||
| 757 | + return z; | ||
| 758 | + | ||
| 759 | +} | ||
| 760 | + | ||
| 761 | +float64 syst_float64_div( float64 a, float64 b ) | ||
| 762 | +{ | ||
| 763 | + float64 z; | ||
| 764 | + | ||
| 765 | + *( (double *) &z ) = *( (double *) &a ) / *( (double *) &b ); | ||
| 766 | + spefscr = __builtin_spe_mfspefscr(); | ||
| 767 | + return z; | ||
| 768 | + | ||
| 769 | +} | ||
| 770 | + | ||
| 771 | +float64 syst_float64_sqrt( float64 a ) | ||
| 772 | +{ | ||
| 773 | + /* Ebony | ||
| 774 | + float64 z; | ||
| 775 | + | ||
| 776 | + *( (double *) &z ) = sqrt( *( (double *) &a ) ); | ||
| 777 | + spefscr = __builtin_spe_mfspefscr(); | ||
| 778 | + return z; | ||
| 779 | + */ | ||
| 780 | + | ||
| 781 | +} | ||
| 782 | + | ||
| 783 | +flag syst_float64_eq( float64 a, float64 b ) | ||
| 784 | +{ | ||
| 785 | + flag f = ( *( (double *) &a ) == *( (double *) &b ) ); | ||
| 786 | + spefscr = __builtin_spe_mfspefscr(); | ||
| 787 | + return f; | ||
| 788 | + | ||
| 789 | +} | ||
| 790 | + | ||
| 791 | +flag syst_float64_le( float64 a, float64 b ) | ||
| 792 | +{ | ||
| 793 | + flag f = ( *( (double *) &a ) <= *( (double *) &b ) ); | ||
| 794 | + spefscr = __builtin_spe_mfspefscr(); | ||
| 795 | + return f; | ||
| 796 | + | ||
| 797 | +} | ||
| 798 | + | ||
| 799 | +flag syst_float64_lt( float64 a, float64 b ) | ||
| 800 | +{ | ||
| 801 | + flag f = ( *( (double *) &a ) < *( (double *) &b ) ); | ||
| 802 | + spefscr = __builtin_spe_mfspefscr(); | ||
| 803 | + return f; | ||
| 804 | + | ||
| 805 | +} | ||
| 806 | + | ||
| 807 | +#if defined( FLOATX80 ) && defined( LONG_DOUBLE_IS_FLOATX80 ) | ||
| 808 | + | ||
| 809 | +int32 syst_floatx80_to_int32_round_to_zero( floatx80 a ) | ||
| 810 | +{ | ||
| 811 | + | ||
| 812 | + return *( (long double *) &a ); | ||
| 813 | + | ||
| 814 | +} | ||
| 815 | + | ||
| 816 | +#ifdef BITS64 | ||
| 817 | + | ||
| 818 | +int64 syst_floatx80_to_int64_round_to_zero( floatx80 a ) | ||
| 819 | +{ | ||
| 820 | + | ||
| 821 | + return *( (long double *) &a ); | ||
| 822 | + | ||
| 823 | +} | ||
| 824 | + | ||
| 825 | +#endif | ||
| 826 | + | ||
| 827 | +float32 syst_floatx80_to_float32( floatx80 a ) | ||
| 828 | +{ | ||
| 829 | + float32 z; | ||
| 830 | + | ||
| 831 | + *( (float *) &z ) = *( (long double *) &a ); | ||
| 832 | + return z; | ||
| 833 | + | ||
| 834 | +} | ||
| 835 | + | ||
| 836 | +float64 syst_floatx80_to_float64( floatx80 a ) | ||
| 837 | +{ | ||
| 838 | + float64 z; | ||
| 839 | + | ||
| 840 | + *( (double *) &z ) = *( (long double *) &a ); | ||
| 841 | + return z; | ||
| 842 | + | ||
| 843 | +} | ||
| 844 | + | ||
| 845 | +floatx80 syst_floatx80_add( floatx80 a, floatx80 b ) | ||
| 846 | +{ | ||
| 847 | + floatx80 z; | ||
| 848 | + | ||
| 849 | + *( (long double *) &z ) = | ||
| 850 | + *( (long double *) &a ) + *( (long double *) &b ); | ||
| 851 | + return z; | ||
| 852 | + | ||
| 853 | +} | ||
| 854 | + | ||
| 855 | +floatx80 syst_floatx80_sub( floatx80 a, floatx80 b ) | ||
| 856 | +{ | ||
| 857 | + floatx80 z; | ||
| 858 | + | ||
| 859 | + *( (long double *) &z ) = | ||
| 860 | + *( (long double *) &a ) - *( (long double *) &b ); | ||
| 861 | + return z; | ||
| 862 | + | ||
| 863 | +} | ||
| 864 | + | ||
| 865 | +floatx80 syst_floatx80_mul( floatx80 a, floatx80 b ) | ||
| 866 | +{ | ||
| 867 | + floatx80 z; | ||
| 868 | + | ||
| 869 | + *( (long double *) &z ) = | ||
| 870 | + *( (long double *) &a ) * *( (long double *) &b ); | ||
| 871 | + return z; | ||
| 872 | + | ||
| 873 | +} | ||
| 874 | + | ||
| 875 | +floatx80 syst_floatx80_div( floatx80 a, floatx80 b ) | ||
| 876 | +{ | ||
| 877 | + floatx80 z; | ||
| 878 | + | ||
| 879 | + *( (long double *) &z ) = | ||
| 880 | + *( (long double *) &a ) / *( (long double *) &b ); | ||
| 881 | + spefscr = __builtin_spe_mfspefscr(); | ||
| 882 | + return z; | ||
| 883 | + | ||
| 884 | +} | ||
| 885 | + | ||
| 886 | +flag syst_floatx80_eq( floatx80 a, floatx80 b ) | ||
| 887 | +{ | ||
| 888 | + | ||
| 889 | + return ( *( (long double *) &a ) == *( (long double *) &b ) ); | ||
| 890 | + | ||
| 891 | +} | ||
| 892 | + | ||
| 893 | +flag syst_floatx80_le( floatx80 a, floatx80 b ) | ||
| 894 | +{ | ||
| 895 | + | ||
| 896 | + return ( *( (long double *) &a ) <= *( (long double *) &b ) ); | ||
| 897 | + | ||
| 898 | +} | ||
| 899 | + | ||
| 900 | +flag syst_floatx80_lt( floatx80 a, floatx80 b ) | ||
| 901 | +{ | ||
| 902 | + | ||
| 903 | + return ( *( (long double *) &a ) < *( (long double *) &b ) ); | ||
| 904 | + | ||
| 905 | +} | ||
| 906 | + | ||
| 907 | +#endif | ||
| 908 | + | ||
| 909 | +#if defined( FLOAT128 ) && defined( LONG_DOUBLE_IS_FLOAT128 ) | ||
| 910 | + | ||
| 911 | +int32 syst_float128_to_int32_round_to_zero( float128 a ) | ||
| 912 | +{ | ||
| 913 | + | ||
| 914 | + return *( (long double *) &a ); | ||
| 915 | + | ||
| 916 | +} | ||
| 917 | + | ||
| 918 | +#ifdef BITS64 | ||
| 919 | + | ||
| 920 | +int64 syst_float128_to_int64_round_to_zero( float128 a ) | ||
| 921 | +{ | ||
| 922 | + | ||
| 923 | + return *( (long double *) &a ); | ||
| 924 | + | ||
| 925 | +} | ||
| 926 | + | ||
| 927 | +#endif | ||
| 928 | + | ||
| 929 | +float32 syst_float128_to_float32( float128 a ) | ||
| 930 | +{ | ||
| 931 | + float32 z; | ||
| 932 | + | ||
| 933 | + *( (float *) &z ) = *( (long double *) &a ); | ||
| 934 | + return z; | ||
| 935 | + | ||
| 936 | +} | ||
| 937 | + | ||
| 938 | +float64 syst_float128_to_float64( float128 a ) | ||
| 939 | +{ | ||
| 940 | + float64 z; | ||
| 941 | + | ||
| 942 | + *( (double *) &z ) = *( (long double *) &a ); | ||
| 943 | + return z; | ||
| 944 | + | ||
| 945 | +} | ||
| 946 | + | ||
| 947 | +float128 syst_float128_add( float128 a, float128 b ) | ||
| 948 | +{ | ||
| 949 | + float128 z; | ||
| 950 | + | ||
| 951 | + *( (long double *) &z ) = | ||
| 952 | + *( (long double *) &a ) + *( (long double *) &b ); | ||
| 953 | + return z; | ||
| 954 | + | ||
| 955 | +} | ||
| 956 | + | ||
| 957 | +float128 syst_float128_sub( float128 a, float128 b ) | ||
| 958 | +{ | ||
| 959 | + float128 z; | ||
| 960 | + | ||
| 961 | + *( (long double *) &z ) = | ||
| 962 | + *( (long double *) &a ) - *( (long double *) &b ); | ||
| 963 | + return z; | ||
| 964 | + | ||
| 965 | +} | ||
| 966 | + | ||
| 967 | +float128 syst_float128_mul( float128 a, float128 b ) | ||
| 968 | +{ | ||
| 969 | + float128 z; | ||
| 970 | + | ||
| 971 | + *( (long double *) &z ) = | ||
| 972 | + *( (long double *) &a ) * *( (long double *) &b ); | ||
| 973 | + return z; | ||
| 974 | + | ||
| 975 | +} | ||
| 976 | + | ||
| 977 | +float128 syst_float128_div( float128 a, float128 b ) | ||
| 978 | +{ | ||
| 979 | + float128 z; | ||
| 980 | + | ||
| 981 | + *( (long double *) &z ) = | ||
| 982 | + *( (long double *) &a ) / *( (long double *) &b ); | ||
| 983 | + spefscr = __builtin_spe_mfspefscr(); | ||
| 984 | + return z; | ||
| 985 | + | ||
| 986 | +} | ||
| 987 | + | ||
| 988 | +flag syst_float128_eq( float128 a, float128 b ) | ||
| 989 | +{ | ||
| 990 | + | ||
| 991 | + return ( *( (long double *) &a ) == *( (long double *) &b ) ); | ||
| 992 | + | ||
| 993 | +} | ||
| 994 | + | ||
| 995 | +flag syst_float128_le( float128 a, float128 b ) | ||
| 996 | +{ | ||
| 997 | + | ||
| 998 | + return ( *( (long double *) &a ) <= *( (long double *) &b ) ); | ||
| 999 | + | ||
| 1000 | +} | ||
| 1001 | + | ||
| 1002 | +flag syst_float128_lt( float128 a, float128 b ) | ||
| 1003 | +{ | ||
| 1004 | + | ||
| 1005 | + return ( *( (long double *) &a ) < *( (long double *) &b ) ); | ||
| 1006 | + | ||
| 1007 | +} | ||
| 1008 | + | ||
| 1009 | +#endif | ||
| 1010 | + | ||
| 1011 | diff --git a/testfloat/powerpc-linux-gcc/systmodes.c b/testfloat/powerpc-linux-gcc/systmodes.c | ||
| 1012 | new file mode 100644 | ||
| 1013 | index 0000000..143cdea | ||
| 1014 | --- /dev/null | ||
| 1015 | +++ b/testfloat/powerpc-linux-gcc/systmodes.c | ||
| 1016 | @@ -0,0 +1,67 @@ | ||
| 1017 | +/* | ||
| 1018 | + * This file is derived from testfloat/386-Win32-gcc/systmodes.S, | ||
| 1019 | + * the copyright for that material belongs to the original owners. | ||
| 1020 | + * | ||
| 1021 | + * Additional material and changes where applicable is: | ||
| 1022 | + * Copyright (C) 2008 Freescale Semiconductor, Inc. All rights reserved. | ||
| 1023 | + * | ||
| 1024 | + * Author: Ebony Zhu, <ebony.zhu@freescale.com> | ||
| 1025 | + * Yu Liu, <yu.liu@freescale.com> | ||
| 1026 | + */ | ||
| 1027 | + | ||
| 1028 | +/* | ||
| 1029 | +=============================================================================== | ||
| 1030 | + | ||
| 1031 | +This C source file is part of TestFloat, Release 2a, a package of programs | ||
| 1032 | +for testing the correctness of floating-point arithmetic complying to the | ||
| 1033 | +IEC/IEEE Standard for Floating-Point. | ||
| 1034 | + | ||
| 1035 | +Written by John R. Hauser. More information is available through the Web | ||
| 1036 | +page `http://HTTP.CS.Berkeley.EDU/~jhauser/arithmetic/TestFloat.html'. | ||
| 1037 | + | ||
| 1038 | +THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort | ||
| 1039 | +has been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT | ||
| 1040 | +TIMES RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO | ||
| 1041 | +PERSONS AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ANY | ||
| 1042 | +AND ALL LOSSES, COSTS, OR OTHER PROBLEMS ARISING FROM ITS USE. | ||
| 1043 | + | ||
| 1044 | +Derivative works are acceptable, even for commercial purposes, so long as | ||
| 1045 | +(1) they include prominent notice that the work is derivative, and (2) they | ||
| 1046 | +include prominent notice akin to these four paragraphs for those parts of | ||
| 1047 | +this code that are retained. | ||
| 1048 | + | ||
| 1049 | +=============================================================================== | ||
| 1050 | +*/ | ||
| 1051 | + | ||
| 1052 | +#include <fenv.h> | ||
| 1053 | +#include "milieu.h" | ||
| 1054 | +#include "systmodes.h" | ||
| 1055 | +/* | ||
| 1056 | +------------------------------------------------------------------------------- | ||
| 1057 | +Sets the system's IEC/IEEE floating-point rounding mode. Also disables all | ||
| 1058 | +system exception traps. | ||
| 1059 | +------------------------------------------------------------------------------- | ||
| 1060 | +*/ | ||
| 1061 | +int rounding; | ||
| 1062 | + | ||
| 1063 | +void syst_float_set_rounding_mode( int8 roundingMode ) | ||
| 1064 | +{ | ||
| 1065 | + (void) fesetround ( roundingMode ); | ||
| 1066 | + rounding = roundingMode; | ||
| 1067 | +} | ||
| 1068 | + | ||
| 1069 | +/* | ||
| 1070 | +------------------------------------------------------------------------------- | ||
| 1071 | +Sets the rounding precision of subsequent extended double-precision | ||
| 1072 | +operations. The `precision' argument should be one of 0, 32, 64, or 80. | ||
| 1073 | +If `precision' is 32, the rounding precision is set equivalent to single | ||
| 1074 | +precision; else if `precision' is 64, the rounding precision is set | ||
| 1075 | +equivalent to double precision; else the rounding precision is set to full | ||
| 1076 | +extended double precision. | ||
| 1077 | +------------------------------------------------------------------------------- | ||
| 1078 | +*/ | ||
| 1079 | +void syst_float_set_rounding_precision( int8 precision ) | ||
| 1080 | +{ | ||
| 1081 | + | ||
| 1082 | +} | ||
| 1083 | + | ||
| 1084 | diff --git a/testfloat/templates/Makefile b/testfloat/templates/Makefile | ||
| 1085 | index f5f3cde..18cffe0 100644 | ||
| 1086 | --- a/testfloat/templates/Makefile | ||
| 1087 | +++ b/testfloat/templates/Makefile | ||
| 1088 | @@ -1,15 +1,21 @@ | ||
| 1089 | |||
| 1090 | -PROCESSOR_H = ../../processors/!!!processor.h | ||
| 1091 | +#PROCESSOR_H = ../../processors/!!!processor.h | ||
| 1092 | +PROCESSOR_H = ../../processors/POWERPC-gcc.h | ||
| 1093 | SOFTFLOAT_VERSION = bits64 | ||
| 1094 | -TARGET = !!!target | ||
| 1095 | -SOFTFLOAT_DIR = ../../softfloat/$(SOFTFLOAT_VERSION)/$(TARGET) | ||
| 1096 | + | ||
| 1097 | +#TARGET = !!!target | ||
| 1098 | +TARGET = powerpc-GCC | ||
| 1099 | +SOFTFLOAT_DIR = ../../../SoftFloat-2b/softfloat/$(SOFTFLOAT_VERSION)/$(TARGET) | ||
| 1100 | |||
| 1101 | OBJ = .o | ||
| 1102 | EXE = | ||
| 1103 | INCLUDES = -I. -I.. -I$(SOFTFLOAT_DIR) | ||
| 1104 | -COMPILE_C = gcc -c -o $@ $(INCLUDES) -I- -O2 | ||
| 1105 | -COMPILE_SLOWFLOAT_C = gcc -c -o $@ $(INCLUDES) -I- -O3 | ||
| 1106 | -LINK = gcc -o $@ | ||
| 1107 | +#COMPILE_C = gcc -c -o $@ $(INCLUDES) -I- -O2 | ||
| 1108 | +#COMPILE_SLOWFLOAT_C = gcc -c -o $@ $(INCLUDES) -I- -O3 | ||
| 1109 | +#LINK = gcc -o $@ | ||
| 1110 | +COMPILE_C = /opt/mtwk/usr/local/gcc-3_4-e500-glibc-2.3.4-dp/powerpc-linux-gnuspe/bin/powerpc-linux-gnuspe-gcc -c -o $@ $(INCLUDES) -I- -O2 | ||
| 1111 | +COMPILE_SLOWFLOAT_C = /opt/mtwk/usr/local/gcc-3_4-e500-glibc-2.3.4-dp/powerpc-linux-gnuspe/bin/powerpc-linux-gnuspe-gcc -c -o $@ $(INCLUDES) -I- -O3 | ||
| 1112 | +LINK = /opt/mtwk/usr/local/gcc-3_4-e500-glibc-2.3.4-dp/powerpc-linux-gnuspe/bin/powerpc-linux-gnuspe-gcc -o $@ | ||
| 1113 | |||
| 1114 | SOFTFLOAT_H = $(SOFTFLOAT_DIR)/softfloat.h | ||
| 1115 | SOFTFLOAT_OBJ = $(SOFTFLOAT_DIR)/softfloat$(OBJ) | ||
| 1116 | diff --git a/testfloat/templates/milieu.h b/testfloat/templates/milieu.h | ||
| 1117 | index 56d3ac4..3214ca8 100644 | ||
| 1118 | --- a/testfloat/templates/milieu.h | ||
| 1119 | +++ b/testfloat/templates/milieu.h | ||
| 1120 | @@ -28,7 +28,7 @@ this code that are retained. | ||
| 1121 | Include common integer types and flags. | ||
| 1122 | ------------------------------------------------------------------------------- | ||
| 1123 | */ | ||
| 1124 | -#include "../../processors/!!!processor.h" | ||
| 1125 | +#include "../../processors/SPARC-gcc.h" | ||
| 1126 | |||
| 1127 | /* | ||
| 1128 | ------------------------------------------------------------------------------- | ||
| 1129 | diff --git a/testfloat/testFunction.h b/testfloat/testFunction.h | ||
| 1130 | index 04bf856..00139a7 100644 | ||
| 1131 | --- a/testfloat/testFunction.h | ||
| 1132 | +++ b/testfloat/testFunction.h | ||
| 1133 | @@ -126,8 +126,8 @@ extern const flag functionExists[ NUM_FUNCTIONS ]; | ||
| 1134 | enum { | ||
| 1135 | ROUND_NEAREST_EVEN = 1, | ||
| 1136 | ROUND_TO_ZERO, | ||
| 1137 | - ROUND_DOWN, | ||
| 1138 | ROUND_UP, | ||
| 1139 | + ROUND_DOWN, | ||
| 1140 | NUM_ROUNDINGMODES | ||
| 1141 | }; | ||
| 1142 | |||
| 1143 | diff --git a/testfloat/testLoops.c b/testfloat/testLoops.c | ||
| 1144 | index 8ba92f3..ba05548 100644 | ||
| 1145 | --- a/testfloat/testLoops.c | ||
| 1146 | +++ b/testfloat/testLoops.c | ||
| 1147 | @@ -488,6 +488,11 @@ void | ||
| 1148 | (void) testFlagsFunctionPtr(); | ||
| 1149 | testZ = testFunction( testCases_a_int32 ); | ||
| 1150 | testFlags = testFlagsFunctionPtr(); | ||
| 1151 | +#ifdef TEST_KERNEL_EMU | ||
| 1152 | + if (! syst_float_is_soft_emu()){ | ||
| 1153 | + continue; | ||
| 1154 | + } | ||
| 1155 | +#endif | ||
| 1156 | --count; | ||
| 1157 | if ( count == 0 ) { | ||
| 1158 | checkEarlyExit(); | ||
| 1159 | @@ -539,6 +544,11 @@ void | ||
| 1160 | (void) testFlagsFunctionPtr(); | ||
| 1161 | testZ = testFunction( testCases_a_int32 ); | ||
| 1162 | testFlags = testFlagsFunctionPtr(); | ||
| 1163 | +#ifdef TEST_KERNEL_EMU | ||
| 1164 | + if (! syst_float_is_soft_emu()){ | ||
| 1165 | + continue; | ||
| 1166 | + } | ||
| 1167 | +#endif | ||
| 1168 | --count; | ||
| 1169 | if ( count == 0 ) { | ||
| 1170 | checkEarlyExit(); | ||
| 1171 | @@ -592,6 +602,11 @@ void | ||
| 1172 | (void) testFlagsFunctionPtr(); | ||
| 1173 | testZ = testFunction( testCases_a_int32 ); | ||
| 1174 | testFlags = testFlagsFunctionPtr(); | ||
| 1175 | +#ifdef TEST_KERNEL_EMU | ||
| 1176 | + if (! syst_float_is_soft_emu()){ | ||
| 1177 | + continue; | ||
| 1178 | + } | ||
| 1179 | +#endif | ||
| 1180 | --count; | ||
| 1181 | if ( count == 0 ) { | ||
| 1182 | checkEarlyExit(); | ||
| 1183 | @@ -647,6 +662,11 @@ void | ||
| 1184 | (void) testFlagsFunctionPtr(); | ||
| 1185 | testZ = testFunction( testCases_a_int32 ); | ||
| 1186 | testFlags = testFlagsFunctionPtr(); | ||
| 1187 | +#ifdef TEST_KERNEL_EMU | ||
| 1188 | + if (! syst_float_is_soft_emu()){ | ||
| 1189 | + continue; | ||
| 1190 | + } | ||
| 1191 | +#endif | ||
| 1192 | --count; | ||
| 1193 | if ( count == 0 ) { | ||
| 1194 | checkEarlyExit(); | ||
| 1195 | @@ -702,6 +722,11 @@ void | ||
| 1196 | (void) testFlagsFunctionPtr(); | ||
| 1197 | testZ = testFunction( testCases_a_int64 ); | ||
| 1198 | testFlags = testFlagsFunctionPtr(); | ||
| 1199 | +#ifdef TEST_KERNEL_EMU | ||
| 1200 | + if (! syst_float_is_soft_emu()){ | ||
| 1201 | + continue; | ||
| 1202 | + } | ||
| 1203 | +#endif | ||
| 1204 | --count; | ||
| 1205 | if ( count == 0 ) { | ||
| 1206 | checkEarlyExit(); | ||
| 1207 | @@ -753,6 +778,11 @@ void | ||
| 1208 | (void) testFlagsFunctionPtr(); | ||
| 1209 | testZ = testFunction( testCases_a_int64 ); | ||
| 1210 | testFlags = testFlagsFunctionPtr(); | ||
| 1211 | +#ifdef TEST_KERNEL_EMU | ||
| 1212 | + if (! syst_float_is_soft_emu()){ | ||
| 1213 | + continue; | ||
| 1214 | + } | ||
| 1215 | +#endif | ||
| 1216 | --count; | ||
| 1217 | if ( count == 0 ) { | ||
| 1218 | checkEarlyExit(); | ||
| 1219 | @@ -806,6 +836,11 @@ void | ||
| 1220 | (void) testFlagsFunctionPtr(); | ||
| 1221 | testZ = testFunction( testCases_a_int64 ); | ||
| 1222 | testFlags = testFlagsFunctionPtr(); | ||
| 1223 | +#ifdef TEST_KERNEL_EMU | ||
| 1224 | + if (! syst_float_is_soft_emu()){ | ||
| 1225 | + continue; | ||
| 1226 | + } | ||
| 1227 | +#endif | ||
| 1228 | --count; | ||
| 1229 | if ( count == 0 ) { | ||
| 1230 | checkEarlyExit(); | ||
| 1231 | @@ -861,6 +896,11 @@ void | ||
| 1232 | (void) testFlagsFunctionPtr(); | ||
| 1233 | testZ = testFunction( testCases_a_int64 ); | ||
| 1234 | testFlags = testFlagsFunctionPtr(); | ||
| 1235 | +#ifdef TEST_KERNEL_EMU | ||
| 1236 | + if (! syst_float_is_soft_emu()){ | ||
| 1237 | + continue; | ||
| 1238 | + } | ||
| 1239 | +#endif | ||
| 1240 | --count; | ||
| 1241 | if ( count == 0 ) { | ||
| 1242 | checkEarlyExit(); | ||
| 1243 | @@ -916,6 +956,11 @@ void | ||
| 1244 | (void) testFlagsFunctionPtr(); | ||
| 1245 | testZ = testFunction( testCases_a_float32 ); | ||
| 1246 | testFlags = testFlagsFunctionPtr(); | ||
| 1247 | +#ifdef TEST_KERNEL_EMU | ||
| 1248 | + if (! syst_float_is_soft_emu()){ | ||
| 1249 | + continue; | ||
| 1250 | + } | ||
| 1251 | +#endif | ||
| 1252 | --count; | ||
| 1253 | if ( count == 0 ) { | ||
| 1254 | checkEarlyExit(); | ||
| 1255 | @@ -973,6 +1018,11 @@ void | ||
| 1256 | (void) testFlagsFunctionPtr(); | ||
| 1257 | testZ = testFunction( testCases_a_float32 ); | ||
| 1258 | testFlags = testFlagsFunctionPtr(); | ||
| 1259 | +#ifdef TEST_KERNEL_EMU | ||
| 1260 | + if (! syst_float_is_soft_emu()){ | ||
| 1261 | + continue; | ||
| 1262 | + } | ||
| 1263 | +#endif | ||
| 1264 | --count; | ||
| 1265 | if ( count == 0 ) { | ||
| 1266 | checkEarlyExit(); | ||
| 1267 | @@ -1030,6 +1080,11 @@ void | ||
| 1268 | (void) testFlagsFunctionPtr(); | ||
| 1269 | testZ = testFunction( testCases_a_float32 ); | ||
| 1270 | testFlags = testFlagsFunctionPtr(); | ||
| 1271 | +#ifdef TEST_KERNEL_EMU | ||
| 1272 | + if (! syst_float_is_soft_emu()){ | ||
| 1273 | + continue; | ||
| 1274 | + } | ||
| 1275 | +#endif | ||
| 1276 | --count; | ||
| 1277 | if ( count == 0 ) { | ||
| 1278 | checkEarlyExit(); | ||
| 1279 | @@ -1087,6 +1142,11 @@ void | ||
| 1280 | (void) testFlagsFunctionPtr(); | ||
| 1281 | testZ = testFunction( testCases_a_float32 ); | ||
| 1282 | testFlags = testFlagsFunctionPtr(); | ||
| 1283 | +#ifdef TEST_KERNEL_EMU | ||
| 1284 | + if (! syst_float_is_soft_emu()){ | ||
| 1285 | + continue; | ||
| 1286 | + } | ||
| 1287 | +#endif | ||
| 1288 | --count; | ||
| 1289 | if ( count == 0 ) { | ||
| 1290 | checkEarlyExit(); | ||
| 1291 | @@ -1146,6 +1206,11 @@ void | ||
| 1292 | (void) testFlagsFunctionPtr(); | ||
| 1293 | testZ = testFunction( testCases_a_float32 ); | ||
| 1294 | testFlags = testFlagsFunctionPtr(); | ||
| 1295 | +#ifdef TEST_KERNEL_EMU | ||
| 1296 | + if (! syst_float_is_soft_emu()){ | ||
| 1297 | + continue; | ||
| 1298 | + } | ||
| 1299 | +#endif | ||
| 1300 | --count; | ||
| 1301 | if ( count == 0 ) { | ||
| 1302 | checkEarlyExit(); | ||
| 1303 | @@ -1203,6 +1268,11 @@ void | ||
| 1304 | (void) testFlagsFunctionPtr(); | ||
| 1305 | testZ = testFunction( testCases_a_float32 ); | ||
| 1306 | testFlags = testFlagsFunctionPtr(); | ||
| 1307 | +#ifdef TEST_KERNEL_EMU | ||
| 1308 | + if (! syst_float_is_soft_emu()){ | ||
| 1309 | + continue; | ||
| 1310 | + } | ||
| 1311 | +#endif | ||
| 1312 | --count; | ||
| 1313 | if ( count == 0 ) { | ||
| 1314 | checkEarlyExit(); | ||
| 1315 | @@ -1260,6 +1330,11 @@ void | ||
| 1316 | (void) testFlagsFunctionPtr(); | ||
| 1317 | testZ = testFunction( testCases_a_float32, testCases_b_float32 ); | ||
| 1318 | testFlags = testFlagsFunctionPtr(); | ||
| 1319 | +#ifdef TEST_KERNEL_EMU | ||
| 1320 | + if (! syst_float_is_soft_emu()){ | ||
| 1321 | + continue; | ||
| 1322 | + } | ||
| 1323 | +#endif | ||
| 1324 | --count; | ||
| 1325 | if ( count == 0 ) { | ||
| 1326 | checkEarlyExit(); | ||
| 1327 | @@ -1312,6 +1387,25 @@ void | ||
| 1328 | (void) testFlagsFunctionPtr(); | ||
| 1329 | testZ = testFunction( testCases_a_float32, testCases_b_float32 ); | ||
| 1330 | testFlags = testFlagsFunctionPtr(); | ||
| 1331 | + | ||
| 1332 | +if(testCases_a_float32 == 0x7ffffe && testCases_b_float32 == 0x3f7ffffe) | ||
| 1333 | +{ | ||
| 1334 | + | ||
| 1335 | + writeErrorFound( 10000 - count ); | ||
| 1336 | + writeInputs_ab_float32(); | ||
| 1337 | + fputs( " ", stdout ); | ||
| 1338 | + writeOutputs_z_float32( trueZ, trueFlags, testZ, testFlags ); | ||
| 1339 | + fflush( stdout ); | ||
| 1340 | + if (! syst_float_is_soft_emu()){ | ||
| 1341 | + exit(-1); | ||
| 1342 | + } | ||
| 1343 | +} | ||
| 1344 | +#ifdef TEST_KERNEL_EMU | ||
| 1345 | + if (! syst_float_is_soft_emu()){ | ||
| 1346 | + continue; | ||
| 1347 | + } | ||
| 1348 | +#endif | ||
| 1349 | + | ||
| 1350 | --count; | ||
| 1351 | if ( count == 0 ) { | ||
| 1352 | checkEarlyExit(); | ||
| 1353 | @@ -1370,6 +1464,11 @@ void | ||
| 1354 | (void) testFlagsFunctionPtr(); | ||
| 1355 | testZ = testFunction( testCases_a_float64 ); | ||
| 1356 | testFlags = testFlagsFunctionPtr(); | ||
| 1357 | +#ifdef TEST_KERNEL_EMU | ||
| 1358 | + if (! syst_float_is_soft_emu()){ | ||
| 1359 | + continue; | ||
| 1360 | + } | ||
| 1361 | +#endif | ||
| 1362 | --count; | ||
| 1363 | if ( count == 0 ) { | ||
| 1364 | checkEarlyExit(); | ||
| 1365 | @@ -1427,6 +1526,11 @@ void | ||
| 1366 | (void) testFlagsFunctionPtr(); | ||
| 1367 | testZ = testFunction( testCases_a_float64 ); | ||
| 1368 | testFlags = testFlagsFunctionPtr(); | ||
| 1369 | +#ifdef TEST_KERNEL_EMU | ||
| 1370 | + if (! syst_float_is_soft_emu()){ | ||
| 1371 | + continue; | ||
| 1372 | + } | ||
| 1373 | +#endif | ||
| 1374 | --count; | ||
| 1375 | if ( count == 0 ) { | ||
| 1376 | checkEarlyExit(); | ||
| 1377 | @@ -1484,6 +1588,11 @@ void | ||
| 1378 | (void) testFlagsFunctionPtr(); | ||
| 1379 | testZ = testFunction( testCases_a_float64 ); | ||
| 1380 | testFlags = testFlagsFunctionPtr(); | ||
| 1381 | +#ifdef TEST_KERNEL_EMU | ||
| 1382 | + if (! syst_float_is_soft_emu()){ | ||
| 1383 | + continue; | ||
| 1384 | + } | ||
| 1385 | +#endif | ||
| 1386 | --count; | ||
| 1387 | if ( count == 0 ) { | ||
| 1388 | checkEarlyExit(); | ||
| 1389 | @@ -1541,6 +1650,11 @@ void | ||
| 1390 | (void) testFlagsFunctionPtr(); | ||
| 1391 | testZ = testFunction( testCases_a_float64 ); | ||
| 1392 | testFlags = testFlagsFunctionPtr(); | ||
| 1393 | +#ifdef TEST_KERNEL_EMU | ||
| 1394 | + if (! syst_float_is_soft_emu()){ | ||
| 1395 | + continue; | ||
| 1396 | + } | ||
| 1397 | +#endif | ||
| 1398 | --count; | ||
| 1399 | if ( count == 0 ) { | ||
| 1400 | checkEarlyExit(); | ||
| 1401 | @@ -1600,6 +1714,11 @@ void | ||
| 1402 | (void) testFlagsFunctionPtr(); | ||
| 1403 | testZ = testFunction( testCases_a_float64 ); | ||
| 1404 | testFlags = testFlagsFunctionPtr(); | ||
| 1405 | +#ifdef TEST_KERNEL_EMU | ||
| 1406 | + if (! syst_float_is_soft_emu()){ | ||
| 1407 | + continue; | ||
| 1408 | + } | ||
| 1409 | +#endif | ||
| 1410 | --count; | ||
| 1411 | if ( count == 0 ) { | ||
| 1412 | checkEarlyExit(); | ||
| 1413 | @@ -1657,6 +1776,11 @@ void | ||
| 1414 | (void) testFlagsFunctionPtr(); | ||
| 1415 | testZ = testFunction( testCases_a_float64 ); | ||
| 1416 | testFlags = testFlagsFunctionPtr(); | ||
| 1417 | +#ifdef TEST_KERNEL_EMU | ||
| 1418 | + if (! syst_float_is_soft_emu()){ | ||
| 1419 | + continue; | ||
| 1420 | + } | ||
| 1421 | +#endif | ||
| 1422 | --count; | ||
| 1423 | if ( count == 0 ) { | ||
| 1424 | checkEarlyExit(); | ||
| 1425 | @@ -1714,6 +1838,11 @@ void | ||
| 1426 | (void) testFlagsFunctionPtr(); | ||
| 1427 | testZ = testFunction( testCases_a_float64, testCases_b_float64 ); | ||
| 1428 | testFlags = testFlagsFunctionPtr(); | ||
| 1429 | +#ifdef TEST_KERNEL_EMU | ||
| 1430 | + if (! syst_float_is_soft_emu()){ | ||
| 1431 | + continue; | ||
| 1432 | + } | ||
| 1433 | +#endif | ||
| 1434 | --count; | ||
| 1435 | if ( count == 0 ) { | ||
| 1436 | checkEarlyExit(); | ||
| 1437 | @@ -1766,6 +1895,13 @@ void | ||
| 1438 | (void) testFlagsFunctionPtr(); | ||
| 1439 | testZ = testFunction( testCases_a_float64, testCases_b_float64 ); | ||
| 1440 | testFlags = testFlagsFunctionPtr(); | ||
| 1441 | + | ||
| 1442 | +#ifdef TEST_KERNEL_EMU | ||
| 1443 | + if (! syst_float_is_soft_emu()){ | ||
| 1444 | + continue; | ||
| 1445 | + } | ||
| 1446 | +#endif | ||
| 1447 | + | ||
| 1448 | --count; | ||
| 1449 | if ( count == 0 ) { | ||
| 1450 | checkEarlyExit(); | ||
| 1451 | @@ -1826,6 +1962,11 @@ void | ||
| 1452 | (void) testFlagsFunctionPtr(); | ||
| 1453 | testZ = testFunction( testCases_a_floatx80 ); | ||
| 1454 | testFlags = testFlagsFunctionPtr(); | ||
| 1455 | +#ifdef TEST_KERNEL_EMU | ||
| 1456 | + if (! syst_float_is_soft_emu()){ | ||
| 1457 | + continue; | ||
| 1458 | + } | ||
| 1459 | +#endif | ||
| 1460 | --count; | ||
| 1461 | if ( count == 0 ) { | ||
| 1462 | checkEarlyExit(); | ||
| 1463 | @@ -1883,6 +2024,11 @@ void | ||
| 1464 | (void) testFlagsFunctionPtr(); | ||
| 1465 | testZ = testFunction( testCases_a_floatx80 ); | ||
| 1466 | testFlags = testFlagsFunctionPtr(); | ||
| 1467 | +#ifdef TEST_KERNEL_EMU | ||
| 1468 | + if (! syst_float_is_soft_emu()){ | ||
| 1469 | + continue; | ||
| 1470 | + } | ||
| 1471 | +#endif | ||
| 1472 | --count; | ||
| 1473 | if ( count == 0 ) { | ||
| 1474 | checkEarlyExit(); | ||
| 1475 | @@ -1940,6 +2086,11 @@ void | ||
| 1476 | (void) testFlagsFunctionPtr(); | ||
| 1477 | testZ = testFunction( testCases_a_floatx80 ); | ||
| 1478 | testFlags = testFlagsFunctionPtr(); | ||
| 1479 | +#ifdef TEST_KERNEL_EMU | ||
| 1480 | + if (! syst_float_is_soft_emu()){ | ||
| 1481 | + continue; | ||
| 1482 | + } | ||
| 1483 | +#endif | ||
| 1484 | --count; | ||
| 1485 | if ( count == 0 ) { | ||
| 1486 | checkEarlyExit(); | ||
| 1487 | @@ -1995,6 +2146,11 @@ void | ||
| 1488 | (void) testFlagsFunctionPtr(); | ||
| 1489 | testZ = testFunction( testCases_a_floatx80 ); | ||
| 1490 | testFlags = testFlagsFunctionPtr(); | ||
| 1491 | +#ifdef TEST_KERNEL_EMU | ||
| 1492 | + if (! syst_float_is_soft_emu()){ | ||
| 1493 | + continue; | ||
| 1494 | + } | ||
| 1495 | +#endif | ||
| 1496 | --count; | ||
| 1497 | if ( count == 0 ) { | ||
| 1498 | checkEarlyExit(); | ||
| 1499 | @@ -2052,6 +2208,11 @@ void | ||
| 1500 | (void) testFlagsFunctionPtr(); | ||
| 1501 | testZ = testFunction( testCases_a_floatx80 ); | ||
| 1502 | testFlags = testFlagsFunctionPtr(); | ||
| 1503 | +#ifdef TEST_KERNEL_EMU | ||
| 1504 | + if (! syst_float_is_soft_emu()){ | ||
| 1505 | + continue; | ||
| 1506 | + } | ||
| 1507 | +#endif | ||
| 1508 | --count; | ||
| 1509 | if ( count == 0 ) { | ||
| 1510 | checkEarlyExit(); | ||
| 1511 | @@ -2109,6 +2270,11 @@ void | ||
| 1512 | (void) testFlagsFunctionPtr(); | ||
| 1513 | testZ = testFunction( testCases_a_floatx80 ); | ||
| 1514 | testFlags = testFlagsFunctionPtr(); | ||
| 1515 | +#ifdef TEST_KERNEL_EMU | ||
| 1516 | + if (! syst_float_is_soft_emu()){ | ||
| 1517 | + continue; | ||
| 1518 | + } | ||
| 1519 | +#endif | ||
| 1520 | --count; | ||
| 1521 | if ( count == 0 ) { | ||
| 1522 | checkEarlyExit(); | ||
| 1523 | @@ -2166,6 +2332,11 @@ void | ||
| 1524 | (void) testFlagsFunctionPtr(); | ||
| 1525 | testZ = testFunction( testCases_a_floatx80, testCases_b_floatx80 ); | ||
| 1526 | testFlags = testFlagsFunctionPtr(); | ||
| 1527 | +#ifdef TEST_KERNEL_EMU | ||
| 1528 | + if (! syst_float_is_soft_emu()){ | ||
| 1529 | + continue; | ||
| 1530 | + } | ||
| 1531 | +#endif | ||
| 1532 | --count; | ||
| 1533 | if ( count == 0 ) { | ||
| 1534 | checkEarlyExit(); | ||
| 1535 | @@ -2218,6 +2389,11 @@ void | ||
| 1536 | (void) testFlagsFunctionPtr(); | ||
| 1537 | testZ = testFunction( testCases_a_floatx80, testCases_b_floatx80 ); | ||
| 1538 | testFlags = testFlagsFunctionPtr(); | ||
| 1539 | +#ifdef TEST_KERNEL_EMU | ||
| 1540 | + if (! syst_float_is_soft_emu()){ | ||
| 1541 | + continue; | ||
| 1542 | + } | ||
| 1543 | +#endif | ||
| 1544 | --count; | ||
| 1545 | if ( count == 0 ) { | ||
| 1546 | checkEarlyExit(); | ||
| 1547 | @@ -2280,6 +2456,11 @@ void | ||
| 1548 | (void) testFlagsFunctionPtr(); | ||
| 1549 | testZ = testFunction( testCases_a_float128 ); | ||
| 1550 | testFlags = testFlagsFunctionPtr(); | ||
| 1551 | +#ifdef TEST_KERNEL_EMU | ||
| 1552 | + if (! syst_float_is_soft_emu()){ | ||
| 1553 | + continue; | ||
| 1554 | + } | ||
| 1555 | +#endif | ||
| 1556 | --count; | ||
| 1557 | if ( count == 0 ) { | ||
| 1558 | checkEarlyExit(); | ||
| 1559 | @@ -2337,6 +2518,11 @@ void | ||
| 1560 | (void) testFlagsFunctionPtr(); | ||
| 1561 | testZ = testFunction( testCases_a_float128 ); | ||
| 1562 | testFlags = testFlagsFunctionPtr(); | ||
| 1563 | +#ifdef TEST_KERNEL_EMU | ||
| 1564 | + if (! syst_float_is_soft_emu()){ | ||
| 1565 | + continue; | ||
| 1566 | + } | ||
| 1567 | +#endif | ||
| 1568 | --count; | ||
| 1569 | if ( count == 0 ) { | ||
| 1570 | checkEarlyExit(); | ||
| 1571 | @@ -2394,6 +2580,11 @@ void | ||
| 1572 | (void) testFlagsFunctionPtr(); | ||
| 1573 | testZ = testFunction( testCases_a_float128 ); | ||
| 1574 | testFlags = testFlagsFunctionPtr(); | ||
| 1575 | +#ifdef TEST_KERNEL_EMU | ||
| 1576 | + if (! syst_float_is_soft_emu()){ | ||
| 1577 | + continue; | ||
| 1578 | + } | ||
| 1579 | +#endif | ||
| 1580 | --count; | ||
| 1581 | if ( count == 0 ) { | ||
| 1582 | checkEarlyExit(); | ||
| 1583 | @@ -2449,6 +2640,11 @@ void | ||
| 1584 | (void) testFlagsFunctionPtr(); | ||
| 1585 | testZ = testFunction( testCases_a_float128 ); | ||
| 1586 | testFlags = testFlagsFunctionPtr(); | ||
| 1587 | +#ifdef TEST_KERNEL_EMU | ||
| 1588 | + if (! syst_float_is_soft_emu()){ | ||
| 1589 | + continue; | ||
| 1590 | + } | ||
| 1591 | +#endif | ||
| 1592 | --count; | ||
| 1593 | if ( count == 0 ) { | ||
| 1594 | checkEarlyExit(); | ||
| 1595 | @@ -2506,6 +2702,11 @@ void | ||
| 1596 | (void) testFlagsFunctionPtr(); | ||
| 1597 | testZ = testFunction( testCases_a_float128 ); | ||
| 1598 | testFlags = testFlagsFunctionPtr(); | ||
| 1599 | +#ifdef TEST_KERNEL_EMU | ||
| 1600 | + if (! syst_float_is_soft_emu()){ | ||
| 1601 | + continue; | ||
| 1602 | + } | ||
| 1603 | +#endif | ||
| 1604 | --count; | ||
| 1605 | if ( count == 0 ) { | ||
| 1606 | checkEarlyExit(); | ||
| 1607 | @@ -2563,6 +2764,11 @@ void | ||
| 1608 | (void) testFlagsFunctionPtr(); | ||
| 1609 | testZ = testFunction( testCases_a_float128 ); | ||
| 1610 | testFlags = testFlagsFunctionPtr(); | ||
| 1611 | +#ifdef TEST_KERNEL_EMU | ||
| 1612 | + if (! syst_float_is_soft_emu()){ | ||
| 1613 | + continue; | ||
| 1614 | + } | ||
| 1615 | +#endif | ||
| 1616 | --count; | ||
| 1617 | if ( count == 0 ) { | ||
| 1618 | checkEarlyExit(); | ||
| 1619 | @@ -2620,6 +2826,11 @@ void | ||
| 1620 | (void) testFlagsFunctionPtr(); | ||
| 1621 | testZ = testFunction( testCases_a_float128, testCases_b_float128 ); | ||
| 1622 | testFlags = testFlagsFunctionPtr(); | ||
| 1623 | +#ifdef TEST_KERNEL_EMU | ||
| 1624 | + if (! syst_float_is_soft_emu()){ | ||
| 1625 | + continue; | ||
| 1626 | + } | ||
| 1627 | +#endif | ||
| 1628 | --count; | ||
| 1629 | if ( count == 0 ) { | ||
| 1630 | checkEarlyExit(); | ||
| 1631 | @@ -2672,6 +2883,11 @@ void | ||
| 1632 | (void) testFlagsFunctionPtr(); | ||
| 1633 | testZ = testFunction( testCases_a_float128, testCases_b_float128 ); | ||
| 1634 | testFlags = testFlagsFunctionPtr(); | ||
| 1635 | +#ifdef TEST_KERNEL_EMU | ||
| 1636 | + if (! syst_float_is_soft_emu()){ | ||
| 1637 | + continue; | ||
| 1638 | + } | ||
| 1639 | +#endif | ||
| 1640 | --count; | ||
| 1641 | if ( count == 0 ) { | ||
| 1642 | checkEarlyExit(); | ||
| 1643 | -- | ||
| 1644 | 1.5.4 | ||
| 1645 | |||
diff --git a/recipes-extended/testfloat/files/Yocto-replace-COMPILE_PREFIX-gcc.patch b/recipes-extended/testfloat/files/Yocto-replace-COMPILE_PREFIX-gcc.patch deleted file mode 100644 index c6cfaf417..000000000 --- a/recipes-extended/testfloat/files/Yocto-replace-COMPILE_PREFIX-gcc.patch +++ /dev/null | |||
| @@ -1,68 +0,0 @@ | |||
| 1 | From 6c7567e05c28b8cb6c7dc68c278950a32feb6f64 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Ting Liu <b28495@freescale.com> | ||
| 3 | Date: Wed, 9 May 2012 02:42:57 -0500 | ||
| 4 | Subject: [PATCH] Yocto: replace $(COMPILE_PREFIX)gcc with $(CC) and remove -te500v2 flags | ||
| 5 | |||
| 6 | Upstream-Status: Pending | ||
| 7 | Signed-off-by: Ting Liu <b28495@freescale.com> | ||
| 8 | --- | ||
| 9 | SoftFloat-2b/softfloat/bits32/powerpc-GCC/Makefile | 4 ++-- | ||
| 10 | SoftFloat-2b/softfloat/bits64/powerpc-GCC/Makefile | 4 ++-- | ||
| 11 | testfloat/powerpc-linux-gcc/Makefile | 8 ++++---- | ||
| 12 | 3 files changed, 8 insertions(+), 8 deletions(-) | ||
| 13 | |||
| 14 | diff --git a/SoftFloat-2b/softfloat/bits32/powerpc-GCC/Makefile b/SoftFloat-2b/softfloat/bits32/powerpc-GCC/Makefile | ||
| 15 | index 28f1e33..4098048 100644 | ||
| 16 | --- a/SoftFloat-2b/softfloat/bits32/powerpc-GCC/Makefile | ||
| 17 | +++ b/SoftFloat-2b/softfloat/bits32/powerpc-GCC/Makefile | ||
| 18 | @@ -5,8 +5,8 @@ SOFTFLOAT_MACROS = ../softfloat-macros | ||
| 19 | OBJ = .o | ||
| 20 | EXE = | ||
| 21 | INCLUDES = -I. -I.. | ||
| 22 | -COMPILE_C = $(COMPILE_PREFIX)gcc -msoft-float -c -o $@ $(INCLUDES) -I- -O2 | ||
| 23 | -LINK = $(COMPILE_PREFIX)gcc -o $@ | ||
| 24 | +COMPILE_C = $(CC) -msoft-float -c -o $@ $(INCLUDES) -I- -O2 | ||
| 25 | +LINK = $(CC) -o $@ | ||
| 26 | |||
| 27 | ALL: softfloat$(OBJ) timesoftfloat$(EXE) | ||
| 28 | |||
| 29 | diff --git a/SoftFloat-2b/softfloat/bits64/powerpc-GCC/Makefile b/SoftFloat-2b/softfloat/bits64/powerpc-GCC/Makefile | ||
| 30 | index a5e2cc7..c34e16e 100644 | ||
| 31 | --- a/SoftFloat-2b/softfloat/bits64/powerpc-GCC/Makefile | ||
| 32 | +++ b/SoftFloat-2b/softfloat/bits64/powerpc-GCC/Makefile | ||
| 33 | @@ -5,8 +5,8 @@ SOFTFLOAT_MACROS = ../softfloat-macros | ||
| 34 | OBJ = .o | ||
| 35 | EXE = | ||
| 36 | INCLUDES = -I. -I.. | ||
| 37 | -COMPILE_C = $(COMPILE_PREFIX) -mcpu=8548 -mhard-float -mfloat-gprs=double -o $@ $(INCLUDES) -I- -O2 | ||
| 38 | -LINK = $(COMPILE_PREFIX) -o $@ | ||
| 39 | +COMPILE_C = $(CC) -mcpu=8548 -mhard-float -mfloat-gprs=double -o $@ $(INCLUDES) -I- -O2 | ||
| 40 | +LINK = $(CC) -o $@ | ||
| 41 | |||
| 42 | ALL: softfloat$(OBJ) timesoftfloat$(EXE) | ||
| 43 | |||
| 44 | diff --git a/testfloat/powerpc-linux-gcc/Makefile b/testfloat/powerpc-linux-gcc/Makefile | ||
| 45 | index de50aad..1a8b5f7 100644 | ||
| 46 | --- a/testfloat/powerpc-linux-gcc/Makefile | ||
| 47 | +++ b/testfloat/powerpc-linux-gcc/Makefile | ||
| 48 | @@ -8,13 +8,13 @@ OBJ = .o | ||
| 49 | EXE = | ||
| 50 | INCLUDES = -I. -I.. -I$(SOFTFLOAT_DIR) | ||
| 51 | |||
| 52 | -COMPILE_C = $(COMPILE_PREFIX)gcc -c -o $@ $(INCLUDES) -I- -O $(EXTRA_CFLAGS) | ||
| 53 | +COMPILE_C = $(CC) -c -o $@ $(INCLUDES) -I- -O $(EXTRA_CFLAGS) | ||
| 54 | |||
| 55 | -COMPILE_C_HARD = $(COMPILE_PREFIX)gcc -c -te500v2 -o $@ $(INCLUDES) | ||
| 56 | +COMPILE_C_HARD = $(CC) -c -o $@ $(INCLUDES) | ||
| 57 | |||
| 58 | -COMPILE_SLOWFLOAT_C = $(COMPILE_PREFIX)gcc -c -o $@ $(INCLUDES) -I- -O | ||
| 59 | +COMPILE_SLOWFLOAT_C = $(CC) -c -o $@ $(INCLUDES) -I- -O | ||
| 60 | |||
| 61 | -LINK = $(COMPILE_PREFIX)gcc -lm -o $@ | ||
| 62 | +LINK = $(CC) -lm -o $@ ${LDFLAGS} | ||
| 63 | |||
| 64 | SOFTFLOAT_H = $(SOFTFLOAT_DIR)/softfloat.h | ||
| 65 | SOFTFLOAT_OBJ = $(SOFTFLOAT_DIR)/softfloat$(OBJ) | ||
| 66 | -- | ||
| 67 | 1.7.3.4 | ||
| 68 | |||
diff --git a/recipes-extended/testfloat/testfloat_2a.bb b/recipes-extended/testfloat/testfloat_2a.bb deleted file mode 100644 index d0bd4d8f1..000000000 --- a/recipes-extended/testfloat/testfloat_2a.bb +++ /dev/null | |||
| @@ -1,48 +0,0 @@ | |||
| 1 | SUMMARY = "Floating-point implementation test suite" | ||
| 2 | DESCRIPTION = "A program for testing floating-point implementation" | ||
| 3 | HOMEPAGE = "http://www.jhauser.us/arithmetic/TestFloat.html" | ||
| 4 | SECTION = "devel" | ||
| 5 | LICENSE = "TestFloat" | ||
| 6 | |||
| 7 | LIC_FILES_CHKSUM = "file://testfloat/testfloat.txt;beginline=87;endline=95;md5=bdb2e8111838a48015c29bd97f5b6145" | ||
| 8 | |||
| 9 | SRC_URI = "http://www.jhauser.us/arithmetic/TestFloat-2a.tar.Z;name=TestFloat \ | ||
| 10 | http://www.jhauser.us/arithmetic/SoftFloat-2b.tar.Z;name=SoftFloat \ | ||
| 11 | " | ||
| 12 | SRC_URI:append:qoriq-ppc = " \ | ||
| 13 | file://SoftFloat-powerpc-1.patch \ | ||
| 14 | file://TestFloat-powerpc-E500v2-SPE-1.patch \ | ||
| 15 | file://Yocto-replace-COMPILE_PREFIX-gcc.patch \ | ||
| 16 | " | ||
| 17 | SRC_URI[TestFloat.sha256sum] = "84d14aa42adefbda2ec9708b42946f7fa59f93689b042684bd027863481f8e4e" | ||
| 18 | SRC_URI[SoftFloat.sha256sum] = "89d14b55113a2ba8cbda7011443ba1d298d381c89d939515d56c5f18f2febf81" | ||
| 19 | |||
| 20 | S = "${UNPACKDIR}/TestFloat-2a" | ||
| 21 | |||
| 22 | do_unpack2(){ | ||
| 23 | mv ${UNPACKDIR}/SoftFloat-2b ${S}/SoftFloat-2b | ||
| 24 | cd ${S} | ||
| 25 | if [ -n "$(which fromdos)" ];then | ||
| 26 | find -type f -exec fromdos {} \; | ||
| 27 | elif [ -n "$(which dos2unix)" ];then | ||
| 28 | find -type f -exec dos2unix {} \; | ||
| 29 | else | ||
| 30 | echo -e "\nERROR: command dos2unix or fromdos not found\n" && return 1 | ||
| 31 | fi | ||
| 32 | } | ||
| 33 | do_unpack2[doc] = "Move the SoftFloat sources into ${S} and convert the shipped DOS line endings" | ||
| 34 | addtask do_unpack2 after do_unpack before do_patch | ||
| 35 | |||
| 36 | do_compile(){ | ||
| 37 | oe_runmake -C testfloat/powerpc-linux-gcc/ CC="${CC}" EXTRA_CFLAGS="-DTEST_KERNEL_EMU" | ||
| 38 | } | ||
| 39 | |||
| 40 | do_install(){ | ||
| 41 | install -d ${D}/${bindir} | ||
| 42 | install testfloat/powerpc-linux-gcc/testfloat ${D}/${bindir} | ||
| 43 | install testfloat/powerpc-linux-gcc/testsoftfloat ${D}/${bindir} | ||
| 44 | } | ||
| 45 | |||
| 46 | COMPATIBLE_HOST:e500v2 = ".*" | ||
| 47 | COMPATIBLE_HOST ?= "(none)" | ||
| 48 | |||
