public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/91681] Missed optimization for 128 bit arithmetic operations
Date: Mon, 27 Dec 2021 07:29:05 +0000	[thread overview]
Message-ID: <bug-91681-4-jfl3C0fJhV@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-91681-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
GCC 11 is better (note the widen multiply is still not detected):
        movq    %rdx, %rax
        movq    %rdi, %r9
        movq    %rdx, %rdi
        mulq    %rsi
        movq    %rdx, %rax
        xorl    %edx, %edx
        movq    %rax, %r10
        movq    %rdi, %rax
        movq    %rdx, %r11
        mulq    %r9
        addq    %rax, %r10
        movq    %rsi, %rax
        adcq    %rdx, %r11
        mulq    %rcx
        movq    %rcx, %rax
        xorl    %edi, %edi
        movq    %r10, (%r8)
        movq    %r11, 8(%r8)
        movq    %rdx, %rsi
        mulq    %r9
        addq    %rax, %rsi
        adcq    %rdx, %rdi
        movq    %rsi, 16(%r8)
        movq    %rdi, 24(%r8)
        ret

Still 2 more instructions than LLVM but at least no longer using the stack.

       reply	other threads:[~2021-12-27  7:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-91681-4@http.gcc.gnu.org/bugzilla/>
2021-12-27  7:29 ` pinskia at gcc dot gnu.org [this message]
2022-07-25 16:37 ` cvs-commit at gcc dot gnu.org
2023-07-07 20:00 ` roger at nextmovesoftware dot com
2023-07-12 13:14 ` cvs-commit at gcc dot gnu.org
2023-07-12 13:46 ` cvs-commit at gcc dot gnu.org
2024-01-21 23:31 ` roger at nextmovesoftware dot com

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-91681-4-jfl3C0fJhV@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).