public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/110551] New: [11 / 12 / 13 /14 regression] Suboptimal codegen for 128 bits multiplication on x86_64
@ 2023-07-04 17:26 moncef.mechri at gmail dot com
  2023-07-04 17:32 ` [Bug target/110551] [11/12/13/14 " pinskia at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: moncef.mechri at gmail dot com @ 2023-07-04 17:26 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 110551
           Summary: [11 / 12 / 13 /14 regression] Suboptimal codegen for
                    128 bits multiplication on x86_64
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: moncef.mechri at gmail dot com
  Target Milestone: ---

https://godbolt.org/z/3hdondY6n

Codegen for the code shared above (which is a mixing step in boost.Unordered
when a non-avalanching hash function is being used [1] ) regressed since GCC
11. I believe there are 2 regressions:

Regression 1:

A redundant move is introduced:


        movabs  rcx, -7046029254386353131
        mov     rax, rcx


The regression seems to be present at all optimization levels above -O0
(including -Os and -Og).

Possibly a duplicate of https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94804


Regression 2

When using -march=haswell or newer, GCC >= 11 emits mulx. The resulting code is
longer (by 1 instruction) with no clear benefit to my untrained eyes. It looks
to me like the code generated by GCC 10 is optimal, even for haswell and newer.


I am reporting both issues in the same bug report because they seem related
enough. Let me know if you want me to split them into 2 bug reports instead.

[1]
https://github.com/boostorg/unordered/blob/9a7d1d336aaa73ad8e5f7c07bdb81b2e793f8d93/include/boost/unordered/detail/mulx.hpp#L111

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2023-11-12 15:48 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-04 17:26 [Bug rtl-optimization/110551] New: [11 / 12 / 13 /14 regression] Suboptimal codegen for 128 bits multiplication on x86_64 moncef.mechri at gmail dot com
2023-07-04 17:32 ` [Bug target/110551] [11/12/13/14 " pinskia at gcc dot gnu.org
2023-07-04 17:47 ` [Bug target/110551] [11/12/13/14 Regression] an extra mov when doing 128bit multiply pinskia at gcc dot gnu.org
2023-07-04 18:12 ` moncef.mechri at gmail dot com
2023-07-05  7:06 ` rguenth at gcc dot gnu.org
2023-10-18 19:11 ` roger at nextmovesoftware dot com
2023-10-27  9:05 ` cvs-commit at gcc dot gnu.org
2023-10-29 18:01 ` moncef.mechri at gmail dot com
2023-11-01 10:06 ` ubizjak at gmail dot com
2023-11-01 22:35 ` cvs-commit at gcc dot gnu.org
2023-11-06 19:24 ` moncef.mechri at gmail dot com
2023-11-12 15:48 ` [Bug target/110551] [11/12/13 " roger at nextmovesoftware dot com

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).