This is the mail archive of the
libc-ports@sources.redhat.com
mailing list for the libc-ports project.
Re: [PATCH] Speed up libm on MIPS
- From: "Carlos O'Donell" <carlos at redhat dot com>
- To: Steve Ellcey <sellcey at mips dot com>
- Cc: "Joseph S. Myers" <joseph at codesourcery dot com>, libc-ports at sourceware dot org
- Date: Fri, 20 Sep 2013 13:06:49 -0400
- Subject: Re: [PATCH] Speed up libm on MIPS
- Authentication-results: sourceware.org; auth=none
- References: <1379631395 dot 5770 dot 445 dot camel at ubuntu-sellcey> <523BC1B8 dot 4040102 at redhat dot com> <1379695885 dot 5770 dot 463 dot camel at ubuntu-sellcey>
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
> sellcey@mips.com
>
>
>
> 2013-09-19 Steve Ellcey <sellcey@mips.com>
>
> * 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.
Cheers,
Carlos.