public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Robin Dapp <rdapp.gcc@gmail.com>
To: "Demin Han" <demin.han@starfivetech.com>,
	钟居哲 <juzhe.zhong@rivai.ai>, gcc-patches <gcc-patches@gcc.gnu.org>
Cc: rdapp.gcc@gmail.com, "kito.cheng" <kito.cheng@gmail.com>,
	"Li, Pan2" <pan2.li@intel.com>,
	jeffreyalaw <jeffreyalaw@gmail.com>
Subject: Re: [PATCH 1/5] RISC-V: Remove float vector eqne pattern
Date: Fri, 1 Mar 2024 15:53:12 +0100	[thread overview]
Message-ID: <06644d87-ccfa-42c3-a971-69e84f44c270@gmail.com> (raw)
In-Reply-To: <ZQ0PR01MB106301CB0C0CC832A4B844FF855EA@ZQ0PR01MB1063.CHNPR01.prod.partner.outlook.cn>

> 2.      When I write if (a == 2) and if (2 == a), the results are
> same
> 
> 3.      The vec_duplicate operand  is the 5th operand in both cmp and
> eqne patterns. I think they are equal.

A comparison with a constant is always canonicalized to have the
constant second, that's why you won't see a difference.
A vector constant follows the same rule because
swap_commutative_operands_p will place it second.

I'm not sure whether we need the vec_duplicate first, honestly.
I don't remember a canonicalization rule that puts it there.
We do have something for constants and vec_merge.  As long as
things come from expand I think a constant will always be
second and this patch removes the patterns where the duplicate
is first.

Generally with fast math we could invert the condition so
a comparison should be "commutative".  With NaNs I think we
also allow it if the unordered comparisons are supported.
But I'm not even certain that we try something like that with
vectors.  On the other hand - as there is no canonical order
nothing would prevent it from being first in the future?

Will need to think about it some more (and try with NaNs) but
we could give try removing the patterns with GCC15 I suppose.

The rest should still be handled in a more generic fashion.

Regards
 Robin


  reply	other threads:[~2024-03-01 14:53 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-01  6:27 [PATCH 0/5] RISC-V: Support vf and vx for autovec comparison of demin.han
2024-03-01  6:27 ` [PATCH 1/5] RISC-V: Remove float vector eqne pattern demin.han
2024-03-01  7:23   ` 钟居哲
2024-03-01  8:12     ` Demin Han
2024-03-01 14:53       ` Robin Dapp [this message]
2024-05-15 19:48         ` [PATCH " Robin Dapp
2024-05-16  1:54           ` Demin Han
2024-05-16 19:21             ` Robin Dapp
2024-06-08 20:48               ` Jeff Law
2024-06-10  7:33                 ` Robin Dapp
2024-06-10 13:49                   ` Jeff Law
2024-06-10 14:52                     ` Li, Pan2
2024-06-10 16:30                       ` Jeff Law
2024-06-10 16:16                     ` Demin Han
2024-06-10 16:23                       ` Jeff Law
2024-06-08 20:51       ` Jeff Law
2024-06-08 20:50   ` Jeff Law
2024-03-01  6:27 ` [PATCH 2/5] RISC-V: Refactor expand_vec_cmp demin.han
2024-03-01  7:32   ` 钟居哲
2024-03-01  6:27 ` [PATCH 3/5] RISC-V: Support vmfxx.vf for autovec comparison of vec and imm demin.han
2024-03-01  7:48   ` 钟居哲
2024-03-01  8:26     ` Demin Han
2024-03-05  8:40     ` Demin Han
2024-03-05  9:02       ` juzhe.zhong
2024-03-05 10:40         ` Demin Han
2024-03-01  6:27 ` [PATCH 4/5] RISC-V: Remove integer vector eqne pattern demin.han
2024-03-01  7:37   ` 钟居哲
2024-03-01  6:27 ` [PATCH 5/5] RISC-V: Support vmsxx.vx for autovec comparison of vec and imm demin.han
2024-03-01  7:50   ` 钟居哲
2024-03-01 12:07     ` [PATCH " Robin Dapp
2024-03-02  0:24       ` Andrew Waterman
2024-03-01  6:50 ` [PATCH 0/5] RISC-V: Support vf and vx for autovec comparison of Demin Han
2024-05-16  2:01 [PATCH 1/5] RISC-V: Remove float vector eqne pattern =?gb18030?B?1tO+09Xc?=
2024-05-16  2:17 ` Demin Han

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=06644d87-ccfa-42c3-a971-69e84f44c270@gmail.com \
    --to=rdapp.gcc@gmail.com \
    --cc=demin.han@starfivetech.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jeffreyalaw@gmail.com \
    --cc=juzhe.zhong@rivai.ai \
    --cc=kito.cheng@gmail.com \
    --cc=pan2.li@intel.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).