public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Stefan Kanthak" <stefan.kanthak@nexgo.de>
To: "Jakub Jelinek" <jakub@redhat.com>, "Jeff Law" <law@redhat.com>
Cc: "Andreas Schwab" <schwab@linux-m68k.org>,
	<gcc-patches@gcc.gnu.org>, "Eric Botcazou" <botcazou@adacore.com>
Subject: Re: [PATCH] Better __ashlDI3, __ashrDI3 and __lshrDI3 functions, plus fixed __bswapsi2 function
Date: Thu, 26 Nov 2020 00:06:05 +0100	[thread overview]
Message-ID: <701788C189064AA0B816C484A95C654B@H270> (raw)
In-Reply-To: <d9639253-612c-aaaf-2e69-80a24dadf0e6@redhat.com>

Jeff Law <law@redhat.com> wrote:

[...]

> By understanding how your proposed changes affect other processors, you
> can write better changes that are more likely to get included. 
> Furthermore you can focus efforts on things that matter more in the real
> world. DImode shifts in libgcc are _not_ useful to try and optimize on
> x86_64 as it has instructions to implement 64 bit shifts. DImode shifts
> in libgcc are not useful to try and optimize on i686 as the compiler can
> synthesize them on i686. DImode shifts can't be easily synthesized on
> other targets and on those targets we call the routines in libgcc2. 
> Similarly for other routines you find in libgcc2.

What makes you think that my patches addressed only i386 and AMD64?

Again: from the absence of __addDI3/__subDI3 in libgcc2.[ch] I had reason
to assume that GCC synthesizes "double-word" addition/subtraction on all
processors, not just on x86.
Since "double-word" comparision and shifts are likewise simple operations
I further assumed that GCC synthesizes them too on all processors.

What's the fundamental difference between subtraction and comparision?
Why does GCC generate calls to __[u]cmpDI2 for a simple comparision
instead to synthesize it?
And: as shown in libgcc2.c, "double-word" shifts can easily be synthesized
using "single-word" shifts plus logical OR on any target.
I expected GCC to synthesize these operations on non-x86 processors too,
just like "double-word" addition and subtraction.

A possible/reasonable explanation would be code size, i.e. if the synthesized
instructions need significantly more memory than the function call (including
the argument setup of course).

Stefan

  reply	other threads:[~2020-11-25 23:12 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-10 17:59 Stefan Kanthak
2020-11-10 18:08 ` Eric Botcazou
2020-11-10 19:44   ` Stefan Kanthak
2020-11-10 20:14     ` Jakub Jelinek
2020-11-10 21:09       ` Jeff Law
2020-11-10 21:17         ` Jakub Jelinek
2020-11-10 23:42           ` Jeff Law
2020-11-24  0:21         ` Jeff Law
2020-11-10 22:12       ` Jeff Law
2020-11-10 22:01     ` Jeff Law
2020-11-11  0:00     ` Andreas Schwab
2020-11-24 13:57       ` Stefan Kanthak
2020-11-24 14:34         ` Andreas Schwab
2020-11-24 15:40           ` Stefan Kanthak
2020-11-24 15:49             ` Andreas Schwab
2020-11-25 18:53             ` Jeff Law
2020-11-25 20:22               ` Stefan Kanthak
2020-11-25 20:42                 ` Jakub Jelinek
2020-11-25 21:22                   ` Stefan Kanthak
2020-11-25 22:06                     ` Jeff Law
2020-11-25 23:06                       ` Stefan Kanthak [this message]
2020-11-25 20:44                 ` Jeff Law
2020-11-10 18:09 ` Jakub Jelinek
2020-11-10 18:32   ` Jeff Law
2020-11-10 18:26 ` Jakub Jelinek
2020-11-10 23:48 ` Jeff Law
2020-11-10 23:53   ` Jakub Jelinek
2020-11-11  8:33     ` Stefan Kanthak
2020-11-11  9:55       ` Jakub Jelinek
2020-11-11 17:54         ` Joseph Myers
2020-11-23 23:01         ` Jeff Law
2020-11-30  1:06       ` Jeff Law

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=701788C189064AA0B816C484A95C654B@H270 \
    --to=stefan.kanthak@nexgo.de \
    --cc=botcazou@adacore.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=law@redhat.com \
    --cc=schwab@linux-m68k.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).