From: "H.J. Lu" <hjl.tools@gmail.com>
To: Segher Boessenkool <segher@kernel.crashing.org>
Cc: gcc-patches@gcc.gnu.org, Uros Bizjak <ubizjak@gmail.com>
Subject: Re: [PATCH] x86: Replace ne:CCC/ne:CCO with UNSPEC_CC_NE in neg patterns
Date: Fri, 28 Oct 2022 15:28:16 -0700 [thread overview]
Message-ID: <CAMe9rOq9HyTv6WsJoXHyw859xJvABZWQmvdTQ_dYjZJX_b-YFQ@mail.gmail.com> (raw)
In-Reply-To: <20221028213249.GG25951@gate.crashing.org>
On Fri, Oct 28, 2022 at 2:34 PM Segher Boessenkool
<segher@kernel.crashing.org> wrote:
>
> On Wed, Oct 26, 2022 at 11:58:57AM -0700, H.J. Lu via Gcc-patches wrote:
> > In i386.md, neg patterns which set MODE_CC register like
> >
> > (set (reg:CCC FLAGS_REG)
> > (ne:CCC (match_operand:SWI48 1 "general_reg_operand") (const_int 0)))
> >
> > can lead to errors when operand 1 is a constant value. If FLAGS_REG in
>
> But it cannot be. general_reg_operand will not allow that:
> ===
> (define_predicate "general_reg_operand"
> (and (match_code "reg")
> (match_test "GENERAL_REGNO_P (REGNO (op))")))
> ===
>
> > (set (reg:CCC FLAGS_REG)
> > (ne:CCC (const_int 2) (const_int 0)))
> >
> > is set to 1, RTX simplifiers may simplify
>
Here is another example:
(define_insn "*neg<mode>_ccc_1"
[(set (reg:CCC FLAGS_REG)
(ne:CCC
(match_operand:SWI 1 "nonimmediate_operand" "0")
(const_int 0)))
(set (match_operand:SWI 0 "nonimmediate_operand" "=<r>m")
(neg:SWI (match_dup 1)))]
""
"neg{<imodesuffix>}\t%0"
[(set_attr "type" "negnot")
(set_attr "mode" "<MODE>")])
Operand 1 can be a known value.
H.J.
prev parent reply other threads:[~2022-10-28 22:28 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-26 18:58 H.J. Lu
2022-10-27 6:06 ` Uros Bizjak
2022-10-28 5:56 ` Hongtao Liu
2022-10-28 6:08 ` Hongtao Liu
2022-10-28 8:35 ` Eric Botcazou
2022-10-28 15:51 ` H.J. Lu
2022-10-28 17:58 ` Eric Botcazou
2022-10-28 21:43 ` Segher Boessenkool
2022-10-28 21:55 ` Eric Botcazou
2022-11-01 20:34 ` Segher Boessenkool
2022-11-01 21:28 ` Eric Botcazou
2022-10-28 21:32 ` Segher Boessenkool
2022-10-28 22:28 ` H.J. Lu [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=CAMe9rOq9HyTv6WsJoXHyw859xJvABZWQmvdTQ_dYjZJX_b-YFQ@mail.gmail.com \
--to=hjl.tools@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=segher@kernel.crashing.org \
--cc=ubizjak@gmail.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).