From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1314) id 7A8FA385357A; Wed, 24 Aug 2022 19:20:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7A8FA385357A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1661368849; bh=yGBFaXfKYsBvOTHCuRC9yOx4KSxZ6pBVEloiNFX9RrU=; h=From:To:Subject:Date:From; b=aOzUh7UKbReYBaI7o4Z5hp3RkzeoMDXc3lmR5XnYpL+X2FhmIMCOWJmACGCnzbway 7jVMugMyWZInkun6k4JD9h/m/Pg4JXQ+qy5DEftLdUmVomNHmUQApzHBojl3rcGEye p/b0hgvvMtG7rRXF+gwRMHO/weWFkY5x3Nkq+DG8= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Andrew Pinski To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-2190] [RISCV] Fix PR 106632 and PR 106588 a few constraints in bitmanip.md X-Act-Checkin: gcc X-Git-Author: Andrew Pinski X-Git-Refname: refs/heads/trunk X-Git-Oldrev: 2a5549f1cc8a6ac58a7b19613e788ec5c41ac89c X-Git-Newrev: df5204ddd4b8e3a2d02bb3ad5bcdb9d636b02537 Message-Id: <20220824192049.7A8FA385357A@sourceware.org> Date: Wed, 24 Aug 2022 19:20:49 +0000 (GMT) List-Id: https://gcc.gnu.org/g:df5204ddd4b8e3a2d02bb3ad5bcdb9d636b02537 commit r13-2190-gdf5204ddd4b8e3a2d02bb3ad5bcdb9d636b02537 Author: Andrew Pinski Date: Mon Aug 15 22:58:09 2022 +0000 [RISCV] Fix PR 106632 and PR 106588 a few constraints in bitmanip.md 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. Diff: --- gcc/config/riscv/bitmanip.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gcc/config/riscv/bitmanip.md b/gcc/config/riscv/bitmanip.md index 2c0c8bb7f30..b44fb9517e7 100644 --- a/gcc/config/riscv/bitmanip.md +++ b/gcc/config/riscv/bitmanip.md @@ -44,7 +44,7 @@ (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 @@ [(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" @@ -377,7 +377,7 @@ [(set (match_operand:X 0 "register_operand" "=r") (zero_extract:X (match_operand:X 1 "register_operand" "r") (const_int 1) - (match_operand 2 "immediate_operand" "i")))] - "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")])