From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 83918 invoked by alias); 15 Jun 2019 00:16:34 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 83907 invoked by uid 89); 15 Jun 2019 00:16:34 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-16.5 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3 autolearn=ham version=3.3.1 spammy=ob, 1.8.3.1, rr, 1831 X-HELO: gcc1-power7.osuosl.org Received: from gcc1-power7.osuosl.org (HELO gcc1-power7.osuosl.org) (140.211.15.137) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 15 Jun 2019 00:16:33 +0000 Received: by gcc1-power7.osuosl.org (Postfix, from userid 10019) id 6C21A12402A7; Sat, 15 Jun 2019 00:16:31 +0000 (UTC) From: Segher Boessenkool To: gcc-patches@gcc.gnu.org Cc: dje.gcc@gmail.com, Segher Boessenkool Subject: [PATCH] rs6000: New iterator CCEITHER Date: Sat, 15 Jun 2019 00:16:00 -0000 Message-Id: <7e834747176614058c525a9d0f25d92bede1db76.1560557395.git.segher@kernel.crashing.org> X-IsSubscribed: yes X-SW-Source: 2019-06/txt/msg00870.txt.bz2 This expands to both CC and CCUNS, it's useful for isel for example. Tested on powerpc64le-linux; committing to trunk. Segher 2019-06-15 Segher Boessenkool * config/rs6000/rs6000.md (CCEITHER): New define_mode_iterator. (un): New define_mode_attr. (isel_signed_, isel_unsigned_): Delete, merge into ... (isel_signed_): ... this. New define_insn. (isel_reversed_signed_, isel_reversed_unsigned_): Delete, merge into ... (isel_reversed_signed_): ... this. New define_insn. --- gcc/config/rs6000/rs6000.md | 37 ++++++------------------------------- 1 file changed, 6 insertions(+), 31 deletions(-) diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index b1f3bc3..eb03e4d 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.md @@ -5055,23 +5055,13 @@ (define_expand "movcc" ;; leave out the mode in operand 4 and use one pattern, but reload can ;; change the mode underneath our feet and then gets confused trying ;; to reload the value. -(define_insn "isel_signed_" +(define_mode_iterator CCEITHER [CC CCUNS]) +(define_mode_attr un [(CC "") (CCUNS "un")]) +(define_insn "isel_signed_" [(set (match_operand:GPR 0 "gpc_reg_operand" "=r,r") (if_then_else:GPR (match_operator 1 "scc_comparison_operator" - [(match_operand:CC 4 "cc_reg_operand" "y,y") - (const_int 0)]) - (match_operand:GPR 2 "reg_or_zero_operand" "O,b") - (match_operand:GPR 3 "gpc_reg_operand" "r,r")))] - "TARGET_ISEL" - "isel %0,%2,%3,%j1" - [(set_attr "type" "isel")]) - -(define_insn "isel_unsigned_" - [(set (match_operand:GPR 0 "gpc_reg_operand" "=r,r") - (if_then_else:GPR - (match_operator 1 "scc_comparison_operator" - [(match_operand:CCUNS 4 "cc_reg_operand" "y,y") + [(match_operand:CCEITHER 4 "cc_reg_operand" "y,y") (const_int 0)]) (match_operand:GPR 2 "reg_or_zero_operand" "O,b") (match_operand:GPR 3 "gpc_reg_operand" "r,r")))] @@ -5083,26 +5073,11 @@ (define_insn "isel_unsigned_" ;; isel can handle reversed comparisons so long as the operands are ;; registers. -(define_insn "*isel_reversed_signed_" +(define_insn "*isel_reversed_signed_" [(set (match_operand:GPR 0 "gpc_reg_operand" "=r,r") (if_then_else:GPR (match_operator 1 "scc_rev_comparison_operator" - [(match_operand:CC 4 "cc_reg_operand" "y,y") - (const_int 0)]) - (match_operand:GPR 2 "gpc_reg_operand" "r,r") - (match_operand:GPR 3 "reg_or_zero_operand" "O,b")))] - "TARGET_ISEL" -{ - PUT_CODE (operands[1], reverse_condition (GET_CODE (operands[1]))); - return "isel %0,%3,%2,%j1"; -} - [(set_attr "type" "isel")]) - -(define_insn "*isel_reversed_unsigned_" - [(set (match_operand:GPR 0 "gpc_reg_operand" "=r,r") - (if_then_else:GPR - (match_operator 1 "scc_rev_comparison_operator" - [(match_operand:CCUNS 4 "cc_reg_operand" "y,y") + [(match_operand:CCEITHER 4 "cc_reg_operand" "y,y") (const_int 0)]) (match_operand:GPR 2 "gpc_reg_operand" "r,r") (match_operand:GPR 3 "reg_or_zero_operand" "O,b")))] -- 1.8.3.1