On 5/15/20 9:01 PM, Richard Henderson wrote:
We have had this on the to-do list for quite some time.

Signed-off-by: Richard Henderson <richard.hender...@linaro.org>
---
  include/fpu/softfloat-helpers.h |  14 +--
  include/fpu/softfloat-macros.h  |  24 ++--
  include/fpu/softfloat-types.h   |  14 +--
  include/fpu/softfloat.h         |  10 +-
  fpu/softfloat-specialize.inc.c  |  16 +--
  fpu/softfloat.c                 | 190 ++++++++++++++++----------------
  target/arm/sve_helper.c         |   8 +-
  target/arm/vfp_helper.c         |   8 +-
  target/m68k/softfloat.c         |  70 ++++++------
  target/mips/msa_helper.c        |  10 +-
  10 files changed, 174 insertions(+), 190 deletions(-)

[...]
diff --git a/include/fpu/softfloat-types.h b/include/fpu/softfloat-types.h
index 2aae6a89b1..619b875df6 100644
--- a/include/fpu/softfloat-types.h
+++ b/include/fpu/softfloat-types.h
@@ -80,12 +80,6 @@ this code that are retained.
  #ifndef SOFTFLOAT_TYPES_H
  #define SOFTFLOAT_TYPES_H
-/* This 'flag' type must be able to hold at least 0 and 1. It should
- * probably be replaced with 'bool' but the uses would need to be audited
- * to check that they weren't accidentally relying on it being a larger type.
- */
-typedef uint8_t flag;

Reviewed-by: Philippe Mathieu-Daudé <f4...@amsat.org>

-
  /*
   * Software IEC/IEEE floating-point types.
   */
@@ -169,12 +163,12 @@ typedef struct float_status {
      uint8_t     float_exception_flags;
      signed char floatx80_rounding_precision;
      /* should denormalised results go to zero and set the inexact flag? */
-    flag flush_to_zero;
+    bool flush_to_zero;
      /* should denormalised inputs go to zero and set the input_denormal flag? 
*/
-    flag flush_inputs_to_zero;
-    flag default_nan_mode;
+    bool flush_inputs_to_zero;
+    bool default_nan_mode;
      /* not always used -- see snan_bit_is_one() in softfloat-specialize.h */
-    flag snan_bit_is_one;
+    bool snan_bit_is_one;
  } float_status;
#endif /* SOFTFLOAT_TYPES_H */
[...]

Reply via email to