public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>
To: DJ Delorie <dj@redhat.com>, Paul.Zimmermann@inria.fr
Cc: libc-alpha@sourceware.org, josmyers@redhat.com, sibid@uvic.ca
Subject: Re: [PATCH 15/15] x86_64: Add asinpif with FMA
Date: Wed, 12 Feb 2025 08:00:34 -0300	[thread overview]
Message-ID: <314a176f-d9f8-41f5-a41b-e67dae132a20@linaro.org> (raw)
In-Reply-To: <7d65a1e3-81e8-40dd-a13c-276a7f1bd599@linaro.org>



On 11/02/25 17:13, Adhemerval Zanella Netto wrote:
> 
> 
> On 11/02/25 11:12, Adhemerval Zanella Netto wrote:
>>
>>
>> On 10/02/25 22:31, DJ Delorie wrote:
>>>
>>> LGTM
>>>
>>> Reviewed-by: DJ Delorie <dj@redhat.com>
>>>
>>> Adhemerval Zanella <adhemerval.zanella@linaro.org> writes:
>>>> The CORE-MATH asinpif implementation showed slight worse performance
>>>> when using x86_64 baseline ABI due its usage of fma on fast path.
>>>> This patch adds a ifunc variant with similar performance for x86_64-v3.
>>>
>>> Do you have the performance numbers to report?
>>
>> It turns out that Paul has suggested to just remove the fma operation [1]
>> on the fast-path; which makes the code faster on x86_64 and x86_64-v2
>> and the iFUNC variant not required anymore.  I will update the asinpif
>> with the new performance numbers. 
>>
>> [1] https://gitlab.inria.fr/core-math/core-math/-/commit/ccdd955b6fa614c8d88bd1d6fd323abaf43cfb3f
> 
> So testing a glibc built for x86_64 with CORE-MATH extensive testing,
> along with the fma removal change [1] I am seeing a failure:
> 
>   gmake: Leaving directory '/tmp/core-math.M5zb5H/toto/asinpi'
>   Running exhaustive check in --rndn mode...
>   FAIL x=0x1.bc1fdep-4 ref=0x1.1b4bap-5 y=0x1.1b4b9ep-5
> 
> I don't see this on aarch64, nor with x86_64-v3 because gcc optimize
> the polynomial evaluation with fma instructions.
> 
> Paul, I think we are not seeing this issue because CORE-MATH extensive
> check.sh script always use -march=native; where with recent gcc on
> current chips will always use fma instructions.  I think you will need
> to revert the CORE-MATH ccdd955b6fa614c8d88bd1d6fd323abaf43cfb3f patch.
> 
> So I will use this patch as-is (since it passes both glibc testsuite
> and CORE-MATH extensive tests for x86_64, x86_64-v3, and aarch64)
> along with the asinpif FMA ifunc for x86_64.
> 
> [1] https://gitlab.inria.fr/core-math/core-math/-/commit/ccdd955b6fa614c8d88bd1d6fd323abaf43cfb3f

The adjusted polynomial coefficients fixes the issues on x86_64 [1].
I will adjust the patch with this version.

[1] https://gitlab.inria.fr/core-math/core-math/-/commit/6ee58266fe4543511a3444ac4dff38318291cfac

  reply	other threads:[~2025-02-12 11:00 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-31 19:17 [PATCH 00/15] Add c23 CORE-MATH binary32 implementations to libm Adhemerval Zanella
2025-01-31 19:17 ` [PATCH 01/15] benchtests: Add acospif Adhemerval Zanella
2025-02-07 22:00   ` DJ Delorie
2025-01-31 19:17 ` [PATCH 02/15] benchtests: Add asinpif Adhemerval Zanella
2025-02-07 22:06   ` DJ Delorie
2025-02-11 12:56     ` Adhemerval Zanella Netto
2025-01-31 19:17 ` [PATCH 03/15] benchtests: Add atan2pif Adhemerval Zanella
2025-02-07 22:19   ` DJ Delorie
2025-01-31 19:17 ` [PATCH 04/15] benchtests: Add atanpif Adhemerval Zanella
2025-02-07 22:36   ` DJ Delorie
2025-01-31 19:17 ` [PATCH 05/15] benchtests: Add cospif Adhemerval Zanella
2025-02-07 22:51   ` DJ Delorie
2025-02-11 13:13     ` Adhemerval Zanella Netto
2025-02-11 19:56       ` DJ Delorie
2025-01-31 19:17 ` [PATCH 06/15] benchtests: Add sinpif Adhemerval Zanella
2025-02-07 22:54   ` DJ Delorie
2025-02-11 13:13     ` Adhemerval Zanella Netto
2025-02-11 19:58       ` DJ Delorie
2025-01-31 19:17 ` [PATCH 07/15] benchtests: Add tanpif Adhemerval Zanella
2025-02-01  8:18   ` Paul Zimmermann
2025-02-07 22:55   ` DJ Delorie
2025-01-31 19:17 ` [PATCH 08/15] math: Use acospif from CORE-MATH Adhemerval Zanella
2025-02-01  8:22   ` Paul Zimmermann
2025-02-08  2:15   ` DJ Delorie
2025-02-11 13:16     ` Adhemerval Zanella Netto
2025-01-31 19:17 ` [PATCH 09/15] math: Use asinpif " Adhemerval Zanella
2025-02-01  8:28   ` Paul Zimmermann
2025-02-03  6:40   ` Paul Zimmermann
2025-02-03 12:27     ` Adhemerval Zanella Netto
2025-02-08  3:03   ` DJ Delorie
2025-01-31 19:17 ` [PATCH 10/15] math: Use atan2pif " Adhemerval Zanella
2025-02-08  4:20   ` DJ Delorie
2025-02-11 13:27     ` Adhemerval Zanella Netto
2025-01-31 19:17 ` [PATCH 11/15] math: Use atanpif " Adhemerval Zanella
2025-02-03  7:09   ` Paul Zimmermann
2025-02-10 22:29   ` DJ Delorie
2025-02-11 14:07     ` Adhemerval Zanella Netto
2025-02-11 14:22       ` Paul Zimmermann
2025-02-11 20:01         ` DJ Delorie
2025-02-11 20:10           ` Adhemerval Zanella Netto
2025-01-31 19:17 ` [PATCH 12/15] math: Use cospif " Adhemerval Zanella
2025-02-03  7:16   ` Paul Zimmermann
2025-02-10 23:07   ` DJ Delorie
2025-01-31 19:17 ` [PATCH 13/15] math: Use sinpif " Adhemerval Zanella
2025-02-03 10:39   ` Paul Zimmermann
2025-02-11  0:56   ` DJ Delorie
2025-01-31 19:17 ` [PATCH 14/15] math: Use tanpif " Adhemerval Zanella
2025-02-03 11:05   ` Paul Zimmermann
2025-02-11  1:15   ` DJ Delorie
2025-02-11 14:09     ` Adhemerval Zanella Netto
2025-01-31 19:17 ` [PATCH 15/15] x86_64: Add asinpif with FMA Adhemerval Zanella
2025-01-31 22:59   ` Noah Goldstein
2025-02-11  1:31   ` DJ Delorie
2025-02-11 14:12     ` Adhemerval Zanella Netto
2025-02-11 20:13       ` Adhemerval Zanella Netto
2025-02-12 11:00         ` Adhemerval Zanella Netto [this message]
2025-02-01  8:14 ` [PATCH 00/15] Add c23 CORE-MATH binary32 implementations to libm Paul Zimmermann

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=314a176f-d9f8-41f5-a41b-e67dae132a20@linaro.org \
    --to=adhemerval.zanella@linaro.org \
    --cc=Paul.Zimmermann@inria.fr \
    --cc=dj@redhat.com \
    --cc=josmyers@redhat.com \
    --cc=libc-alpha@sourceware.org \
    --cc=sibid@uvic.ca \
    /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).