public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "crazylht at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/55583] Extended shift instruction on x86-64 is not used,  producing unoptimal code
Date: Mon, 30 May 2022 02:23:14 +0000	[thread overview]
Message-ID: <bug-55583-4-SgADP83JUH@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-55583-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #7 from Hongtao.liu <crazylht at gmail dot com> ---
i386 already has

12980(define_insn_and_split "*x86_shrd_2"
12981  [(set (match_operand:SI 0 "nonimmediate_operand")
12982        (ior:SI (lshiftrt:SI (match_dup 0)
12983                             (match_operand:QI 2 "nonmemory_operand"))
12984                (ashift:SI (match_operand:SI 1 "register_operand")
12985                           (minus:QI (const_int 32) (match_dup 2)))))

It need to be extended(or has new pre_reload splitters) to handle
1. op2 is constant, so minus is not necessary here.
2. swap op2 and (minus:QI (const_int 32) (match_dup 2) between lshiftrt and
ashift.
3. match_dup 0 is too restrict, we can have a extra emit_move_insn to set DEST.

  parent reply	other threads:[~2022-05-30  2:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-04  0:06 [Bug rtl-optimization/55583] New: " mtkilpailut at torni dot org
2012-12-04  0:08 ` [Bug rtl-optimization/55583] " mtkilpailut at torni dot org
2012-12-04  0:21 ` hjl.tools at gmail dot com
2012-12-04  1:04 ` mikko.markus.torni at iki dot fi
2012-12-04 10:16 ` [Bug target/55583] " glisse at gcc dot gnu.org
2013-04-01 13:45 ` glisse at gcc dot gnu.org
2014-06-07  9:12 ` glisse at gcc dot gnu.org
2022-05-30  2:23 ` crazylht at gmail dot com [this message]
2022-11-01  3:24 ` cvs-commit 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-55583-4-SgADP83JUH@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).