This is the mail archive of the mailing list for the libc-ports 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: [PATCH] Speed up libm on MIPS

On 09/20/2013 12:51 PM, Steve Ellcey wrote:
> On Thu, 2013-09-19 at 23:32 -0400, Carlos O'Donell wrote:
>>> +
>>> +  /* Set rounding bits.  */
>>> +  cw &= ~0x3;
>> What's the magic ~0x3? Should it be a new macro?
> 0x3 is a mask to access the two bits in the FPU control register that
> define the rounding mode.  It probably should be a macro and it seems
> like it should go into fpu_control.h where it could be used by the
> 'real' fegetround and fesetround as well these new routines.  What do
> you think of this patch as a precursor to my original patch so that I
> can change all the code to use _FPU_RC_MASK instead of 0x3?

Perfect. Exactly the kind of thing that makes it easier to read,
understand, and maintain this code.
> Steve Ellcey
> 2013-09-19  Steve Ellcey  <>
> 	* sysdeps/mips/fpu_control.h (_FPU_RC_MASK): New.
> 	* sysdeps/mips/fpu/fegetround.c (fegetround): Use _FPU_RC_MASK.
> 	* sysdeps/mips/fpu/fesetround.c (fesetround): Use _FPU_RC_MASK.

Looks good to me. You should just check this in as an obvious cleanup.


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