This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Set/restore rounding mode only when needed
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Siddhesh Poyarekar <siddhesh at redhat dot com>
- Cc: <libc-alpha at sourceware dot org>
- Date: Wed, 5 Jun 2013 12:38:48 +0000
- Subject: Re: [PATCH] Set/restore rounding mode only when needed
- References: <20130605110719 dot GU13968 at spoyarek dot pnq dot redhat dot com>
On Wed, 5 Jun 2013, Siddhesh Poyarekar wrote:
> Hi,
>
> The most common use case of math functions is with default rounding
> mode, i.e. rounding to nearest. Setting and restoring rounding mode
> is an unnecessary overhead for this, so I've added support for a
> context, which does the set/restore only if the FP status needs a
> change. The code is written such that only x86 uses these. Other
> architectures should be unaffected by it, but would definitely benefit
> if the set/restore has as much overhead relative to the rest of the
> code, as the x86 bits do.
Could you explain further why you need new interfaces for this - why you
can't just generally make the code setting the rounding mode (both
internally in glibc, and the public fesetround etc.) check whether it
would be changing anything before executing the store?
--
Joseph S. Myers
joseph@codesourcery.com