public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "ubizjak at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/85730] complex code for modifying lowest byte in a 4-byte vector
Date: Mon, 04 Oct 2021 11:31:32 +0000	[thread overview]
Message-ID: <bug-85730-4-tlegX2HxUi@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-85730-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #6 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to Richard Biener from comment #5)
> The GIMPLE IL is now using BIT_INSERT_EXPRs consistently for all cases and
> combine does
> 
> Trying 8 -> 11:
>     8: {r90:SI=r89:SI<<0x1;clobber flags:CC;}
>       REG_DEAD r89:SI
>       REG_UNUSED flags:CC
>    11: strict_low_part(r92:V4QI#0)=r90:SI#0
>       REG_DEAD r90:SI
> Failed to match this instruction:
> (set (strict_low_part (subreg:QI (reg:V4QI 92 [ v ]) 0))
>     (ashift:QI (subreg:QI (reg:SI 89 [ v ]) 0)
>         (const_int 1 [0x1])))
> 
> where it fails to try (add:QI (subreg...) (subreg...)) instead of the shift
> by 1.
> 
> Not sure whether targets should have a special-case pattern here or whether
> that's for combine to un-canonicalize it?

We do have this pattern in i386.md, but please see the FIXME:

(define_insn "*ashl<mode>3_1_slp"
  [(set (strict_low_part (match_operand:SWI12 0 "register_operand" "+<r>"))
        (ashift:SWI12 (match_operand:SWI12 1 "register_operand" "0")
                      (match_operand:QI 2 "nonmemory_operand" "cI")))
   (clobber (reg:CC FLAGS_REG))]
  "(!TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))
   /* FIXME: without this LRA can't reload this pattern, see PR82524.  */
   && rtx_equal_p (operands[0], operands[1])"

  parent reply	other threads:[~2021-10-04 11:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-85730-4@http.gcc.gnu.org/bugzilla/>
2021-10-04  3:02 ` gabravier at gmail dot com
2021-10-04  8:47 ` zsojka at seznam dot cz
2021-10-04  9:04 ` gabravier at gmail dot com
2021-10-04  9:54 ` rguenth at gcc dot gnu.org
2021-10-04 11:31 ` ubizjak at gmail dot com [this message]
2021-10-04 16:13 ` segher at gcc dot gnu.org
2021-10-07 11:51 ` ubizjak at gmail dot com
2021-10-08  9:36 ` ubizjak at gmail dot com
2021-10-12 16:21 ` 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-85730-4-tlegX2HxUi@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).