qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 02/10] softfloat: Replace flag with bool


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH 02/10] softfloat: Replace flag with bool
Date: Sat, 16 May 2020 07:27:59 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0

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 <address@hidden>
---
  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é <address@hidden>

-
  /*
   * 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

[Prev in Thread] Current Thread [Next in Thread]