public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fw@deneb.enyo.de>
To: "H.J. Lu via Libc-alpha" <libc-alpha@sourceware.org>
Cc: Florian Weimer <fweimer@redhat.com>,
	 "H.J. Lu" <hjl.tools@gmail.com>,
	Paul Zimmermann <Paul.Zimmermann@inria.fr>
Subject: Re: [PATCH] x86_64: Add sinh with FMA
Date: Sun, 20 Aug 2023 16:28:31 +0200	[thread overview]
Message-ID: <87y1i5lre8.fsf@mid.deneb.enyo.de> (raw)
In-Reply-To: <CAMe9rOrfesG-bNTe4BdySCjHXpRtW9misb2rv3dhHS25j_0O9A@mail.gmail.com> (H. J. Lu via Libc-alpha's message of "Thu, 17 Aug 2023 12:21:50 -0700")

* H. J. Lu via Libc-alpha:

> On Thu, Aug 17, 2023 at 12:15 PM Florian Weimer <fweimer@redhat.com> wrote:
>>
>> * H. J. Lu via Libc-alpha:
>> > 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?
>>
>
> That is true.  Performance differences are
>
> 1. Non-FMA
>
>   "sinh": {
>    "": {
>     "duration": 1.60856e+09,
>     "iterations": 1.248e+08,
>     "max": 173.747,
>     "min": 10.706,
>     "mean": 12.8891
>    }
>   }%
>
> 2. FMA
>
>   "sinh": {
>    "": {
>     "duration": 1.61017e+09,
>     "iterations": 1.275e+08,
>     "max": 100.218,
>     "min": 9.678,
>     "mean": 12.6288
>    }
>   }%
>
> FMA is a little faster.  Should I repost it with updated performance
> numbers?

So the baseline is the before column from the original patch?

> On Skylake, it improves sinh bench performance by:
> 
>         Before       After     Improvement
> max     64.06        60.416       7%
> min     10.874       9.674        11%
> mean    14.0546      12.2018      13%

So we go from 14.0546 to 12.6288 for the mean case?

  reply	other threads:[~2023-08-20 14:28 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
2023-08-17 19:21       ` H.J. Lu
2023-08-20 14:28         ` Florian Weimer [this message]
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=87y1i5lre8.fsf@mid.deneb.enyo.de \
    --to=fw@deneb.enyo.de \
    --cc=Paul.Zimmermann@inria.fr \
    --cc=fweimer@redhat.com \
    --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).