[v2] math: Improve layout of expf data

Message ID PAWPR08MB898242BAEF26D23A552AFACA83992@PAWPR08MB8982.eurprd08.prod.outlook.com
State Committed
Delegated to: Adhemerval Zanella Netto
Headers
Series [v2] math: Improve layout of expf data |

Checks

Context Check Description
redhat-pt-bot/TryBot-32bit fail Patch series failed to apply
redhat-pt-bot/TryBot-apply_patch fail Patch failed to apply to master at the time it was sent

Commit Message

Wilco Dijkstra Sept. 9, 2024, 12:57 p.m. UTC
  v2: Improve description

GCC aligns global data to 16 bytes if their size is >= 16 bytes. This patch changes
the exp2f_data struct slightly so that the fields are better aligned. As a result on
targets that support them, load-pair instructions accessing poly_scaled and
invln2_scaled are now 16-byte aligned.

OK for commit?

---
  

Comments

Adhemerval Zanella Netto Oct. 1, 2024, 12:17 p.m. UTC | #1
On 09/09/24 09:57, Wilco Dijkstra wrote:
> v2: Improve description
> 
> GCC aligns global data to 16 bytes if their size is >= 16 bytes. This patch changes
> the exp2f_data struct slightly so that the fields are better aligned. As a result on
> targets that support them, load-pair instructions accessing poly_scaled and
> invln2_scaled are now 16-byte aligned.
> 
> OK for commit?

LGTM, thanks.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

> 
> ---
> 
> diff --git a/sysdeps/ieee754/flt-32/math_config.h b/sysdeps/ieee754/flt-32/math_config.h
> index 729f22cd4f7dd9e44ce5e97fb6a399e29e37eb13..dc07ebd45977e5118a12c6bb7c738d646b0f7926 100644
> --- a/sysdeps/ieee754/flt-32/math_config.h
> +++ b/sysdeps/ieee754/flt-32/math_config.h
> @@ -166,9 +166,9 @@ extern const struct exp2f_data
>    uint64_t tab[1 << EXP2F_TABLE_BITS];
>    double shift_scaled;
>    double poly[EXP2F_POLY_ORDER];
> -  double shift;
>    double invln2_scaled;
>    double poly_scaled[EXP2F_POLY_ORDER];
> +  double shift;
>  } __exp2f_data attribute_hidden;
>  
>  #define LOGF_TABLE_BITS 4
  

Patch

diff --git a/sysdeps/ieee754/flt-32/math_config.h b/sysdeps/ieee754/flt-32/math_config.h
index 729f22cd4f7dd9e44ce5e97fb6a399e29e37eb13..dc07ebd45977e5118a12c6bb7c738d646b0f7926 100644
--- a/sysdeps/ieee754/flt-32/math_config.h
+++ b/sysdeps/ieee754/flt-32/math_config.h
@@ -166,9 +166,9 @@  extern const struct exp2f_data
   uint64_t tab[1 << EXP2F_TABLE_BITS];
   double shift_scaled;
   double poly[EXP2F_POLY_ORDER];
-  double shift;
   double invln2_scaled;
   double poly_scaled[EXP2F_POLY_ORDER];
+  double shift;
 } __exp2f_data attribute_hidden;
 
 #define LOGF_TABLE_BITS 4