From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1314) id 5E8B23851C1F; Wed, 24 Aug 2022 19:20:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5E8B23851C1F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1661368844; bh=wn3oEZ14I8/J1DKSsImsCSjc1RVHIaC02qsexzyGi1E=; h=From:To:Subject:Date:From; b=UaxHOTNHNyiej4flhnmDQpnz2yTpkOgYLeik67i7bSXV8V4seE3sDwgYQf/l7FoOF i9kTHxGqZaVFZ6UojN+cC5lHViyWTaS7CPUx0I1AYstUFY/n4OoeFUBAIYGQ5PYAUT 8tJYXpkye1Z2Qbh1cINAVEeMt3yKE3q9J2KNcmyg= 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-2189] [RISCV] Add constraints for not_single_bit_mask_operand/single_bit_mask_operand X-Act-Checkin: gcc X-Git-Author: Andrew Pinski X-Git-Refname: refs/heads/trunk X-Git-Oldrev: 2c721ea9473ad7615bb47b66509097bd254bb839 X-Git-Newrev: 2a5549f1cc8a6ac58a7b19613e788ec5c41ac89c Message-Id: <20220824192044.5E8B23851C1F@sourceware.org> Date: Wed, 24 Aug 2022 19:20:44 +0000 (GMT) List-Id: https://gcc.gnu.org/g:2a5549f1cc8a6ac58a7b19613e788ec5c41ac89c commit r13-2189-g2a5549f1cc8a6ac58a7b19613e788ec5c41ac89c Author: Andrew Pinski Date: Mon Aug 15 22:48:25 2022 +0000 [RISCV] Add constraints for not_single_bit_mask_operand/single_bit_mask_operand Like a previous patch, just add constraints for predicates not_single_bit_mask_operand and single_bit_mask_operand. OK? Built and tested for riscv32-linux-gnu and riscv64-linux-gnu. Thanks, Andrew Pinski gcc/ChangeLog: * config/riscv/constraints.md (DbS): New constraint. (DnS): New constraint. * config/riscv/bitmanip.md (*bset_1_mask): Use new constraint. (*bclr): Likewise. (*binvi): Likewise. Diff: --- gcc/config/riscv/bitmanip.md | 6 +++--- gcc/config/riscv/constraints.md | 10 ++++++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/gcc/config/riscv/bitmanip.md b/gcc/config/riscv/bitmanip.md index 73b2c1040b6..2c0c8bb7f30 100644 --- a/gcc/config/riscv/bitmanip.md +++ b/gcc/config/riscv/bitmanip.md @@ -324,7 +324,7 @@ (define_insn "*bseti" [(set (match_operand:X 0 "register_operand" "=r") (ior:X (match_operand:X 1 "register_operand" "r") - (match_operand 2 "single_bit_mask_operand" "i")))] + (match_operand:X 2 "single_bit_mask_operand" "DbS")))] "TARGET_ZBS" "bseti\t%0,%1,%S2" [(set_attr "type" "bitmanip")]) @@ -341,7 +341,7 @@ (define_insn "*bclri" [(set (match_operand:X 0 "register_operand" "=r") (and:X (match_operand:X 1 "register_operand" "r") - (match_operand 2 "not_single_bit_mask_operand" "i")))] + (match_operand:X 2 "not_single_bit_mask_operand" "DnS")))] "TARGET_ZBS" "bclri\t%0,%1,%T2" [(set_attr "type" "bitmanip")]) @@ -358,7 +358,7 @@ (define_insn "*binvi" [(set (match_operand:X 0 "register_operand" "=r") (xor:X (match_operand:X 1 "register_operand" "r") - (match_operand 2 "single_bit_mask_operand" "i")))] + (match_operand:X 2 "single_bit_mask_operand" "DbS")))] "TARGET_ZBS" "binvi\t%0,%1,%S2" [(set_attr "type" "bitmanip")]) diff --git a/gcc/config/riscv/constraints.md b/gcc/config/riscv/constraints.md index 444870ad060..2873d533cb5 100644 --- a/gcc/config/riscv/constraints.md +++ b/gcc/config/riscv/constraints.md @@ -72,6 +72,16 @@ (and (match_code "const_int") (match_test "ival == 63"))) +(define_constraint "DbS" + "@internal" + (and (match_code "const_int") + (match_test "SINGLE_BIT_MASK_OPERAND (ival)"))) + +(define_constraint "DnS" + "@internal" + (and (match_code "const_int") + (match_test "SINGLE_BIT_MASK_OPERAND (~ival)"))) + ;; Floating-point constant +0.0, used for FCVT-based moves when FMV is ;; not available in RV32. (define_constraint "G"