This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fix ldbl-128ibm nearbyintl in non-default rounding modes (bug 19790) [committed]


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]