From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7889 invoked by alias); 9 Dec 2016 13:36:31 -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 7869 invoked by uid 89); 9 Dec 2016 13:36:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=Jump, 7687 X-HELO: foss.arm.com Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 09 Dec 2016 13:36:20 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 71283707; Fri, 9 Dec 2016 05:36:19 -0800 (PST) Received: from localhost (e105548-lin.manchester.arm.com [10.45.32.67]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E2C0A3F477 for ; Fri, 9 Dec 2016 05:36:18 -0800 (PST) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@arm.com Subject: [60/67] Pass scalar_int_modes to do_jump_by_parts_* References: <87h96dp8u6.fsf@e105548-lin.cambridge.arm.com> Date: Fri, 09 Dec 2016 13:36:00 -0000 In-Reply-To: <87h96dp8u6.fsf@e105548-lin.cambridge.arm.com> (Richard Sandiford's message of "Fri, 09 Dec 2016 12:48:01 +0000") Message-ID: <87a8c5fcmm.fsf@e105548-lin.cambridge.arm.com> User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2016-12/txt/msg00836.txt.bz2 The callers of do_jump_by_parts_* had already established that the modes were MODE_INTs, so this patch passes the modes down as scalar_int_modes. gcc/ 2016-11-24 Richard Sandiford Alan Hayward David Sherwood * dojump.c (do_jump_by_parts_greater_rtx): Change the type of the mode argument to scalar_int_mode. (do_jump_by_parts_zero_rtx): Likewise. (do_jump_by_parts_equality_rtx): Likewise. (do_jump_by_parts_greater): Take a mode argument. (do_jump_by_parts_equality): Likewise. (do_jump_1): Update calls accordingly. diff --git a/gcc/dojump.c b/gcc/dojump.c index 749742b..c48d2ed 100644 --- a/gcc/dojump.c +++ b/gcc/dojump.c @@ -38,10 +38,11 @@ along with GCC; see the file COPYING3. If not see #include "langhooks.h" static bool prefer_and_bit_test (machine_mode, int); -static void do_jump_by_parts_greater (tree, tree, int, +static void do_jump_by_parts_greater (scalar_int_mode, tree, tree, int, rtx_code_label *, rtx_code_label *, int); -static void do_jump_by_parts_equality (tree, tree, rtx_code_label *, - rtx_code_label *, int); +static void do_jump_by_parts_equality (scalar_int_mode, tree, tree, + rtx_code_label *, rtx_code_label *, + int); static void do_compare_and_jump (tree, tree, enum rtx_code, enum rtx_code, rtx_code_label *, rtx_code_label *, int); @@ -226,7 +227,7 @@ do_jump_1 (enum tree_code code, tree op0, tree op1, do_jump (op0, if_true_label, if_false_label, inv (prob)); else if (is_int_mode (TYPE_MODE (inner_type), &int_mode) && !can_compare_p (EQ, int_mode, ccp_jump)) - do_jump_by_parts_equality (op0, op1, if_false_label, + do_jump_by_parts_equality (int_mode, op0, op1, if_false_label, if_true_label, prob); else do_compare_and_jump (op0, op1, EQ, EQ, if_false_label, if_true_label, @@ -247,7 +248,7 @@ do_jump_1 (enum tree_code code, tree op0, tree op1, do_jump (op0, if_false_label, if_true_label, prob); else if (is_int_mode (TYPE_MODE (inner_type), &int_mode) && !can_compare_p (NE, int_mode, ccp_jump)) - do_jump_by_parts_equality (op0, op1, if_true_label, + do_jump_by_parts_equality (int_mode, op0, op1, if_true_label, if_false_label, inv (prob)); else do_compare_and_jump (op0, op1, NE, NE, if_false_label, if_true_label, @@ -259,7 +260,7 @@ do_jump_1 (enum tree_code code, tree op0, tree op1, mode = TYPE_MODE (TREE_TYPE (op0)); if (is_int_mode (mode, &int_mode) && ! can_compare_p (LT, int_mode, ccp_jump)) - do_jump_by_parts_greater (op0, op1, 1, if_false_label, + do_jump_by_parts_greater (int_mode, op0, op1, 1, if_false_label, if_true_label, prob); else do_compare_and_jump (op0, op1, LT, LTU, if_false_label, if_true_label, @@ -270,7 +271,7 @@ do_jump_1 (enum tree_code code, tree op0, tree op1, mode = TYPE_MODE (TREE_TYPE (op0)); if (is_int_mode (mode, &int_mode) && ! can_compare_p (LE, int_mode, ccp_jump)) - do_jump_by_parts_greater (op0, op1, 0, if_true_label, + do_jump_by_parts_greater (int_mode, op0, op1, 0, if_true_label, if_false_label, inv (prob)); else do_compare_and_jump (op0, op1, LE, LEU, if_false_label, if_true_label, @@ -281,7 +282,7 @@ do_jump_1 (enum tree_code code, tree op0, tree op1, mode = TYPE_MODE (TREE_TYPE (op0)); if (is_int_mode (mode, &int_mode) && ! can_compare_p (GT, int_mode, ccp_jump)) - do_jump_by_parts_greater (op0, op1, 0, if_false_label, + do_jump_by_parts_greater (int_mode, op0, op1, 0, if_false_label, if_true_label, prob); else do_compare_and_jump (op0, op1, GT, GTU, if_false_label, if_true_label, @@ -292,7 +293,7 @@ do_jump_1 (enum tree_code code, tree op0, tree op1, mode = TYPE_MODE (TREE_TYPE (op0)); if (is_int_mode (mode, &int_mode) && ! can_compare_p (GE, int_mode, ccp_jump)) - do_jump_by_parts_greater (op0, op1, 1, if_true_label, + do_jump_by_parts_greater (int_mode, op0, op1, 1, if_true_label, if_false_label, inv (prob)); else do_compare_and_jump (op0, op1, GE, GEU, if_false_label, if_true_label, @@ -671,7 +672,7 @@ do_jump (tree exp, rtx_code_label *if_false_label, Jump to IF_TRUE_LABEL if OP0 is greater, IF_FALSE_LABEL otherwise. */ static void -do_jump_by_parts_greater_rtx (machine_mode mode, int unsignedp, rtx op0, +do_jump_by_parts_greater_rtx (scalar_int_mode mode, int unsignedp, rtx op0, rtx op1, rtx_code_label *if_false_label, rtx_code_label *if_true_label, int prob) @@ -746,16 +747,15 @@ do_jump_by_parts_greater_rtx (machine_mode mode, int unsignedp, rtx op0, /* Given a comparison expression EXP for values too wide to be compared with one insn, test the comparison and jump to the appropriate label. The code of EXP is ignored; we always test GT if SWAP is 0, - and LT if SWAP is 1. */ + and LT if SWAP is 1. MODE is the mode of the two operands. */ static void -do_jump_by_parts_greater (tree treeop0, tree treeop1, int swap, - rtx_code_label *if_false_label, +do_jump_by_parts_greater (scalar_int_mode mode, tree treeop0, tree treeop1, + int swap, rtx_code_label *if_false_label, rtx_code_label *if_true_label, int prob) { rtx op0 = expand_normal (swap ? treeop1 : treeop0); rtx op1 = expand_normal (swap ? treeop0 : treeop1); - machine_mode mode = TYPE_MODE (TREE_TYPE (treeop0)); int unsignedp = TYPE_UNSIGNED (TREE_TYPE (treeop0)); do_jump_by_parts_greater_rtx (mode, unsignedp, op0, op1, if_false_label, @@ -768,7 +768,7 @@ do_jump_by_parts_greater (tree treeop0, tree treeop1, int swap, to indicate drop through. */ static void -do_jump_by_parts_zero_rtx (machine_mode mode, rtx op0, +do_jump_by_parts_zero_rtx (scalar_int_mode mode, rtx op0, rtx_code_label *if_false_label, rtx_code_label *if_true_label, int prob) { @@ -818,7 +818,7 @@ do_jump_by_parts_zero_rtx (machine_mode mode, rtx op0, to indicate drop through. */ static void -do_jump_by_parts_equality_rtx (machine_mode mode, rtx op0, rtx op1, +do_jump_by_parts_equality_rtx (scalar_int_mode mode, rtx op0, rtx op1, rtx_code_label *if_false_label, rtx_code_label *if_true_label, int prob) { @@ -855,16 +855,16 @@ do_jump_by_parts_equality_rtx (machine_mode mode, rtx op0, rtx op1, } /* Given an EQ_EXPR expression EXP for values too wide to be compared - with one insn, test the comparison and jump to the appropriate label. */ + with one insn, test the comparison and jump to the appropriate label. + MODE is the mode of the two operands. */ static void -do_jump_by_parts_equality (tree treeop0, tree treeop1, +do_jump_by_parts_equality (scalar_int_mode mode, tree treeop0, tree treeop1, rtx_code_label *if_false_label, rtx_code_label *if_true_label, int prob) { rtx op0 = expand_normal (treeop0); rtx op1 = expand_normal (treeop1); - machine_mode mode = TYPE_MODE (TREE_TYPE (treeop0)); do_jump_by_parts_equality_rtx (mode, op0, op1, if_false_label, if_true_label, prob); }