Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/rth/tags/pull-fpu-20200519' int…
Browse files Browse the repository at this point in the history
…o staging

Misc cleanups

# gpg: Signature made Tue 19 May 2020 16:51:38 BST
# gpg:                using RSA key 7A481E78868B4DB6A85A05C064DF38E8AF7E215F
# gpg:                issuer "richard.henderson@linaro.org"
# gpg: Good signature from "Richard Henderson <richard.henderson@linaro.org>" [full]
# Primary key fingerprint: 7A48 1E78 868B 4DB6 A85A  05C0 64DF 38E8 AF7E 215F

* remotes/rth/tags/pull-fpu-20200519:
  softfloat: Return bool from all classification predicates
  softfloat: Inline floatx80 compare specializations
  softfloat: Inline float128 compare specializations
  softfloat: Inline float64 compare specializations
  softfloat: Inline float32 compare specializations
  softfloat: Name compare relation enum
  softfloat: Name rounding mode enum
  softfloat: Change tininess_before_rounding to bool
  softfloat: Replace flag with bool
  softfloat: Use post test for floatN_mul

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
  • Loading branch information
pm215 committed May 19, 2020
2 parents f246543 + 150c7a9 commit 956ae3e
Show file tree
Hide file tree
Showing 22 changed files with 636 additions and 1,484 deletions.
32 changes: 16 additions & 16 deletions fpu/softfloat-specialize.inc.c
Expand Up @@ -93,7 +93,7 @@ this code that are retained.
* 2008 revision and backward compatibility with their original choice.
* Thus for MIPS we must make the choice at runtime.
*/
static inline flag snan_bit_is_one(float_status *status)
static inline bool snan_bit_is_one(float_status *status)
{
#if defined(TARGET_MIPS)
return status->snan_bit_is_one;
Expand All @@ -114,7 +114,7 @@ static bool parts_is_snan_frac(uint64_t frac, float_status *status)
#ifdef NO_SIGNALING_NANS
return false;
#else
flag msb = extract64(frac, DECOMPOSED_BINARY_POINT - 1, 1);
bool msb = extract64(frac, DECOMPOSED_BINARY_POINT - 1, 1);
return msb == snan_bit_is_one(status);
#endif
}
Expand Down Expand Up @@ -236,7 +236,7 @@ void float_raise(uint8_t flags, float_status *status)
| Internal canonical NaN format.
*----------------------------------------------------------------------------*/
typedef struct {
flag sign;
bool sign;
uint64_t high, low;
} commonNaNT;

Expand All @@ -245,7 +245,7 @@ typedef struct {
| NaN; otherwise returns 0.
*----------------------------------------------------------------------------*/

int float16_is_quiet_nan(float16 a_, float_status *status)
bool float16_is_quiet_nan(float16 a_, float_status *status)
{
#ifdef NO_SIGNALING_NANS
return float16_is_any_nan(a_);
Expand All @@ -264,7 +264,7 @@ int float16_is_quiet_nan(float16 a_, float_status *status)
| NaN; otherwise returns 0.
*----------------------------------------------------------------------------*/

int float16_is_signaling_nan(float16 a_, float_status *status)
bool float16_is_signaling_nan(float16 a_, float_status *status)
{
#ifdef NO_SIGNALING_NANS
return 0;
Expand All @@ -283,7 +283,7 @@ int float16_is_signaling_nan(float16 a_, float_status *status)
| NaN; otherwise returns 0.
*----------------------------------------------------------------------------*/

int float32_is_quiet_nan(float32 a_, float_status *status)
bool float32_is_quiet_nan(float32 a_, float_status *status)
{
#ifdef NO_SIGNALING_NANS
return float32_is_any_nan(a_);
Expand All @@ -302,7 +302,7 @@ int float32_is_quiet_nan(float32 a_, float_status *status)
| NaN; otherwise returns 0.
*----------------------------------------------------------------------------*/

int float32_is_signaling_nan(float32 a_, float_status *status)
bool float32_is_signaling_nan(float32 a_, float_status *status)
{
#ifdef NO_SIGNALING_NANS
return 0;
Expand Down Expand Up @@ -374,7 +374,7 @@ static float32 commonNaNToFloat32(commonNaNT a, float_status *status)
*----------------------------------------------------------------------------*/

static int pickNaN(FloatClass a_cls, FloatClass b_cls,
flag aIsLargerSignificand)
bool aIsLargerSignificand)
{
#if defined(TARGET_ARM) || defined(TARGET_MIPS) || defined(TARGET_HPPA)
/* ARM mandated NaN propagation rules (see FPProcessNaNs()), take
Expand Down Expand Up @@ -584,7 +584,7 @@ static int pickNaNMulAdd(FloatClass a_cls, FloatClass b_cls, FloatClass c_cls,

static float32 propagateFloat32NaN(float32 a, float32 b, float_status *status)
{
flag aIsLargerSignificand;
bool aIsLargerSignificand;
uint32_t av, bv;
FloatClass a_cls, b_cls;

Expand Down Expand Up @@ -637,7 +637,7 @@ static float32 propagateFloat32NaN(float32 a, float32 b, float_status *status)
| NaN; otherwise returns 0.
*----------------------------------------------------------------------------*/

int float64_is_quiet_nan(float64 a_, float_status *status)
bool float64_is_quiet_nan(float64 a_, float_status *status)
{
#ifdef NO_SIGNALING_NANS
return float64_is_any_nan(a_);
Expand All @@ -657,7 +657,7 @@ int float64_is_quiet_nan(float64 a_, float_status *status)
| NaN; otherwise returns 0.
*----------------------------------------------------------------------------*/

int float64_is_signaling_nan(float64 a_, float_status *status)
bool float64_is_signaling_nan(float64 a_, float_status *status)
{
#ifdef NO_SIGNALING_NANS
return 0;
Expand Down Expand Up @@ -722,7 +722,7 @@ static float64 commonNaNToFloat64(commonNaNT a, float_status *status)

static float64 propagateFloat64NaN(float64 a, float64 b, float_status *status)
{
flag aIsLargerSignificand;
bool aIsLargerSignificand;
uint64_t av, bv;
FloatClass a_cls, b_cls;

Expand Down Expand Up @@ -890,7 +890,7 @@ static floatx80 commonNaNToFloatx80(commonNaNT a, float_status *status)

floatx80 propagateFloatx80NaN(floatx80 a, floatx80 b, float_status *status)
{
flag aIsLargerSignificand;
bool aIsLargerSignificand;
FloatClass a_cls, b_cls;

/* This is not complete, but is good enough for pickNaN. */
Expand Down Expand Up @@ -939,7 +939,7 @@ floatx80 propagateFloatx80NaN(floatx80 a, floatx80 b, float_status *status)
| NaN; otherwise returns 0.
*----------------------------------------------------------------------------*/

int float128_is_quiet_nan(float128 a, float_status *status)
bool float128_is_quiet_nan(float128 a, float_status *status)
{
#ifdef NO_SIGNALING_NANS
return float128_is_any_nan(a);
Expand All @@ -959,7 +959,7 @@ int float128_is_quiet_nan(float128 a, float_status *status)
| signaling NaN; otherwise returns 0.
*----------------------------------------------------------------------------*/

int float128_is_signaling_nan(float128 a, float_status *status)
bool float128_is_signaling_nan(float128 a, float_status *status)
{
#ifdef NO_SIGNALING_NANS
return 0;
Expand Down Expand Up @@ -1038,7 +1038,7 @@ static float128 commonNaNToFloat128(commonNaNT a, float_status *status)
static float128 propagateFloat128NaN(float128 a, float128 b,
float_status *status)
{
flag aIsLargerSignificand;
bool aIsLargerSignificand;
FloatClass a_cls, b_cls;

/* This is not complete, but is good enough for pickNaN. */
Expand Down

0 comments on commit 956ae3e

Please sign in to comment.