From patchwork Thu Jul 13 08:59:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 107647 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp1942195qge; Thu, 13 Jul 2017 02:02:01 -0700 (PDT) X-Received: by 10.98.222.3 with SMTP id h3mr58498338pfg.93.1499936521555; Thu, 13 Jul 2017 02:02:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499936521; cv=none; d=google.com; s=arc-20160816; b=HcNwKX3A8RmNd6OA6pe75DQmTSbyi7PMhRYOlxZ6tB+nYw0TRLbwEqIhiv7wub16Gk sLWniUJQFApeG+oCB0mF2tZUXLVv9EXKUl9Y5OoouCtCKfNIJ+ZOAZlmMsde9f5B9Blj a5znWrlUTr1ZeuxV5gHQKLvo25PAI9+oJq3gDff3VWgQd9WkgukrV0F3mAbtIsN7zLNL bNW7WXLgFdGrhsmhffYFDvzFYhvmszdmGbPVCnUzM5TPW43Q0VVA5aCinPS1VAEV8oqQ i3N8nRqrYSgh1YMMg+8LLxF42Zyvi3vq6ffxENNpZzjhPz1cPFDVYSrBPWgk1ofEPPIp E8Qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:mail-followup-to:to:from:delivered-to:sender:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mailing-list:dkim-signature:domainkey-signature :arc-authentication-results; bh=sXp+6E2CZNdcps7aqbbw14phJobu9QlUIk5oSVbBC9A=; b=sQFntjmmZ6MOLa5Fmtio21kizJ7BFYf7PczFiVYMO6m3M7J5X5Xsi/s/hj3tPfcAHI 0k+MLz+S1aLFEqFRfNxT2sLAqUHE8HAY5Gt8H56Ibb8GiNtDgzfpYfPclGYzlbzhZXq4 7eXtpBF/xKAkAoVVnjbTbUV+S8EKk1vMy8tFR+75LCKF/lWyIcJh6/ztgr428KpnGWjD BB6XpelSLOWI/5oGHieDiaNLjFfyR55ywNe7Nu/r8KK22mKyWj5Ay1+Ec6S5c2cMXQu1 Idy2XEzVxZtoYJJp/Mg+qTwoOAZez+I0HgjbZUj5lCUxJDCWki2gvzKksAwj5LP14k6s 9DrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.b=ZbcPK5GK; spf=pass (google.com: domain of gcc-patches-return-458051-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-458051-patch=linaro.org@gcc.gnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id g12si4061682plk.306.2017.07.13.02.02.01 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Jul 2017 02:02:01 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-458051-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.b=ZbcPK5GK; spf=pass (google.com: domain of gcc-patches-return-458051-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-458051-patch=linaro.org@gcc.gnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=default; b=H8dzyPuRt85fZuAiM9TqY3U65TvBD hJb8Ip6fbrDqTafdh0KzqhbzXv2hNClFzyf6dEPGszFDi2u+jwyl/c6LabIXBnXa z4uMe3shtPQAUpmqZD174nCeu+Hka1TqBqES1IZOQa1q2vF+EmQhk+tbbEFjrSjY NGUdCA2Nfbr7Xw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:references:date:in-reply-to:message-id:mime-version :content-type; s=default; bh=lRr33J/XeNn62FnR+AKtquAOh6c=; b=Zbc PK5GKp9ed1MWfa+/F5BQGkkott7D8/lh1uYEOwDSU50/Ea9TwUGh3ZqKhbKSN3k1 Bi1N2nSIMJsHeVPm7EHgeK5asmvKEFuzn+XzsUuPgIb8PCWaTVuGQH3oLWeincsg OA+ddV77n182jdA8tPBFyAQT6psCI2uIwzVmXRkQ= Received: (qmail 74040 invoked by alias); 13 Jul 2017 08:59:55 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 73333 invoked by uid 89); 13 Jul 2017 08:59:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-wr0-f169.google.com Received: from mail-wr0-f169.google.com (HELO mail-wr0-f169.google.com) (209.85.128.169) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 13 Jul 2017 08:59:50 +0000 Received: by mail-wr0-f169.google.com with SMTP id r103so49653684wrb.0 for ; Thu, 13 Jul 2017 01:59:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:mail-followup-to:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=sXp+6E2CZNdcps7aqbbw14phJobu9QlUIk5oSVbBC9A=; b=OsIGb02ra/qJWWb47fHkbjK+5P7CvcDQ/rn5KL0FWyTLqj6Pa4xdT8jNf0l3EBClpe guLM9VuyysgI5Pw6s16vNyHAT9PhPeeutJn7LRG6vOkKip3f8V1+SnHlIlGsqShOT7hm 9dvfKG2kEP3r5grCZTU/a0g4yZKT5F4e/O1KfHHfF60BCTwU8woRmSVwtZNkNzJgXnaU VNDJ5S9jWjuX9MjTYF8qnqR85AEHkkC6OK/asBk+4DfhI7hik7+fpAy7gFM7Q/UaWc4l HXqwsrmOLU19oH7nEVLSMegtPJ7Ewu+yacu8qGYDig1OVMeyZczfnqsj/GeEh6conCCx GSdg== X-Gm-Message-State: AIVw1120uGJtv2mq15PidE/BpdXBevhe2loGIPIcSJykNrvwv18muXac TTe0S088o6xIMoVgG6kgSw== X-Received: by 10.223.145.10 with SMTP id j10mr880676wrj.172.1499936388498; Thu, 13 Jul 2017 01:59:48 -0700 (PDT) Received: from localhost (92.40.249.184.threembb.co.uk. [92.40.249.184]) by smtp.gmail.com with ESMTPSA id t125sm4970743wmt.20.2017.07.13.01.59.47 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 13 Jul 2017 01:59:47 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@linaro.org Subject: [60/77] Pass scalar_int_modes to do_jump_by_parts_* References: <8760ewohsv.fsf@linaro.org> Date: Thu, 13 Jul 2017 09:59:46 +0100 In-Reply-To: <8760ewohsv.fsf@linaro.org> (Richard Sandiford's message of "Thu, 13 Jul 2017 09:35:44 +0100") Message-ID: <87y3rsd859.fsf@linaro.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 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. 2017-07-13 Richard Sandiford Alan Hayward David Sherwood gcc/ * 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. Index: gcc/dojump.c =================================================================== --- gcc/dojump.c 2017-07-13 09:18:38.657812970 +0100 +++ gcc/dojump.c 2017-07-13 09:18:50.326871958 +0100 @@ -38,11 +38,12 @@ Software Foundation; either version 3, o #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 *, profile_probability); -static void do_jump_by_parts_equality (tree, tree, rtx_code_label *, - rtx_code_label *, profile_probability); +static void do_jump_by_parts_equality (scalar_int_mode, tree, tree, + rtx_code_label *, rtx_code_label *, + profile_probability); static void do_compare_and_jump (tree, tree, enum rtx_code, enum rtx_code, rtx_code_label *, rtx_code_label *, profile_probability); @@ -221,8 +222,8 @@ do_jump_1 (enum tree_code code, tree op0 prob.invert ()); 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, if_true_label, - prob); + 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, prob); @@ -242,8 +243,8 @@ do_jump_1 (enum tree_code code, tree op0 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, if_false_label, - prob.invert ()); + do_jump_by_parts_equality (int_mode, op0, op1, if_true_label, + if_false_label, prob.invert ()); else do_compare_and_jump (op0, op1, NE, NE, if_false_label, if_true_label, prob); @@ -254,7 +255,7 @@ do_jump_1 (enum tree_code code, tree op0 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, @@ -265,8 +266,8 @@ do_jump_1 (enum tree_code code, tree op0 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, if_false_label, - prob.invert ()); + do_jump_by_parts_greater (int_mode, op0, op1, 0, if_true_label, + if_false_label, prob.invert ()); else do_compare_and_jump (op0, op1, LE, LEU, if_false_label, if_true_label, prob); @@ -276,7 +277,7 @@ do_jump_1 (enum tree_code code, tree op0 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, @@ -287,8 +288,8 @@ do_jump_1 (enum tree_code code, tree op0 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, if_false_label, - prob.invert ()); + do_jump_by_parts_greater (int_mode, op0, op1, 1, if_true_label, + if_false_label, prob.invert ()); else do_compare_and_jump (op0, op1, GE, GEU, if_false_label, if_true_label, prob); @@ -667,7 +668,7 @@ do_jump (tree exp, rtx_code_label *if_fa 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, profile_probability prob) @@ -743,17 +744,16 @@ do_jump_by_parts_greater_rtx (machine_mo /* 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, profile_probability 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, @@ -766,7 +766,7 @@ do_jump_by_parts_greater (tree treeop0, 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, profile_probability prob) @@ -817,7 +817,7 @@ do_jump_by_parts_zero_rtx (machine_mode 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, profile_probability prob) @@ -855,17 +855,17 @@ do_jump_by_parts_equality_rtx (machine_m } /* 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, profile_probability 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); }