From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by sourceware.org (Postfix) with ESMTPS id 6A1F13858D32 for ; Mon, 22 Aug 2022 09:09:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6A1F13858D32 Received: by mail-ej1-x62f.google.com with SMTP id vw19so6185929ejb.1 for ; Mon, 22 Aug 2022 02:09:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=xulhmRRvvYkhKM2POtiaSDs8OwW3t+ZK/oO4+KnYTG8=; b=gFaWKqBoVQ794Vxnl5DFOb5ZKHoxLDJvgLyVLIjTDbehu8SuhOMUUx0aslg0DYejsW inEdG0cF60AUPOtWYg27jYzQzqPeGv7a4076Y03vl+keXt1t292NEVyM+SCnBQEsA2sO /lhg//o/u3I+/4XT1kgHV6Lvx7fW7dqZLcXwV8LeiK5sCWJJM0QjULVhl0+Nog5ZVDBG H7vbHJGvCiOKQSzmv4rNmYNVjPqD8tdcwaXH6M+TLrKs/fGQuBtYhT8VB9NSMgI9/t6b Y+CwoAINiz5T0ej/Tms1shMkWl5HqAk45aSGwDuba7kXqUOhM/tEtytWmVfQI5GzZNEs U2Fw== X-Gm-Message-State: ACgBeo0IFuGBefaJZ1RXkWIflSw3GAEo4kC+rOBreOdlC+3IGhuf5u9d h1kl2OI859D3UH6SDq83tOfvG2v/2HdESbAmjF4= X-Google-Smtp-Source: AA6agR4vk1i76uIHzEWhpiyTuoIRcpFl5ZfFjfQ5HZa557WGSkO0IzY5D5NyCn+UqEs01OcQ+ezqR6lqWQKJ0gYgjBg= X-Received: by 2002:a17:906:ef90:b0:730:9cd8:56d7 with SMTP id ze16-20020a170906ef9000b007309cd856d7mr11476358ejb.94.1661159375977; Mon, 22 Aug 2022 02:09:35 -0700 (PDT) MIME-Version: 1.0 References: <1660860233-11175-1-git-send-email-apinski@marvell.com> <1660860233-11175-11-git-send-email-apinski@marvell.com> In-Reply-To: <1660860233-11175-11-git-send-email-apinski@marvell.com> From: Kito Cheng Date: Mon, 22 Aug 2022 17:09:24 +0800 Message-ID: Subject: Re: [PATCH 10/10] [RISCV] Fix PR 106632 and PR 106588 a few constraints in bitmanip.md To: apinski@marvell.com Cc: GCC Patches Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, MEDICAL_SUBJECT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2022 09:09:39 -0000 On Fri, Aug 19, 2022 at 6:08 AM apinski--- via Gcc-patches wrote: > > From: Andrew Pinski > > The constraints should be n instead of i. Also there > needs to a check for out of bounds zero_extract for > *bexti. > > gcc/ChangeLog: > > PR target/106632 > PR target/106588 > * config/riscv/bitmanip.md (*shNadduw): Use n constraint > instead of i. > (*slliuw): Likewise. > (*bexti): Likewise. Also add a check for operands[2] to be less > than the mode bitsize. > --- > gcc/config/riscv/bitmanip.md | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/gcc/config/riscv/bitmanip.md b/gcc/config/riscv/bitmanip.md > index 026299d6703..ecf5b51b533 100644 > --- a/gcc/config/riscv/bitmanip.md > +++ b/gcc/config/riscv/bitmanip.md > @@ -44,7 +44,7 @@ (define_insn "*shNadduw" > (plus:DI > (and:DI (ashift:DI (match_operand:DI 1 "register_operand" "r") > (match_operand:QI 2 "imm123_operand" "Ds3")) > - (match_operand 3 "immediate_operand" "")) > + (match_operand 3 "immediate_operand" "n")) > (match_operand:DI 4 "register_operand" "r")))] > "TARGET_64BIT && TARGET_ZBA > && (INTVAL (operands[3]) >> INTVAL (operands[2])) == 0xffffffff" > @@ -110,7 +110,7 @@ (define_insn "*slliuw" > [(set (match_operand:DI 0 "register_operand" "=r") > (and:DI (ashift:DI (match_operand:DI 1 "register_operand" "r") > (match_operand:QI 2 "immediate_operand" "I")) > - (match_operand 3 "immediate_operand" "")))] > + (match_operand 3 "immediate_operand" "n")))] > "TARGET_64BIT && TARGET_ZBA > && (INTVAL (operands[3]) >> INTVAL (operands[2])) == 0xffffffff" > "slli.uw\t%0,%1,%2" > @@ -354,6 +354,7 @@ (define_insn "*bexti" > (zero_extract:X (match_operand:X 1 "register_operand" "r") > (const_int 1) > (match_operand 2 "immediate_operand" "i")))] Seems something wrong during generating this patch, this line should be removed. > - "TARGET_ZBS" > + (match_operand 2 "immediate_operand" "n")))] > + "TARGET_ZBS && UINTVAL (operands[2]) < GET_MODE_BITSIZE (mode)" > "bexti\t%0,%1,%2" > [(set_attr "type" "bitmanip")]) > -- > 2.27.0 >