[PATCH v2 2/2] AArch64: Preserve SVE pow/powf base magnitude across lanes [BZ #34921]
Adhemerval Zanella Netto
adhemerval.zanella@linaro.org
Mon Nov 2 13:30:31 GMT 2026
On 30/10/26 11:14, Pierre Blanchard wrote:
> When another lane needs subnormal normalization, svmul_m merges the
> original signed x into lanes outside its predicate. This restores the
> sign bit previously cleared for negative bases with integer exponents.
LGTM, thanks.
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
> ---
> OK for master? If so please commit for me as I don't have commit rights.
> Likewise if OK for backport to release branches as far back as 2.44.
> Thanks,
I will handle it.
> Pierre
> SHARED-FILES | 4 ++--
> sysdeps/aarch64/fpu/sve/pow.c | 3 ++-
> sysdeps/aarch64/fpu/sve/powf.c | 3 ++-
> 3 files changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/SHARED-FILES b/SHARED-FILES
> index 8f89400177..40edfdecb6 100644
> --- a/SHARED-FILES
> +++ b/SHARED-FILES
> @@ -547,9 +547,9 @@ arm-optimized-routines:
> sysdeps/aarch64/fpu/sve/log2p1f.c
> # math/aarch64/sve/logf.c, revision 8ca4cc0
> sysdeps/aarch64/fpu/sve/logf.c
> - # math/aarch64/sve/pow.c, revision 2c38e83
> + # math/aarch64/sve/pow.c, revision 56dea8e
> sysdeps/aarch64/fpu/sve/pow.c
> - # math/aarch64/sve/powf.c, revision 2c38e83
> + # math/aarch64/sve/powf.c, revision 56dea8e
> sysdeps/aarch64/fpu/sve/powf.c
> # math/aarch64/sve/powr.c, revision 30da949
> sysdeps/aarch64/fpu/sve/powr.c
> diff --git a/sysdeps/aarch64/fpu/sve/pow.c b/sysdeps/aarch64/fpu/sve/pow.c
> index 6fa3b44a41..6c72c7ef35 100644
> --- a/sysdeps/aarch64/fpu/sve/pow.c
> +++ b/sysdeps/aarch64/fpu/sve/pow.c
> @@ -116,7 +116,8 @@ svfloat64_t SV_NAME_D2 (pow) (svfloat64_t x, svfloat64_t y, const svbool_t pg)
> if (__glibc_unlikely (svptest_any (yint_or_xpos, x_is_subnormal)))
> {
> /* Normalize subnormal x so exponent becomes negative. */
> - vix = svreinterpret_u64 (svmul_m (x_is_subnormal, x, 0x1p52));
> + vix = svreinterpret_u64 (
> + svmul_m (x_is_subnormal, svreinterpret_f64 (vix), 0x1p52));
> vix = svand_m (x_is_subnormal, vix, 0x7fffffffffffffff);
> vix = svsub_m (x_is_subnormal, vix, 52ULL << 52);
> }
> diff --git a/sysdeps/aarch64/fpu/sve/powf.c b/sysdeps/aarch64/fpu/sve/powf.c
> index 8f6da3be21..9dcf54e286 100644
> --- a/sysdeps/aarch64/fpu/sve/powf.c
> +++ b/sysdeps/aarch64/fpu/sve/powf.c
> @@ -104,7 +104,8 @@ svfloat32_t SV_NAME_F2 (pow) (svfloat32_t x, svfloat32_t y, const svbool_t pg)
> if (__glibc_unlikely (svptest_any (yint_or_xpos, x_is_subnormal)))
> {
> /* Normalize subnormal x so exponent becomes negative. */
> - vix = svreinterpret_u32 (svmul_m (x_is_subnormal, x, 0x1p23f));
> + vix = svreinterpret_u32 (
> + svmul_m (x_is_subnormal, svreinterpret_f32 (vix), 0x1p23f));
> vix = svand_m (x_is_subnormal, vix, 0x7fffffff);
> vix = svsub_m (x_is_subnormal, vix, d->subnormal_bias);
> }
More information about the Libc-alpha
mailing list