From: "juzhe.zhong@rivai.ai" <juzhe.zhong@rivai.ai>
To: jakub <jakub@redhat.com>
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 17:49:48 +0800 [thread overview]
Message-ID: <9D6DD5FAB9816EB2+202312191749474308727@rivai.ai> (raw)
In-Reply-To: <ZYFmHjUO6q2fmg/P@tucnak>
[-- Attachment #1: Type: text/plain, Size: 1108 bytes --]
>> (x & -1) == x
>>(x | -1) == -1
>>(x ^ -1) == ~x
Looks reasonable to me.
Do you mean modify the code as follows ?
if (integer_zerop (arg1) || integer_zerop (arg2)) || integer_onep (arg1) || integer_onep(arg2))
step_ok_p = (code == BIT_AND_EXPR || code == BIT_IOR_EXPR
|| code == BIT_XOR_EXPR);
juzhe.zhong@rivai.ai
From: Jakub Jelinek
Date: 2023-12-19 17:45
To: juzhe.zhong@rivai.ai
CC: rguenther; Robin Dapp; gcc-patches; pan2.li; richard.sandiford; Richard Biener; pinskia
Subject: Re: Re: [PATCH] fold-const: Handle AND, IOR, XOR with stepped vectors [PR112971].
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
next prev parent reply other threads:[~2023-12-19 9:50 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
2023-12-19 9:49 ` juzhe.zhong [this message]
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=9D6DD5FAB9816EB2+202312191749474308727@rivai.ai \
--to=juzhe.zhong@rivai.ai \
--cc=gcc-patches@gcc.gnu.org \
--cc=jakub@redhat.com \
--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).