unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
To: "patrick.mcgehearty@oracle.com" <patrick.mcgehearty@oracle.com>,
	"Szabolcs Nagy" <Szabolcs.Nagy@arm.com>
Cc: "libc-alpha@sourceware.org" <libc-alpha@sourceware.org>, nd <nd@arm.com>
Subject: Re: [PATCH] v11 Improves __ieee754_exp() performance by greater than 5x on sparc/x86.
Date: Thu, 8 Feb 2018 11:40:37 +0000	[thread overview]
Message-ID: <DB6PR0801MB2053765A646D2DCBE02B666883F30@DB6PR0801MB2053.eurprd08.prod.outlook.com> (raw)

Hi Patrick,

> Has there been a serious discussion in the past of to what degree
> of accuracy glibc/libm should support other rounding modes than
> round-to-nearest?  If a concensus decision were made that
> other rounding modes were allowed slightly greater ulp diffs,
> we could remove all the rounding mode checks and get
> faster code. Failing that concensus, I don't see how we
> can bypass the rounding mode checks for the generic code.

There have been various discussions, but nothing conclusive. I believe the
rounding mode changes can be removed from all the key math functions if we
accept 1 extra ULP in non-nearest rounding modes. As Szabolcs mentioned
there are some round-to-int idioms used by math functions which rely on a
specific rounding mode, but we can fix those.

If rounding errors in the more complex functions go up (some are very
sensitive to ULP), we could consider adding the rounding mode changes there -
that means you only do it where absolutely necessary, and also in cases where
the relative overhead is much lower.

Or alternatively we could agree that we don't have a requirement to optimize
math functions for absolute best possible ULP with different rounding modes,
and accept larger ULP errors.

> I'll look into comparing removing the slow path on Sparc and
> x86, including running my own "10 million values" test to
> get a sense of how frequently the slow path is triggered
> and what the largest relative error that test observes.
> I'll also run timing tests.

Yes I noticed that even when the slow path doesn't trigger, it has a significant
overhead (log is 18% faster without the slow paths). Note we'll likely post patches
for removing slow paths in exp, pow as well.

Wilco

             reply	other threads:[~2018-02-08 11:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-08 11:40 Wilco Dijkstra [this message]
2018-02-14  1:18 ` [PATCH] v11 Improves __ieee754_exp() performance by greater than 5x on sparc/x86 Patrick McGehearty
2018-02-14 16:41   ` Joseph Myers
2018-02-14 20:05     ` Szabolcs Nagy
2018-02-22 19:22   ` Szabolcs Nagy
  -- strict thread matches above, loose matches on Subject: below --
2018-01-29 21:44 Patrick McGehearty
2018-02-02 14:40 ` Szabolcs Nagy
2018-02-02 15:33   ` Joseph Myers
2018-02-02 16:35     ` Szabolcs Nagy
2018-02-07 19:19   ` Patrick McGehearty

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/libc/involved.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DB6PR0801MB2053765A646D2DCBE02B666883F30@DB6PR0801MB2053.eurprd08.prod.outlook.com \
    --to=wilco.dijkstra@arm.com \
    --cc=Szabolcs.Nagy@arm.com \
    --cc=libc-alpha@sourceware.org \
    --cc=nd@arm.com \
    --cc=patrick.mcgehearty@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).