This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Fix ldbl-128ibm nearbyintl in non-default rounding modes (bug 19790) [committed]
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Anton Blanchard <anton at samba dot org>
- Cc: <libc-alpha at sourceware dot org>, <cseo at linux dot vnet dot ibm dot com>, Tulio Magno Quites Machado Filho <tuliom at linux dot vnet dot ibm dot com>
- Date: Fri, 16 Sep 2016 12:56:15 +0000
- Subject: Re: Fix ldbl-128ibm nearbyintl in non-default rounding modes (bug 19790) [committed]
- Authentication-results: sourceware.org; auth=none
- References: <alpine.DEB.2.10.1603090031250.30259@digraph.polyomino.org.uk> <20160916103501.7c479c85@kryten>
On Fri, 16 Sep 2016, Anton Blanchard wrote:
> > @@ -240,7 +240,7 @@ libc_feholdsetround_ppc_ctx (struct rm_ctx *ctx,
> > int r) fenv_union_t old, new;
> >
> > old.fenv = fegetenv_register ();
> > - new.l = (old.l & ~0x3) | r;
> > + new.l = (old.l & ~0x3 & ~_FPU_MASK_ALL) | r;
> > ctx->env = old.fenv;
> > if (__glibc_unlikely (new.l != old.l))
> > {
> >
>
> new.1 never matches old.l, because we mask out the FPU_MASK_ALL bits.
What then should the correct logic be to ensure that exception traps get
disabled if they were enabled before (the problem this patch was fixing),
without making things less efficient in the common case where the traps
were already disabled? My assumption was that those bits would almost
always be clear, corresponding to traps being disabled.
--
Joseph S. Myers
joseph@codesourcery.com