public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Tsukasa OI <research_trasio@irq.a4lg.com>
To: Edwin Lu <ewlu@rivosinc.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH 3/5] RISC-V: Add Types to Un-Typed Zicond Instructions
Date: Thu, 7 Sep 2023 09:42:31 +0900	[thread overview]
Message-ID: <089f99be-332f-482e-80d3-cfca2c27c676@irq.a4lg.com> (raw)
In-Reply-To: <20230906175025.935887-4-ewlu@rivosinc.com>

On 2023/09/07 2:50, Edwin Lu wrote:
> This patch creates a new "zicond" type and updates all zicond instructions
> with that type.
> 
> gcc/ChangeLog:
> 
> 	* config/riscv/riscv.md: Add "zicond" type
> 	* config/riscv/zicond.md: Update types
> 
> Signed-off-by: Edwin Lu <ewlu@rivosinc.com>
> ---
>  gcc/config/riscv/riscv.md  | 5 +++--
>  gcc/config/riscv/zicond.md | 8 ++++----
>  2 files changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/gcc/config/riscv/riscv.md b/gcc/config/riscv/riscv.md
> index 6684ad89cff..c329f55db43 100644
> --- a/gcc/config/riscv/riscv.md
> +++ b/gcc/config/riscv/riscv.md
> @@ -313,6 +313,7 @@ (define_attr "ext_enabled" "no,yes"
>  ;; cbo    cache block instructions
>  ;; crypto cryptography instructions
>  ;; csr    code size reduction instructions
> +;; zicond    zicond instructions
>  ;; Classification of RVV instructions which will be added to each RVV .md pattern and used by scheduler.
>  ;; rdvlenb     vector byte length vlenb csrr read
>  ;; rdvl        vector length vl csrr read
> @@ -422,8 +423,8 @@ (define_attr "type"
>     mtc,mfc,const,arith,logical,shift,slt,imul,idiv,move,fmove,fadd,fmul,
>     fmadd,fdiv,fcmp,fcvt,fsqrt,multi,auipc,sfb_alu,nop,trap,ghost,bitmanip,
>     rotate,clmul,min,max,minu,maxu,clz,ctz,cpop,
> -   atomic,condmove,cbo,crypto,csr,rdvlenb,rdvl,wrvxrm,wrfrm,rdfrm,vsetvl,
> -   vlde,vste,vldm,vstm,vlds,vsts,
> +   atomic,condmove,cbo,crypto,csr,zicond,rdvlenb,rdvl,wrvxrm,wrfrm,rdfrm,
> +   vsetvl, vlde,vste,vldm,vstm,vlds,vsts,
>     vldux,vldox,vstux,vstox,vldff,vldr,vstr,
>     vlsegde,vssegte,vlsegds,vssegts,vlsegdux,vlsegdox,vssegtux,vssegtox,vlsegdff,
>     vialu,viwalu,vext,vicalu,vshift,vnshift,vicmp,viminmax,
> diff --git a/gcc/config/riscv/zicond.md b/gcc/config/riscv/zicond.md
> index 1721e1011ea..0269bd14399 100644
> --- a/gcc/config/riscv/zicond.md
> +++ b/gcc/config/riscv/zicond.md
> @@ -30,7 +30,7 @@ (define_insn "*czero.<eqz>.<GPR:mode><X:mode>"
>                            (const_int 0)))]
>    "TARGET_ZICOND"
>    "czero.<eqz>\t%0,%2,%1"
> -)
> +[(set_attr "type" "zicond")])
>  
>  (define_insn "*czero.<nez>.<GPR:mode><X:mode>"
>    [(set (match_operand:GPR 0 "register_operand"                     "=r")
> @@ -40,7 +40,7 @@ (define_insn "*czero.<nez>.<GPR:mode><X:mode>"
>                            (match_operand:GPR 2 "register_operand"   "r")))]
>    "TARGET_ZICOND"
>    "czero.<nez>\t%0,%2,%1"
> -)
> +[(set_attr "type" "zicond")])
>  
>  ;; Special optimization under eq/ne in primitive semantics
>  (define_insn "*czero.eqz.<GPR:mode><X:mode>.opt1"
> @@ -51,7 +51,7 @@ (define_insn "*czero.eqz.<GPR:mode><X:mode>.opt1"
>                            (match_operand:GPR 3 "register_operand" "r")))]
>    "TARGET_ZICOND && rtx_equal_p (operands[1], operands[2])"
>    "czero.eqz\t%0,%3,%1"
> -)
> +[(set_attr "type" "zicond")])
>  
>  (define_insn "*czero.nez.<GPR:mode><X:mode>.opt2"
>    [(set (match_operand:GPR 0 "register_operand"                   "=r")
> @@ -61,7 +61,7 @@ (define_insn "*czero.nez.<GPR:mode><X:mode>.opt2"
>                            (match_operand:GPR 3 "register_operand" "1")))]
>    "TARGET_ZICOND && rtx_equal_p (operands[1], operands[3])"
>    "czero.eqz\t%0,%2,%1"
> -)
> +[(set_attr "type" "zicond")])
>  
>  ;; Combine creates this form in some cases (particularly the coremark
>  ;; CRC loop.

Looks okay to me but will need to resolve merge conflicts after commit
af88776caa20 ("RISC-V: Add support for 'XVentanaCondOps' reusing
'Zicond' support").

Thanks,
Tsukasa

  parent reply	other threads:[~2023-09-07  0:42 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-06 17:50 [PATCH 0/5] RISC-V: Add Types to Untyped Instructions Edwin Lu
2023-09-06 17:50 ` [PATCH 1/5] RISC-V: Update Types for Vector Instructions Edwin Lu
2023-09-06 23:23   ` Kito Cheng
2023-09-07 17:26     ` Edwin Lu
2023-09-06 17:50 ` [PATCH 2/5] RISC-V: Add Types for Un-Typed zc Instructions Edwin Lu
2023-09-06 23:33   ` Kito Cheng
2023-09-07 17:29     ` Edwin Lu
2023-09-06 17:50 ` [PATCH 3/5] RISC-V: Add Types to Un-Typed Zicond Instructions Edwin Lu
2023-09-06 23:22   ` Kito Cheng
2023-09-07  0:42   ` Tsukasa OI [this message]
2023-09-07 13:17     ` Jeff Law
2023-09-11 17:48       ` [PATCH 3/5][Committed] " Edwin Lu
2023-09-11 17:48         ` Edwin Lu
2023-09-06 17:50 ` [PATCH 4/5] RISC-V: Update Types for RISC-V Instructions Edwin Lu
2023-09-06 23:23   ` Kito Cheng
2023-09-11 17:48     ` [PATCH 4/5][Committed] " Edwin Lu
2023-09-11 17:48       ` Edwin Lu
2023-09-06 17:50 ` [PATCH 5/5] RISC-V: Remove Assert Protecting Types Edwin Lu
2023-09-07 13:19   ` Jeff Law
2023-09-07 17:31     ` Edwin Lu

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=089f99be-332f-482e-80d3-cfca2c27c676@irq.a4lg.com \
    --to=research_trasio@irq.a4lg.com \
    --cc=ewlu@rivosinc.com \
    --cc=gcc-patches@gcc.gnu.org \
    /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).