public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: YunQiang Su <wzssyqa@gmail.com>
To: Richard Biener <rguenther@suse.de>
Cc: Eric Botcazou <botcazou@adacore.com>,
	gcc-patches@gcc.gnu.org,  YunQiang Su <yunqiang.su@cipunited.com>,
	pinskia@gmail.com, jeffreyalaw@gmail.com,  ian@airs.com
Subject: Re: [PATCH v2] Store_bit_field_1: Use SUBREG instead of REG if possible
Date: Fri, 22 Dec 2023 12:45:29 +0800	[thread overview]
Message-ID: <CAKcpw6XRLxVFOh2-RpiFhvb5RrkheRGkuu5OJ=c-139H3ntGVQ@mail.gmail.com> (raw)
In-Reply-To: <nycvar.YFH.7.77.849.2307191023090.12935@jbgna.fhfr.qr>

>
> Note I think Andrews comment#7 in the PR is spot-on then, the issue
> isn't the bitfield inserts but the compare where combine elides
> the sign_extend in favor of a subreg.  That's likely some wrongdoing
> in simplify-rtx in the context of WORD_REGISTER_OPERATIONS.
>

Yes. There are 2 problems here. Any one of them can make this problem.
1) jump_insn eats sign_extend (and truncate) in
      /* Simplify X, an IF_THEN_ELSE expression.  Return the new expression.  */
      static rtx simplify_if_then_else (rtx x)

2) MIPS claims sign_extend to be deleted.
(define_insn_and_split "extendsidi2"
  [(set (match_operand:DI 0 "register_operand" "=d,l,d")
        (sign_extend:DI (match_operand:SI 1 "nonimmediate_operand" "0,0,m")))]
  "TARGET_64BIT"
  "@
   #
   #
   lw\t%0,%1"
  "&& reload_completed && register_operand (operands[1], VOIDmode)"
  [(const_int 0)]
{
  emit_note (NOTE_INSN_DELETED);
  DONE;
}
  [(set_attr "move_type" "move,move,load")
   (set_attr "mode" "DI")])

-- 
YunQiang Su

      parent reply	other threads:[~2023-12-22  4:45 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-19  4:16 YunQiang Su
2023-07-19  6:26 ` Richard Biener
2023-07-19  6:58   ` YunQiang Su
2023-07-19  7:22     ` Richard Biener
2023-07-19  8:21       ` YunQiang Su
2023-07-19  8:25         ` YunQiang Su
2023-07-19  8:50           ` YunQiang Su
2023-07-19  9:23         ` Richard Biener
2023-07-19  9:27           ` Richard Biener
2023-07-19  9:43           ` YunQiang Su
2023-07-19  9:45           ` Eric Botcazou
2023-07-19 10:12             ` YunQiang Su
2023-07-19 10:25               ` Richard Biener
2023-07-19 12:22                 ` Jeff Law
2023-07-20  7:09                   ` Richard Sandiford
2023-07-20  7:23                     ` Richard Biener
2023-07-20  9:22                       ` Richard Sandiford
2023-12-22  6:11                     ` YunQiang Su
2023-12-22  4:45                 ` YunQiang Su [this message]

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='CAKcpw6XRLxVFOh2-RpiFhvb5RrkheRGkuu5OJ=c-139H3ntGVQ@mail.gmail.com' \
    --to=wzssyqa@gmail.com \
    --cc=botcazou@adacore.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=ian@airs.com \
    --cc=jeffreyalaw@gmail.com \
    --cc=pinskia@gmail.com \
    --cc=rguenther@suse.de \
    --cc=yunqiang.su@cipunited.com \
    /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).