From patchwork Thu Jul 13 09:01:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 107649 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp1943298qge; Thu, 13 Jul 2017 02:03:08 -0700 (PDT) X-Received: by 10.84.134.162 with SMTP id 31mr8664530plh.170.1499936588688; Thu, 13 Jul 2017 02:03:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499936588; cv=none; d=google.com; s=arc-20160816; b=PKY0OPmT2eP97PXI2zrOTgwkoBnqigvqGmDVlAJjhk3RrrZrtNUQuZqMF3ntJcFWTw oGFMyQcyTgubnXid11a5sMY/9N+NbOlREzcPl0JojtAyE5tqJa+NM0L6n92dUmRGogiQ B8zYomRqLwTu5nLjYWMcqMLRCmpz3Ku3remCoIZGmdT7QGT8HPmLp2vBnGMoW2kDUorR YOXD3P1SU5XYWgQNH46+2l3i04F0OfKepFgKlYTUhZ/ntrTRxyt90DYP4+74ScMc/JYu HUZdrPldieUqtiLf2WakwPOT02sM6d58M35zl3d7Lwl6HD72Uy4AprZUmcx5NvUmwO1E Vekg== 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=Nxs+N9TSVnINnGo0/ayRtCuYzCQAY8LoG/aEKl2qF80=; b=jLLID5Yffys2rzagj7K1J95bKVjOOPv9wFaZwIP9HBt4YnFaAYgdcaM4T48gad8yae hbVFHgAfE6HoIHwwYaI27y4wMuCFbiPH66L9UNmaqfTyOQdUh2cZbG+QKdZu8JPUY4zs t92EeyGxNAZOrDWu4CeGg1SgTL0EyHovzYZsFhbHbSdvz8vnN7qGhk+pSS6Q28PCgYqn eD6csHukW28DcAAPy6SOdrQH+2No3u8ME0CvuQMa547C9OIYgVCelCQvnEGF41mbivbp Y8wnduK3WB4iJewp9hVryKuV1hJgHuJ+3xHwLB16YSyJDJZuQnKgMwDlj0+t6mSUe3Ov 0Xqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.b=umpyoG9Q; spf=pass (google.com: domain of gcc-patches-return-458054-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-458054-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 t3si3766260pfl.241.2017.07.13.02.03.08 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Jul 2017 02:03:08 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-458054-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=umpyoG9Q; spf=pass (google.com: domain of gcc-patches-return-458054-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-458054-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=bF3/shSg8bfnbhi0D93Vf0W6Ingt2 Y+gOzVVgCU5DX8dliNa/nnnJ4wzozGs3VMQxQD/7iNVIViqnYvU+trk+E3NQmLFA se/SLTPsiI9e9X70MOBXFh700UpffcwSiPTNS/Niy/GoRKrlR90uy+TmAyscUOz9 KoyrLmZZ6R7Vqs= 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=jYYth1x5zvJsJo3k+rfq1m4aZwY=; b=ump yoG9QcHNwpMhDX8ZpbllN851pWtJKs/VjYjKf7hZvZqLgRk2Zyn44QnGf+oB/cE4 NGMm2b1IhQxNZ2LpM1/JxvA3GVh1QYoCB2mI46cT+KKiP223T4WfspBBGle4QS06 /vxEakUyF5Eiw1wIuZoffXkpJdoUwtTWGVkjSO/0= Received: (qmail 34149 invoked by alias); 13 Jul 2017 09:01:25 -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 33155 invoked by uid 89); 13 Jul 2017 09:01:25 -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-wm0-f48.google.com Received: from mail-wm0-f48.google.com (HELO mail-wm0-f48.google.com) (74.125.82.48) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 13 Jul 2017 09:01:18 +0000 Received: by mail-wm0-f48.google.com with SMTP id i127so18527640wma.0 for ; Thu, 13 Jul 2017 02:01:17 -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=Nxs+N9TSVnINnGo0/ayRtCuYzCQAY8LoG/aEKl2qF80=; b=rffHbz0iwKKZ30tGhcl7M4R+gjgwikarW1MVtW23cX5pLMspMg1gKR1yKRCH1OcyNN t9zt9w7uzy3qR97ZGNq7jjRCVxVknw/rCFc2mkvDESLQ3m52prVuYBys0cEfxczppMV4 v3/Kik5Md89T1HPb7vF3738OriJaCbm5aw8TD7AyaOgTtcgsnIoI4GLpjdR2l6hWHRXl gWFnWTHLVPjY22pkIFQz9RqFStl86mK9itKEzL7F7aqsmStY/6QHfWMqw34+DDlDZJRT kWMC3NZEEnLiSP3iOp1FvJcm1udlq4hN/HNZ5FBsDDhenK7q4tjeWuzGrkKj2YTQwjhx KzsA== X-Gm-Message-State: AIVw112dARyx6iTVG2NMChGSxsFpaxSNQB3Y89qdKpXvo3RC43pu9Aj4 PP0Nu5Ciku+RamEct879gw== X-Received: by 10.28.33.66 with SMTP id h63mr1233712wmh.124.1499936475397; Thu, 13 Jul 2017 02:01:15 -0700 (PDT) Received: from localhost (92.40.249.184.threembb.co.uk. [92.40.249.184]) by smtp.gmail.com with ESMTPSA id u75sm2588516wmd.1.2017.07.13.02.01.14 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 13 Jul 2017 02:01:14 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@linaro.org Subject: [63/77] Simplifications after type switch References: <8760ewohsv.fsf@linaro.org> Date: Thu, 13 Jul 2017 10:01:13 +0100 In-Reply-To: <8760ewohsv.fsf@linaro.org> (Richard Sandiford's message of "Thu, 13 Jul 2017 09:35:44 +0100") Message-ID: <87lgnsd82u.fsf@linaro.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 This patch makes a few simplifications after the previous mechanical machine_mode->scalar_int_mode change. 2017-07-13 Richard Sandiford Alan Hayward David Sherwood gcc/ * expmed.c (extract_high_half): Use scalar_int_mode and remove assertion. (expmed_mult_highpart_optab): Likewise. (expmed_mult_highpart): Likewise. Index: gcc/expmed.c =================================================================== --- gcc/expmed.c 2017-07-13 09:18:51.649771750 +0100 +++ gcc/expmed.c 2017-07-13 09:18:52.815684419 +0100 @@ -3611,14 +3611,11 @@ expand_mult_highpart_adjust (scalar_int_ static rtx extract_high_half (scalar_int_mode mode, rtx op) { - machine_mode wider_mode; - if (mode == word_mode) return gen_highpart (mode, op); - gcc_assert (!SCALAR_FLOAT_MODE_P (mode)); + scalar_int_mode wider_mode = *GET_MODE_WIDER_MODE (mode); - wider_mode = *GET_MODE_WIDER_MODE (mode); op = expand_shift (RSHIFT_EXPR, wider_mode, op, GET_MODE_BITSIZE (mode), 0, 1); return convert_modes (mode, wider_mode, op, 0); @@ -3632,15 +3629,13 @@ expmed_mult_highpart_optab (scalar_int_m rtx target, int unsignedp, int max_cost) { rtx narrow_op1 = gen_int_mode (INTVAL (op1), mode); - machine_mode wider_mode; optab moptab; rtx tem; int size; bool speed = optimize_insn_for_speed_p (); - gcc_assert (!SCALAR_FLOAT_MODE_P (mode)); + scalar_int_mode wider_mode = *GET_MODE_WIDER_MODE (mode); - wider_mode = *GET_MODE_WIDER_MODE (mode); size = GET_MODE_BITSIZE (mode); /* Firstly, try using a multiplication insn that only generates the needed @@ -3746,7 +3741,6 @@ expmed_mult_highpart_optab (scalar_int_m expmed_mult_highpart (scalar_int_mode mode, rtx op0, rtx op1, rtx target, int unsignedp, int max_cost) { - machine_mode wider_mode = *GET_MODE_WIDER_MODE (mode); unsigned HOST_WIDE_INT cnst1; int extra_cost; bool sign_adjust = false; @@ -3755,7 +3749,6 @@ expmed_mult_highpart (scalar_int_mode mo rtx tem; bool speed = optimize_insn_for_speed_p (); - gcc_assert (!SCALAR_FLOAT_MODE_P (mode)); /* We can't support modes wider than HOST_BITS_PER_INT. */ gcc_assert (HWI_COMPUTABLE_MODE_P (mode)); @@ -3765,6 +3758,7 @@ expmed_mult_highpart (scalar_int_mode mo ??? We might be able to perform double-word arithmetic if mode == word_mode, however all the cost calculations in synth_mult etc. assume single-word operations. */ + scalar_int_mode wider_mode = *GET_MODE_WIDER_MODE (mode); if (GET_MODE_BITSIZE (wider_mode) > BITS_PER_WORD) return expmed_mult_highpart_optab (mode, op0, op1, target, unsignedp, max_cost);