public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: "juzhe.zhong@rivai.ai" <juzhe.zhong@rivai.ai>
Cc: rguenther <rguenther@suse.de>, Robin Dapp <rdapp.gcc@gmail.com>,
	gcc-patches <gcc-patches@gcc.gnu.org>,
	"pan2.li" <pan2.li@intel.com>,
	"richard.sandiford" <richard.sandiford@arm.com>,
	Richard Biener <richard.guenther@gmail.com>,
	pinskia <pinskia@gmail.com>
Subject: Re: Re: [PATCH] fold-const: Handle AND, IOR, XOR with stepped vectors [PR112971].
Date: Tue, 19 Dec 2023 10:45:02 +0100	[thread overview]
Message-ID: <ZYFmHjUO6q2fmg/P@tucnak> (raw)
In-Reply-To: <6FD0A43E2F3E9BD9+202312191735136921653@rivai.ai>

On Tue, Dec 19, 2023 at 05:35:14PM +0800, juzhe.zhong@rivai.ai wrote:
> I wonder whether we can simplify the codes as follows :?
>       if (integer_zerop (arg1) || integer_zerop (arg2))
>         step_ok_p = (code == BIT_AND_EXPR || code == BIT_IOR_EXPR
>                      || code == BIT_XOR_EXPR);

What about integer_all_onesp (arg1) || integer_all_onesp (arg2) ?
(x & -1) == x
(x | -1) == -1
(x ^ -1) == ~x
even for the VL vectors, no?

	Jakub


  reply	other threads:[~2023-12-19  9:45 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-18 19:50 Robin Dapp
2023-12-18 22:49 ` 钟居哲
2023-12-19  8:15   ` Richard Biener
2023-12-19  8:54     ` juzhe.zhong
2023-12-19  9:12       ` Richard Biener
2023-12-19  9:35         ` juzhe.zhong
2023-12-19  9:45           ` Jakub Jelinek [this message]
2023-12-19  9:49             ` juzhe.zhong
2023-12-19  9:55               ` Jakub Jelinek
2023-12-19 10:11           ` Richard Biener
2023-12-19 10:40             ` Richard Sandiford
2023-12-19 10:58               ` juzhe.zhong
2023-12-20  2:04               ` Andrew Pinski
2023-12-20  2:07                 ` juzhe.zhong
2023-12-20  7:25                 ` Richard Biener
2023-12-20  9:33                   ` Richard Sandiford
2023-12-20 10:06                     ` Richard Biener
2024-01-15 15:23                 ` Robin Dapp
2024-01-16  7:17                   ` Richard Biener
2024-01-24 11:29                     ` Richard Sandiford

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=ZYFmHjUO6q2fmg/P@tucnak \
    --to=jakub@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=juzhe.zhong@rivai.ai \
    --cc=pan2.li@intel.com \
    --cc=pinskia@gmail.com \
    --cc=rdapp.gcc@gmail.com \
    --cc=rguenther@suse.de \
    --cc=richard.guenther@gmail.com \
    --cc=richard.sandiford@arm.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).