public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <jeffreyalaw@gmail.com>
To: "demin.han" <demin.han@starfivetech.com>, gcc-patches@gcc.gnu.org
Cc: juzhe.zhong@rivai.ai, kito.cheng@gmail.com, pan2.li@intel.com,
	rdapp.gcc@gmail.com
Subject: Re: [PATCH v2] RISC-V: Remove float vector eqne pattern
Date: Wed, 19 Jun 2024 08:33:00 -0600	[thread overview]
Message-ID: <ea16adee-ffde-45da-9fb7-ea87b5139994@gmail.com> (raw)
In-Reply-To: <20240619123042.1972514-1-demin.han@starfivetech.com>



On 6/19/24 6:30 AM, demin.han wrote:
> We can unify eqne and other comparison operations.
> 
> Tested on RV32 and RV64
> 
> gcc/ChangeLog:
> 
> 	* config/riscv/riscv-vector-builtins-bases.cc: Remove eqne cond
> 	* config/riscv/vector.md (@pred_eqne<mode>_scalar): Remove patterns
> 	(*pred_eqne<mode>_scalar_merge_tie_mask): Ditto
> 	(*pred_eqne<mode>_scalar): Ditto
> 	(*pred_eqne<mode>_scalar_narrow): Ditto
> 
> gcc/testsuite/ChangeLog:
> 
> 	* gcc.target/riscv/rvv/base/float-point-cmp-eqne.c: New test.
> 
> Signed-off-by: demin.han <demin.han@starfivetech.com>
> ---
> 
> v2 changes:
>    1. add test
> 
>    Only intrinsics utilize those removed vf patterns.
>    Auto vectorization use vv format now.
>    The NaN will optimized out before expand in autovec as I tested.
> 
>   .../riscv/riscv-vector-builtins-bases.cc      |  4 -
>   gcc/config/riscv/vector.md                    | 86 -------------------
>   .../riscv/rvv/base/float-point-cmp-eqne.c     | 54 ++++++++++++
>   3 files changed, 54 insertions(+), 90 deletions(-)
>   create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/float-point-cmp-eqne.c
> 
> diff --git a/gcc/config/riscv/riscv-vector-builtins-bases.cc b/gcc/config/riscv/riscv-vector-builtins-bases.cc
> index b6f6e4ff37e..d414721ede8 100644
> --- a/gcc/config/riscv/riscv-vector-builtins-bases.cc
> +++ b/gcc/config/riscv/riscv-vector-builtins-bases.cc
> @@ -1420,10 +1420,6 @@ public:
>       switch (e.op_info->op)
>         {
>   	case OP_TYPE_vf: {
> -	  if (CODE == EQ || CODE == NE)
> -	    return e.use_compare_insn (CODE, code_for_pred_eqne_scalar (
> -					       e.vector_mode ()));
> -	  else
>   	    return e.use_compare_insn (CODE, code_for_pred_cmp_scalar (
>   					       e.vector_mode ()));
Formatting nit.  You removed the IF-THEN-ELSE construct, leaving just 
the ELSE's body.  You need to reindent that body, both lines of which 
would move left by two spaces.

I'll fix and push it momentarily.

jeff

  parent reply	other threads:[~2024-06-19 14:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-19 12:30 demin.han
2024-06-19 14:30 ` Robin Dapp
2024-06-19 14:33 ` Jeff Law [this message]
2024-06-20  1:17   ` Demin Han
2024-06-19 13:26 =?gb18030?B?1tO+09Xc?=

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=ea16adee-ffde-45da-9fb7-ea87b5139994@gmail.com \
    --to=jeffreyalaw@gmail.com \
    --cc=demin.han@starfivetech.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=juzhe.zhong@rivai.ai \
    --cc=kito.cheng@gmail.com \
    --cc=pan2.li@intel.com \
    --cc=rdapp.gcc@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).