public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: "H.J. Lu via Libc-alpha" <libc-alpha@sourceware.org>
Cc: Paul Zimmermann <Paul.Zimmermann@inria.fr>,
	 "H.J. Lu" <hjl.tools@gmail.com>
Subject: Re: [PATCH] x86_64: Add sinh with FMA
Date: Thu, 17 Aug 2023 21:15:22 +0200	[thread overview]
Message-ID: <87bkf5pjjp.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <CAMe9rOrK2erMHSReFs6icFHpreuUH70CvP2dTce0Gs-EA6tr2A@mail.gmail.com> (H. J. Lu via Libc-alpha's message of "Wed, 16 Aug 2023 10:23:05 -0700")

* H. J. Lu via Libc-alpha:

> On Wed, Aug 16, 2023 at 7:45 AM Paul Zimmermann
> <Paul.Zimmermann@inria.fr> wrote:
>>
>>        Hi H.J.,
>>
>> I get no improvement in accuracy. The largest known ulp error is still
>> the same:
>>
>> sinh 0 -1 -0x1.633c654fee2bap+9 [2] [1.93] 1.92222 1.922214006544865
>>
>> Maybe the FMA is not used for large inputs?
>>
>
> There is only one FMA insn in __ieee754_sinh_fma:
>
> 114: c4 e2 e9 9b 05 00 00 00 00 vfmsub132sd 0x0(%rip),%xmm2,%xmm0
>
> Since it calls __ieee754_exp and __expm1, with
>
> commit 1b214630ce6f7e0099b8b6f87246246739b079cf (master)
> Author: H.J. Lu <hjl.tools@gmail.com>
> Date:   Fri Aug 11 08:04:08 2023 -0700
>
>     x86_64: Add expm1 with FMA
>
>     On Skylake, it improves expm1 bench performance by:
>
>             Before       After     Improvement
>     max     70.204       68.054       3%
>     min     20.709       16.2         22%
>     mean    22.1221      16.7367      24%
>
> There is very little improvement with a single FMA insn.

If you specialize the implementation for FMA, could you avoid the
indirect call to __ieee754_exp and __expm1?

Thanks,
Florian


  reply	other threads:[~2023-08-17 19:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-14 15:16 H.J. Lu
2023-08-14 15:50 ` Andreas Schwab
2023-08-14 15:57   ` H.J. Lu
2023-08-14 16:06     ` Andreas Schwab
2023-08-16 14:45 ` Paul Zimmermann
2023-08-16 17:23   ` H.J. Lu
2023-08-17 19:15     ` Florian Weimer [this message]
2023-08-17 19:21       ` H.J. Lu
2023-08-20 14:28         ` Florian Weimer
2023-08-20 14:29           ` H.J. Lu

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

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

  git send-email \
    --in-reply-to=87bkf5pjjp.fsf@oldenburg.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=Paul.Zimmermann@inria.fr \
    --cc=hjl.tools@gmail.com \
    --cc=libc-alpha@sourceware.org \
    /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).