diff mbox series

[v6,04/13] softfloat: rename canonicalize to sf_canonicalize

Message ID 20181124235553.17371-5-cota@braap.org (mailing list archive)
State New, archived
Headers show
Series hardfloat | expand

Commit Message

Emilio Cota Nov. 24, 2018, 11:55 p.m. UTC
glibc >= 2.25 defines canonicalize in commit eaf5ad0
(Add canonicalize, canonicalizef, canonicalizel., 2016-10-26).

Given that we'll be including <math.h> soon, prepare
for this by prefixing our canonicalize() with sf_ to avoid
clashing with the libc's canonicalize().

Reported-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Tested-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Signed-off-by: Emilio G. Cota <cota@braap.org>
---
 fpu/softfloat.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

Alex Bennée Dec. 3, 2018, 2:16 p.m. UTC | #1
Emilio G. Cota <cota@braap.org> writes:

> glibc >= 2.25 defines canonicalize in commit eaf5ad0
> (Add canonicalize, canonicalizef, canonicalizel., 2016-10-26).
>
> Given that we'll be including <math.h> soon, prepare
> for this by prefixing our canonicalize() with sf_ to avoid
> clashing with the libc's canonicalize().
>
> Reported-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
> Tested-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
> Signed-off-by: Emilio G. Cota <cota@braap.org>

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>

> ---
>  fpu/softfloat.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/fpu/softfloat.c b/fpu/softfloat.c
> index e1eef954e6..ecdc00c633 100644
> --- a/fpu/softfloat.c
> +++ b/fpu/softfloat.c
> @@ -336,8 +336,8 @@ static inline float64 float64_pack_raw(FloatParts p)
>  #include "softfloat-specialize.h"
>
>  /* Canonicalize EXP and FRAC, setting CLS.  */
> -static FloatParts canonicalize(FloatParts part, const FloatFmt *parm,
> -                               float_status *status)
> +static FloatParts sf_canonicalize(FloatParts part, const FloatFmt *parm,
> +                                  float_status *status)
>  {
>      if (part.exp == parm->exp_max && !parm->arm_althp) {
>          if (part.frac == 0) {
> @@ -513,7 +513,7 @@ static FloatParts round_canonical(FloatParts p, float_status *s,
>  static FloatParts float16a_unpack_canonical(float16 f, float_status *s,
>                                              const FloatFmt *params)
>  {
> -    return canonicalize(float16_unpack_raw(f), params, s);
> +    return sf_canonicalize(float16_unpack_raw(f), params, s);
>  }
>
>  static FloatParts float16_unpack_canonical(float16 f, float_status *s)
> @@ -534,7 +534,7 @@ static float16 float16_round_pack_canonical(FloatParts p, float_status *s)
>
>  static FloatParts float32_unpack_canonical(float32 f, float_status *s)
>  {
> -    return canonicalize(float32_unpack_raw(f), &float32_params, s);
> +    return sf_canonicalize(float32_unpack_raw(f), &float32_params, s);
>  }
>
>  static float32 float32_round_pack_canonical(FloatParts p, float_status *s)
> @@ -544,7 +544,7 @@ static float32 float32_round_pack_canonical(FloatParts p, float_status *s)
>
>  static FloatParts float64_unpack_canonical(float64 f, float_status *s)
>  {
> -    return canonicalize(float64_unpack_raw(f), &float64_params, s);
> +    return sf_canonicalize(float64_unpack_raw(f), &float64_params, s);
>  }
>
>  static float64 float64_round_pack_canonical(FloatParts p, float_status *s)


--
Alex Bennée
diff mbox series

Patch

diff --git a/fpu/softfloat.c b/fpu/softfloat.c
index e1eef954e6..ecdc00c633 100644
--- a/fpu/softfloat.c
+++ b/fpu/softfloat.c
@@ -336,8 +336,8 @@  static inline float64 float64_pack_raw(FloatParts p)
 #include "softfloat-specialize.h"
 
 /* Canonicalize EXP and FRAC, setting CLS.  */
-static FloatParts canonicalize(FloatParts part, const FloatFmt *parm,
-                               float_status *status)
+static FloatParts sf_canonicalize(FloatParts part, const FloatFmt *parm,
+                                  float_status *status)
 {
     if (part.exp == parm->exp_max && !parm->arm_althp) {
         if (part.frac == 0) {
@@ -513,7 +513,7 @@  static FloatParts round_canonical(FloatParts p, float_status *s,
 static FloatParts float16a_unpack_canonical(float16 f, float_status *s,
                                             const FloatFmt *params)
 {
-    return canonicalize(float16_unpack_raw(f), params, s);
+    return sf_canonicalize(float16_unpack_raw(f), params, s);
 }
 
 static FloatParts float16_unpack_canonical(float16 f, float_status *s)
@@ -534,7 +534,7 @@  static float16 float16_round_pack_canonical(FloatParts p, float_status *s)
 
 static FloatParts float32_unpack_canonical(float32 f, float_status *s)
 {
-    return canonicalize(float32_unpack_raw(f), &float32_params, s);
+    return sf_canonicalize(float32_unpack_raw(f), &float32_params, s);
 }
 
 static float32 float32_round_pack_canonical(FloatParts p, float_status *s)
@@ -544,7 +544,7 @@  static float32 float32_round_pack_canonical(FloatParts p, float_status *s)
 
 static FloatParts float64_unpack_canonical(float64 f, float_status *s)
 {
-    return canonicalize(float64_unpack_raw(f), &float64_params, s);
+    return sf_canonicalize(float64_unpack_raw(f), &float64_params, s);
 }
 
 static float64 float64_round_pack_canonical(FloatParts p, float_status *s)