SoftFloat: Move the const's to a .c file and make the .h only contain extern's.
This commit is contained in:
@@ -13,7 +13,7 @@
|
|||||||
# Copyright 2020-2021 David Hrdlička.
|
# Copyright 2020-2021 David Hrdlička.
|
||||||
#
|
#
|
||||||
|
|
||||||
add_library(softfloat3e OBJECT extF80_addsub.cc extF80_class.cc extF80_compare.cc
|
add_library(softfloat3e OBJECT softfloat-specialize.c extF80_addsub.cc extF80_class.cc extF80_compare.cc
|
||||||
extF80_div.cc extF80_extract.cc extF80_mul.cc extF80_rem.cc extF80_roundToInt.cc
|
extF80_div.cc extF80_extract.cc extF80_mul.cc extF80_rem.cc extF80_roundToInt.cc
|
||||||
extF80_scale.cc extF80_sqrt.cc extF80_to_f16.cc extF80_to_f32.cc extF80_to_f64.cc
|
extF80_scale.cc extF80_sqrt.cc extF80_to_f16.cc extF80_to_f32.cc extF80_to_f64.cc
|
||||||
extF80_to_f128.cc extF80_to_i32.cc extF80_to_i32_r_minMag.cc extF80_to_i64.cc
|
extF80_to_f128.cc extF80_to_i32.cc extF80_to_i32_r_minMag.cc extF80_to_i64.cc
|
||||||
|
@@ -39,26 +39,26 @@ these four paragraphs for those parts of this code that are retained.
|
|||||||
* Stanislav Shwartsman [sshwarts at sourceforge net]
|
* Stanislav Shwartsman [sshwarts at sourceforge net]
|
||||||
* ==========================================================================*/
|
* ==========================================================================*/
|
||||||
|
|
||||||
const int16_t int16_indefinite = (int16_t) 0x8000;
|
extern const int16_t int16_indefinite;
|
||||||
const int32_t int32_indefinite = (int32_t) 0x80000000;
|
extern const int32_t int32_indefinite;
|
||||||
const int64_t int64_indefinite = (int64_t) BX_CONST64(0x8000000000000000);
|
extern const int64_t int64_indefinite;
|
||||||
|
|
||||||
const uint16_t uint16_indefinite = 0xffff;
|
extern const uint16_t uint16_indefinite;
|
||||||
const uint32_t uint32_indefinite = 0xffffffff;
|
extern const uint32_t uint32_indefinite;
|
||||||
const uint64_t uint64_indefinite = BX_CONST64(0xffffffffffffffff);
|
extern const uint64_t uint64_indefinite;
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------
|
/*----------------------------------------------------------------------------
|
||||||
| Commonly used half-precision floating point constants
|
| Commonly used half-precision floating point constants
|
||||||
*----------------------------------------------------------------------------*/
|
*----------------------------------------------------------------------------*/
|
||||||
const float16 float16_negative_inf = 0xfc00;
|
extern const float16 float16_negative_inf;
|
||||||
const float16 float16_positive_inf = 0x7c00;
|
extern const float16 float16_positive_inf;
|
||||||
const float16 float16_negative_zero = 0x8000;
|
extern const float16 float16_negative_zero;
|
||||||
const float16 float16_positive_zero = 0x0000;
|
extern const float16 float16_positive_zero;
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------
|
/*----------------------------------------------------------------------------
|
||||||
| The pattern for a default generated half-precision NaN.
|
| The pattern for a default generated half-precision NaN.
|
||||||
*----------------------------------------------------------------------------*/
|
*----------------------------------------------------------------------------*/
|
||||||
const float16 float16_default_nan = 0xFE00;
|
extern const float16 float16_default_nan;
|
||||||
|
|
||||||
#define FLOAT16_EXP_BIAS 0xF
|
#define FLOAT16_EXP_BIAS 0xF
|
||||||
|
|
||||||
@@ -81,19 +81,19 @@ static __inline float16 packFloat16(int zSign, int zExp, uint16_t zSig)
|
|||||||
/*----------------------------------------------------------------------------
|
/*----------------------------------------------------------------------------
|
||||||
| Commonly used single-precision floating point constants
|
| Commonly used single-precision floating point constants
|
||||||
*----------------------------------------------------------------------------*/
|
*----------------------------------------------------------------------------*/
|
||||||
const float32 float32_negative_inf = 0xff800000;
|
extern const float32 float32_negative_inf;
|
||||||
const float32 float32_positive_inf = 0x7f800000;
|
extern const float32 float32_positive_inf;
|
||||||
const float32 float32_negative_zero = 0x80000000;
|
extern const float32 float32_negative_zero;
|
||||||
const float32 float32_positive_zero = 0x00000000;
|
extern const float32 float32_positive_zero;
|
||||||
const float32 float32_negative_one = 0xbf800000;
|
extern const float32 float32_negative_one;
|
||||||
const float32 float32_positive_one = 0x3f800000;
|
extern const float32 float32_positive_one;
|
||||||
const float32 float32_max_float = 0x7f7fffff;
|
extern const float32 float32_max_float;
|
||||||
const float32 float32_min_float = 0xff7fffff;
|
extern const float32 float32_min_float;
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------
|
/*----------------------------------------------------------------------------
|
||||||
| The pattern for a default generated single-precision NaN.
|
| The pattern for a default generated single-precision NaN.
|
||||||
*----------------------------------------------------------------------------*/
|
*----------------------------------------------------------------------------*/
|
||||||
const float32 float32_default_nan = 0xffc00000;
|
extern const float32 float32_default_nan;
|
||||||
|
|
||||||
#define FLOAT32_EXP_BIAS 0x7F
|
#define FLOAT32_EXP_BIAS 0x7F
|
||||||
|
|
||||||
@@ -116,19 +116,19 @@ static __inline float32 packFloat32(int zSign, int16_t zExp, uint32_t zSig)
|
|||||||
/*----------------------------------------------------------------------------
|
/*----------------------------------------------------------------------------
|
||||||
| Commonly used single-precision floating point constants
|
| Commonly used single-precision floating point constants
|
||||||
*----------------------------------------------------------------------------*/
|
*----------------------------------------------------------------------------*/
|
||||||
const float64 float64_negative_inf = BX_CONST64(0xfff0000000000000);
|
extern const float64 float64_negative_inf;
|
||||||
const float64 float64_positive_inf = BX_CONST64(0x7ff0000000000000);
|
extern const float64 float64_positive_inf;
|
||||||
const float64 float64_negative_zero = BX_CONST64(0x8000000000000000);
|
extern const float64 float64_negative_zero;
|
||||||
const float64 float64_positive_zero = BX_CONST64(0x0000000000000000);
|
extern const float64 float64_positive_zero;
|
||||||
const float64 float64_negative_one = BX_CONST64(0xbff0000000000000);
|
extern const float64 float64_negative_one;
|
||||||
const float64 float64_positive_one = BX_CONST64(0x3ff0000000000000);
|
extern const float64 float64_positive_one;
|
||||||
const float64 float64_max_float = BX_CONST64(0x7fefffffffffffff);
|
extern const float64 float64_max_float;
|
||||||
const float64 float64_min_float = BX_CONST64(0xffefffffffffffff);
|
extern const float64 float64_min_float;
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------
|
/*----------------------------------------------------------------------------
|
||||||
| The pattern for a default generated double-precision NaN.
|
| The pattern for a default generated double-precision NaN.
|
||||||
*----------------------------------------------------------------------------*/
|
*----------------------------------------------------------------------------*/
|
||||||
const float64 float64_default_nan = BX_CONST64(0xFFF8000000000000);
|
extern const float64 float64_default_nan;
|
||||||
|
|
||||||
#define FLOAT64_EXP_BIAS 0x3FF
|
#define FLOAT64_EXP_BIAS 0x3FF
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user