Fix BZ #29463 in the ibm128 implementation of y1l too

Message ID 20220822020504.138206-1-michael.hudson@canonical.com
State Committed
Commit b6e37b7805b0182c3e25cdab39ebf5f001c04d05
Delegated to: Tulio Magno Quites Machado Filho
Headers
Series Fix BZ #29463 in the ibm128 implementation of y1l too |

Checks

Context Check Description
dj/TryBot-apply_patch success Patch applied to master at the time it was sent
dj/TryBot-32bit success Build for i686

Commit Message

Michael Hudson-Doyle Aug. 22, 2022, 2:05 a.m. UTC
  ---
 sysdeps/ieee754/ldbl-128ibm/e_j1l.c | 3 +++
 1 file changed, 3 insertions(+)
  

Comments

Aurelien Jarno Oct. 9, 2022, 10:09 p.m. UTC | #1
On 2022-08-22 14:05, Michael Hudson-Doyle via Libc-alpha wrote:
> ---
>  sysdeps/ieee754/ldbl-128ibm/e_j1l.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/sysdeps/ieee754/ldbl-128ibm/e_j1l.c b/sysdeps/ieee754/ldbl-128ibm/e_j1l.c
> index f85ba94466..0a5fe68342 100644
> --- a/sysdeps/ieee754/ldbl-128ibm/e_j1l.c
> +++ b/sysdeps/ieee754/ldbl-128ibm/e_j1l.c
> @@ -792,10 +792,13 @@ __ieee754_y1l (long double x)
>      {
>        /* 0 <= x <= 2 */
>        SET_RESTORE_ROUNDL (FE_TONEAREST);
> +      xx = math_opt_barrier (xx);
> +      x = math_opt_barrier (x);
>        z = xx * xx;
>        p = xx * neval (z, Y0_2N, NY0_2N) / deval (z, Y0_2D, NY0_2D);
>        p = -TWOOPI / xx + p;
>        p = TWOOPI * __ieee754_logl (x) * __ieee754_j1l (x) + p;
> +      math_force_eval (p);
>        return p;
>      }
>  

Tested-by: Aurelien Jarno <aurelien@aurel32.net>
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>

Small nitpick, you might want a similar commit message than for the
ldbl-128, especially now that they will be far from another in the git
log. Note however that for that one the issue is reproducible with GCC
12 even in -O2.
  
Aurelien Jarno Oct. 22, 2022, 10:14 a.m. UTC | #2
Ping. Tulio (as powerpc machine maintainer) or Joseph (as math component
maintainer), could you please have a look at this patch?

On 2022-10-10 00:09, Aurelien Jarno wrote:
> On 2022-08-22 14:05, Michael Hudson-Doyle via Libc-alpha wrote:
> > ---
> >  sysdeps/ieee754/ldbl-128ibm/e_j1l.c | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/sysdeps/ieee754/ldbl-128ibm/e_j1l.c b/sysdeps/ieee754/ldbl-128ibm/e_j1l.c
> > index f85ba94466..0a5fe68342 100644
> > --- a/sysdeps/ieee754/ldbl-128ibm/e_j1l.c
> > +++ b/sysdeps/ieee754/ldbl-128ibm/e_j1l.c
> > @@ -792,10 +792,13 @@ __ieee754_y1l (long double x)
> >      {
> >        /* 0 <= x <= 2 */
> >        SET_RESTORE_ROUNDL (FE_TONEAREST);
> > +      xx = math_opt_barrier (xx);
> > +      x = math_opt_barrier (x);
> >        z = xx * xx;
> >        p = xx * neval (z, Y0_2N, NY0_2N) / deval (z, Y0_2D, NY0_2D);
> >        p = -TWOOPI / xx + p;
> >        p = TWOOPI * __ieee754_logl (x) * __ieee754_j1l (x) + p;
> > +      math_force_eval (p);
> >        return p;
> >      }
> >  
> 
> Tested-by: Aurelien Jarno <aurelien@aurel32.net>
> Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
> 
> Small nitpick, you might want a similar commit message than for the
> ldbl-128, especially now that they will be far from another in the git
> log. Note however that for that one the issue is reproducible with GCC
> 12 even in -O2.
> 
> -- 
> Aurelien Jarno                          GPG: 4096R/1DDD8C9B
> aurelien@aurel32.net                 http://www.aurel32.net
>
  
Tulio Magno Quites Machado Filho Oct. 24, 2022, 12:24 p.m. UTC | #3
Aurelien Jarno <aurelien@aurel32.net> writes:

> Ping. Tulio (as powerpc machine maintainer) or Joseph (as math component
> maintainer), could you please have a look at this patch?

I apologize for taking so long to review this.
The code LGTM, but I agree with Aurelien that it needs a better commit message,
e.g.:

    Avoid moving code across SET_RESTORE_ROUNDL.

Michael, do you need help in order to merge this?

Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
  
Michael Hudson-Doyle Oct. 24, 2022, 1:15 p.m. UTC | #4
On Mon, 24 Oct 2022, 14:24 Tulio Magno Quites Machado Filho, <
tuliom@ascii.art.br> wrote:

> Aurelien Jarno <aurelien@aurel32.net> writes:
>
> > Ping. Tulio (as powerpc machine maintainer) or Joseph (as math component
> > maintainer), could you please have a look at this patch?
>
> I apologize for taking so long to review this.
> The code LGTM, but I agree with Aurelien that it needs a better commit
> message,
> e.g.:
>
>     Avoid moving code across SET_RESTORE_ROUNDL.
>
> Michael, do you need help in order to merge this?
>

I have permission to do so but have been completely unable to find the time
to do it. If you have a cycle or two to spare it would be great.

Cheers,
mwh

Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
>
  

Patch

diff --git a/sysdeps/ieee754/ldbl-128ibm/e_j1l.c b/sysdeps/ieee754/ldbl-128ibm/e_j1l.c
index f85ba94466..0a5fe68342 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_j1l.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_j1l.c
@@ -792,10 +792,13 @@  __ieee754_y1l (long double x)
     {
       /* 0 <= x <= 2 */
       SET_RESTORE_ROUNDL (FE_TONEAREST);
+      xx = math_opt_barrier (xx);
+      x = math_opt_barrier (x);
       z = xx * xx;
       p = xx * neval (z, Y0_2N, NY0_2N) / deval (z, Y0_2D, NY0_2D);
       p = -TWOOPI / xx + p;
       p = TWOOPI * __ieee754_logl (x) * __ieee754_j1l (x) + p;
+      math_force_eval (p);
       return p;
     }