Generic Linux architectural discussions
 help / color / mirror / Atom feed
From: "Arnd Bergmann" <arnd@arndb.de>
To: "Nicolas Pitre" <nico@fluxnic.net>
Cc: "Russell King" <linux@armlinux.org.uk>,
	Linux-Arch <linux-arch@vger.kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 4/4] __arch_xprod64(): make __always_inline when optimizing for performance
Date: Sun, 07 Jul 2024 21:37:49 +0200	[thread overview]
Message-ID: <3dc8f89e-4525-4084-9d4a-facb6105239c@app.fastmail.com> (raw)
In-Reply-To: <8251045r-26sn-4674-p820-4qp6s5o322qq@syhkavp.arg>

On Sun, Jul 7, 2024, at 21:14, Nicolas Pitre wrote:
> On Sun, 7 Jul 2024, Arnd Bergmann wrote:
>
>> On Sun, Jul 7, 2024, at 19:17, Nicolas Pitre wrote:
>> > From: Nicolas Pitre <npitre@baylibre.com>
>> >
>> > Recent gcc versions started not systematically inline __arch_xprod64()
>> > and that has performance implications. Give the compiler the freedom to
>> > decide only when optimizing for size.
>> >
>> > Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
>> 
>> Seems reasonable. Just to make sure: do you know if the non-inline
>> version of xprod_64 ends up producing a more effecient division
>> result than the __do_div64() code path on arch/arm?
>
> __arch_xprod_64() is part of the __do_div64() code path. So I'm not sure 
> of your question.
>
> Obviously, having __arch_xprod_64() inlined is faster but it increases 
> binary size.

I meant whether calling __div64_const32->__arch_xprod_64() is
still faster for a constant base when the new __arch_xprod_64()
is out of line, compared to the __div64_32->__do_div64()
assembly code path we take for a non-constant base.

       Arnd

  reply	other threads:[~2024-07-07 19:38 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-07 17:17 [PATCH v2 0/4] do_div() with constant divisor simplification Nicolas Pitre
2024-07-07 17:17 ` [PATCH v2 1/4] lib/math/test_div64: add some edge cases relevant to __div64_const32() Nicolas Pitre
2024-07-07 17:17 ` [PATCH v2 2/4] asm-generic/div64: optimize/simplify __div64_const32() Nicolas Pitre
2024-07-07 17:17 ` [PATCH v2 3/4] ARM: div64: improve __arch_xprod_64() Nicolas Pitre
2024-07-07 17:17 ` [PATCH v2 4/4] __arch_xprod64(): make __always_inline when optimizing for performance Nicolas Pitre
2024-07-07 18:59   ` Arnd Bergmann
2024-07-07 19:14     ` Nicolas Pitre
2024-07-07 19:37       ` Arnd Bergmann [this message]
2024-07-08  1:21         ` Nicolas Pitre
2024-07-08  5:21           ` Arnd Bergmann
2024-07-07 19:40   ` kernel test robot
2024-07-07 19:40   ` kernel test robot

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=3dc8f89e-4525-4084-9d4a-facb6105239c@app.fastmail.com \
    --to=arnd@arndb.de \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=nico@fluxnic.net \
    /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