From patchwork Thu Jul 13 09:04:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 107660 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp1947136qge; Thu, 13 Jul 2017 02:07:00 -0700 (PDT) X-Received: by 10.99.152.86 with SMTP id l22mr8113016pgo.93.1499936820652; Thu, 13 Jul 2017 02:07:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499936820; cv=none; d=google.com; s=arc-20160816; b=GxOenWhOpx/UYmHw6IE6D4fnPnbffwnZ25msykW2UjD4W8v+jK1K+CvhrbJFxL6xoz UO5SaXKGTLJPOCBLhC6KCS6Vrq3A4fGdTQnqCfIMDelIKd315tA3t6PIwFaX7C6OmfKL k0aVlNqCqVU8qYJkP+J5GkM6j79bq9t4E8LybVNpQD2J64V1IVt+WPBLZpvnQ+ES2cIj neVedE1HLvgtWlEWrIAUfZMICmaMQnqrjHIWb6reU4huTGr7hIY66izUAmhEzzGR1sAE bVVCEmpNd8sj7G+ifmh6vHpRWCbAlXPLblp38i1WtC6wVMO0+QvJJHbLW4z/Q3mcIcyz XMUA== 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=PqrzcAbi5/5kAeZsoyejuwFOEAwjEQBPNNmPUYVOSVo=; b=nD2hiZoxHX4M8+ql9sEtPcj3NKLc1PG9X5Q0x+rbZSTZuJjZqzn2PcfYiVkeCEXz13 TIyTEOqXcoMHI08mHleiZGr5Yn5wzrSyfnvjQ2boPESo6iedhgOlgXX6PxcnjN5Uz3rC iDmqlyRunILAOOcAewphRR11aAZj8aT55j5z5dXRQrfdLdSxzDeNGT2EUtBtfV3fYUtg sEv5hFaiRTYG/bog6wS+YTN1qL5g6jxIlLb3wPJguzIQ6GAdzKD7siu6NcQL/Dn8dSIN IAG1QiLgajHje3NaVPqnl8JdIFHR9sEJwkZFvB+DjKsryufV8vg3xdPYWxKEDsHttpvG sBlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.b=uAg52vzG; spf=pass (google.com: domain of gcc-patches-return-458066-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-458066-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 f6si4017138plj.207.2017.07.13.02.07.00 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Jul 2017 02:07:00 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-458066-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=uAg52vzG; spf=pass (google.com: domain of gcc-patches-return-458066-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-458066-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=c6M7/iJdLutwJ5AGwvK9bDen5IKKO fu5n291Axlkm/H6en772RuBCG1HnvlXOYc+xxP8lMbOshy2GBk497+VMyl4cY10m 6nx7XzQSzG+VMf3LZMObyDB184OTpPOIIQ/+XE3R2dl1DGb1KhQ25A9U2LmA1ePR GLy30HcziZuxgQ= 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=+BEBhDoPxPhYL0paEDKTjtUQ9lg=; b=uAg 52vzGgnNm6b/o0WwpW9TSK83AleLK7z+PyV/9s8qwz+BXouvKXI4aJz4nDgY7Jnv ekDI0YTEbFNEpt6CV1S7BFr6xYTHPH4CnTxDSlTqRyWbJcZ9grYDQgaNs1UOmcnj eZZyObfu3O5c20q8Rm3wS/1DLIIlIi8uoArNPCx8= Received: (qmail 25164 invoked by alias); 13 Jul 2017 09:04:49 -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 24239 invoked by uid 89); 13 Jul 2017 09:04:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-10.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-wr0-f174.google.com Received: from mail-wr0-f174.google.com (HELO mail-wr0-f174.google.com) (209.85.128.174) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 13 Jul 2017 09:04:44 +0000 Received: by mail-wr0-f174.google.com with SMTP id c11so49603885wrc.3 for ; Thu, 13 Jul 2017 02:04:44 -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=PqrzcAbi5/5kAeZsoyejuwFOEAwjEQBPNNmPUYVOSVo=; b=J9pOTiqP9MqDowRzXOK8WaqSJDayGuYBsb6XlNGwxbhXaCawdmdxSEacOW+iBMHeMJ Dpmuo7hES7QEp0rj3QdPG0ru71RdRxGJOpmyw1sdRXySm+DzVy3BufYOoa3WFBPhTgbb PGKq6HoaXk7VhZnVfNte9krTmh9UN1XCIpllwSELyruUVBjA4r07S7rxGH7qHlGDmxBG pUlG5qQxTKvhEv/CtQ57e30nJfEKPzeQ8anq9HXXjfWVyns3pv59AMkUymCeOlqfBgkq 0ImD6gn9/wqwYsDjQRMbnrg4vqnHvmjrW9DXqv2U7WKqilpa0SqvBWVRygZRxbn5zvl3 Uk4w== X-Gm-Message-State: AIVw1103HoXGnmlG5M0cl/k2LXMud5Bac6Ol2xZXKW2esXpjMgtnq+jS PJJzrAwFsjUwdUHVdBcYNA== X-Received: by 10.223.129.6 with SMTP id 6mr893888wrm.23.1499936682508; Thu, 13 Jul 2017 02:04:42 -0700 (PDT) Received: from localhost (92.40.249.184.threembb.co.uk. [92.40.249.184]) by smtp.gmail.com with ESMTPSA id m26sm4691795wrm.4.2017.07.13.02.04.41 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 13 Jul 2017 02:04:41 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@linaro.org Subject: [74/77] Various small scalar_mode changes References: <8760ewohsv.fsf@linaro.org> Date: Thu, 13 Jul 2017 10:04:40 +0100 In-Reply-To: <8760ewohsv.fsf@linaro.org> (Richard Sandiford's message of "Thu, 13 Jul 2017 09:35:44 +0100") Message-ID: <87a848btcn.fsf@linaro.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 This patch uses scalar_mode in a few miscellaneous places: - Previous patches mean mode_to_vector can take a scalar_mode without further changes. - Implicit promotion is limited to scalar types (affects promote_mode and sdbout_parms) 2017-07-13 Richard Sandiford Alan Hayward David Sherwood gcc/ * machmode.h (mode_for_vector): Take a scalar_mode instead of a machine_mode. * stor-layout.c (mode_for_vector): Likewise. * explow.c (promote_mode): Use as_a . * sdbout.c (sdbout_parms): Use is_a . Index: gcc/machmode.h =================================================================== --- gcc/machmode.h 2017-07-13 09:18:56.812392104 +0100 +++ gcc/machmode.h 2017-07-13 09:18:59.187223319 +0100 @@ -651,7 +651,7 @@ extern machine_mode bitwise_mode_for_mod /* Return a mode that is suitable for representing a vector, or BLKmode on failure. */ -extern machine_mode mode_for_vector (machine_mode, unsigned); +extern machine_mode mode_for_vector (scalar_mode, unsigned); /* A class for iterating through possible bitfield modes. */ class bit_field_mode_iterator Index: gcc/stor-layout.c =================================================================== --- gcc/stor-layout.c 2017-07-13 09:18:53.998596742 +0100 +++ gcc/stor-layout.c 2017-07-13 09:18:59.187223319 +0100 @@ -478,7 +478,7 @@ bitwise_type_for_mode (machine_mode mode is no suitable mode. */ machine_mode -mode_for_vector (machine_mode innermode, unsigned nunits) +mode_for_vector (scalar_mode innermode, unsigned nunits) { machine_mode mode; Index: gcc/explow.c =================================================================== --- gcc/explow.c 2017-07-13 09:18:54.682546579 +0100 +++ gcc/explow.c 2017-07-13 09:18:59.186223389 +0100 @@ -787,6 +787,7 @@ promote_mode (const_tree type ATTRIBUTE_ #ifdef PROMOTE_MODE enum tree_code code; int unsignedp; + scalar_mode smode; #endif /* For libcalls this is invoked without TYPE from the backends @@ -806,9 +807,11 @@ promote_mode (const_tree type ATTRIBUTE_ { case INTEGER_TYPE: case ENUMERAL_TYPE: case BOOLEAN_TYPE: case REAL_TYPE: case OFFSET_TYPE: case FIXED_POINT_TYPE: - PROMOTE_MODE (mode, unsignedp, type); + /* Values of these types always have scalar mode. */ + smode = as_a (mode); + PROMOTE_MODE (smode, unsignedp, type); *punsignedp = unsignedp; - return mode; + return smode; #ifdef POINTERS_EXTEND_UNSIGNED case REFERENCE_TYPE: Index: gcc/sdbout.c =================================================================== --- gcc/sdbout.c 2017-02-23 19:54:15.000000000 +0000 +++ gcc/sdbout.c 2017-07-13 09:18:59.187223319 +0100 @@ -1279,11 +1279,15 @@ sdbout_parms (tree parms) the parm with the variable's declared type, and adjust the address if the least significant bytes (which we are using) are not the first ones. */ + scalar_mode from_mode, to_mode; if (BYTES_BIG_ENDIAN - && TREE_TYPE (parms) != DECL_ARG_TYPE (parms)) - current_sym_value += - (GET_MODE_SIZE (TYPE_MODE (DECL_ARG_TYPE (parms))) - - GET_MODE_SIZE (GET_MODE (DECL_RTL (parms)))); + && TREE_TYPE (parms) != DECL_ARG_TYPE (parms) + && is_a (TYPE_MODE (DECL_ARG_TYPE (parms)), + &from_mode) + && is_a (GET_MODE (DECL_RTL (parms)), + &to_mode)) + current_sym_value += (GET_MODE_SIZE (from_mode) + - GET_MODE_SIZE (to_mode)); if (MEM_P (DECL_RTL (parms)) && GET_CODE (XEXP (DECL_RTL (parms), 0)) == PLUS