Fix ldbl-128ibm nearbyintl in non-default rounding modes (bug 19790) [committed]
Joseph Myers
joseph@codesourcery.com
Fri Sep 16 12:56:00 GMT 2016
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
More information about the Libc-alpha
mailing list