public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/97459] __uint128_t remainder for division by 3
Date: Tue, 01 Dec 2020 15:25:44 +0000	[thread overview]
Message-ID: <bug-97459-4-qLoIWoqw3P@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-97459-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97459

--- Comment #23 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:855bb43f6d0bee5a74b5d3739456ca34b4609a50

commit r11-5614-g855bb43f6d0bee5a74b5d3739456ca34b4609a50
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Tue Dec 1 16:25:06 2020 +0100

    Improve double-word mod even on powerpc [PR97459]

    I have noticed that while my (already committed, thanks for review)
    patch works on x86, it doesn't work on powerpc*.  The problem is that
    we don't have lshr double-word optab (neither TImode nor for -m32 DImode),
    but as expander has code for double-word shift, that doesn't really matter.
    As the implementation is prepared to punt whenever something can't be
    expanded with OPTAB_DIRECT and in the end also punts if any library calls
    would be emitted, the optab_handler checks were just to save compile time.

    On the other side, for even divisors, we know that (1 << bit) % (2 * x)
    for bit > 0 will never be equal to 1, because both dividend and divisor
    are even and so remainder will be even too, so we can save some compile
time
    by adding an early exit.

    The even divisors can be handled with the approach Thomas wrote about
    (perhaps generalized into divisors equal to what expand_doubleword_mod
    can handle times some power of two where we can handle power of two modulo
    cheaply), but that would be done in a different function...
    And we could use ctz to find the power of two...

    2020-12-01  Jakub Jelinek  <jakub@redhat.com>

            PR rtl-optimization/97459
            * optabs.c (expand_doubleword_mod): Punt early for even op1.
            (expand_binop): Don't require lshr_optab double-word handler.

  parent reply	other threads:[~2020-12-01 15:25 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-16 13:33 [Bug rtl-optimization/97459] New: " tkoenig at gcc dot gnu.org
2020-10-16 15:22 ` [Bug rtl-optimization/97459] " jakub at gcc dot gnu.org
2020-10-16 15:52 ` jakub at gcc dot gnu.org
2020-10-16 15:57 ` jakub at gcc dot gnu.org
2020-10-17 12:22 ` tkoenig at gcc dot gnu.org
2020-10-18  7:33 ` tkoenig at gcc dot gnu.org
2020-10-18  9:11 ` jakub at gcc dot gnu.org
2020-10-19 11:51 ` jakub at gcc dot gnu.org
2020-10-19 12:05 ` jakub at gcc dot gnu.org
2020-10-20 18:16 ` tkoenig at gcc dot gnu.org
2020-10-23 16:56 ` tkoenig at gcc dot gnu.org
2020-10-24 18:09 ` tkoenig at gcc dot gnu.org
2020-10-24 18:14 ` tkoenig at gcc dot gnu.org
2020-10-26  5:28 ` tkoenig at gcc dot gnu.org
2020-11-08  9:31 ` tkoenig at gcc dot gnu.org
2020-11-08 10:24 ` jakub at gcc dot gnu.org
2020-11-08 19:28 ` tkoenig at gcc dot gnu.org
2020-11-08 19:33 ` tkoenig at gcc dot gnu.org
2020-11-26 19:12 ` jakub at gcc dot gnu.org
2020-11-27 13:26 ` jakub at gcc dot gnu.org
2020-11-27 15:10 ` jakub at gcc dot gnu.org
2020-11-27 18:34 ` jakub at gcc dot gnu.org
2020-11-30  9:57 ` cvs-commit at gcc dot gnu.org
2020-12-01 15:25 ` cvs-commit at gcc dot gnu.org [this message]
2020-12-02 10:41 ` cvs-commit at gcc dot gnu.org
2020-12-02 13:36 ` jakub at gcc dot gnu.org
2020-12-03 19:55 ` tkoenig at gcc dot gnu.org
2021-08-15 11:24 ` pinskia at gcc dot gnu.org

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=bug-97459-4-qLoIWoqw3P@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.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).