From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vs1-xe2a.google.com (mail-vs1-xe2a.google.com [IPv6:2607:f8b0:4864:20::e2a]) by sourceware.org (Postfix) with ESMTPS id CDC303858C66 for ; Wed, 6 Sep 2023 23:22:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CDC303858C66 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-vs1-xe2a.google.com with SMTP id ada2fe7eead31-44e8f9f3cceso154319137.1 for ; Wed, 06 Sep 2023 16:22:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694042567; x=1694647367; darn=gcc.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=pmGtQSJiLlObwGgpewEO7tU1BeK3Bs5TeOPRDfYWYqs=; b=niM6C3FOIV7gcnRxxD4BGis2+myMnrUePP9XQ7kFqL2ZqtrV+c2Rbx3jjZfOwrRZvh 5H4Md8SRhvF70uHLhebySSeKJkRKOY4iDlGoNLVmdsukWpwRtmCEV/y5nGbbC0sLe5Ka 4yrTpt9NtKmGJr07TohplNBex8Mt1xozMVb3rStI4xyEQO0bS7P2KUXmb8WkfIOwawJI 3UWb0JKqhwW+TDELjF9W1IBREg9q7c9q4tTtp2cw9a2uD+ksrnEaTa2nvS23k4m2TPS3 o4ZspLRzeYnXpxDFc/C7HT7uOr5Q7Us9aUzrpJlx+2J+KhCWIm7pcaESd+URJELA/n9B jc6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1694042567; x=1694647367; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=pmGtQSJiLlObwGgpewEO7tU1BeK3Bs5TeOPRDfYWYqs=; b=OKteEUo3ogNvmxDrThep4zlTqtZNwM20zLKLLEY5JQOe2hZ6DwxzOouGpG9pf1lzGe 1YKt72LUqjd85LVEmXSuXjazQzkh1+QoBur4+Qen06SVdSVe9CMeIAP3WudvMCPTEsm9 s2DRtxCWyNOrreOs+pJH2/5F3sO8bOD5FQWvrDHhyc7BbMCgYxCzeWE2/URx6aNqz16X slzq1E5tDlSiLuLWg3ekaCgX9aNE/blPeS4SA4wGIsz+wluv0O5GpuBzxtmNZH+Mhi37 OaCRJJfqxVQClf2cwVyMSD8bDUi34rqQQrcTFmIKIhjwXWP7/JnfUWq/nFqdI1SHTaJy WEbw== X-Gm-Message-State: AOJu0YwU5dxkfRqPdSNttkrWNWMM98cfsAiu9HG9mSImQzVn6UzXMJMm VDMDQRnT3OlmleshwKfhWa7FcuLlSeFVCo/TBu4LDuSMr40= X-Google-Smtp-Source: AGHT+IEmGlIFMy9/SaYWak6LuYiOwzf9JT0X8YaC1Emi7hVw3KFJLOJlqbJi2eQwQpyK2bL032bPL3goRTSzrG57UOc= X-Received: by 2002:a67:f4c2:0:b0:44e:9d4f:1ffb with SMTP id s2-20020a67f4c2000000b0044e9d4f1ffbmr4319373vsn.11.1694042566681; Wed, 06 Sep 2023 16:22:46 -0700 (PDT) MIME-Version: 1.0 References: <20230906175025.935887-1-ewlu@rivosinc.com> <20230906175025.935887-4-ewlu@rivosinc.com> In-Reply-To: <20230906175025.935887-4-ewlu@rivosinc.com> From: Kito Cheng Date: Thu, 7 Sep 2023 07:22:35 +0800 Message-ID: Subject: Re: [PATCH 3/5] RISC-V: Add Types to Un-Typed Zicond Instructions To: Edwin Lu Cc: GCC Patches , gnu-toolchain@rivosinc.com Content-Type: multipart/alternative; boundary="0000000000006be8960604b9052f" X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --0000000000006be8960604b9052f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable LGTM Edwin Lu =E6=96=BC 2023=E5=B9=B49=E6=9C=887=E6=97=A5 = =E9=80=B1=E5=9B=9B 01:53 =E5=AF=AB=E9=81=93=EF=BC=9A > 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 > --- > 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,bitmani= p, > 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,vlseg= dff, > 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.." > (const_int 0)))] > "TARGET_ZICOND" > "czero.\t%0,%2,%1" > -) > +[(set_attr "type" "zicond")]) > > (define_insn "*czero.." > [(set (match_operand:GPR 0 "register_operand" "=3D= r") > @@ -40,7 +40,7 @@ (define_insn "*czero.." > (match_operand:GPR 2 "register_operand" > "r")))] > "TARGET_ZICOND" > "czero.\t%0,%2,%1" > -) > +[(set_attr "type" "zicond")]) > > ;; Special optimization under eq/ne in primitive semantics > (define_insn "*czero.eqz..opt1" > @@ -51,7 +51,7 @@ (define_insn "*czero.eqz..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..opt2" > [(set (match_operand:GPR 0 "register_operand" "=3Dr") > @@ -61,7 +61,7 @@ (define_insn "*czero.nez..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. > -- > 2.34.1 > > --0000000000006be8960604b9052f--