From patchwork Mon Oct 23 17:42:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 116850 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp4905660qgn; Mon, 23 Oct 2017 10:43:20 -0700 (PDT) X-Received: by 10.98.198.195 with SMTP id x64mr13931968pfk.322.1508780600932; Mon, 23 Oct 2017 10:43:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508780600; cv=none; d=google.com; s=arc-20160816; b=jYTcJ1vZz77iq5L6ik3qW/U8wk0My/NyEsbmR4D3rsLyjbc9IVhr2Bz+dKcs6J+eGE KF3dXUm9jL1CozuHiDvM3IJ6KPgn//+vPcx8MxlIqfdJu4NW01lh5up1aGIGsqvpSgwh ZbdTmR1ktNcMjK0ogP87Ke+SRAlj4H2RupT+fszhMEKsAGCBF6zE2lWVKubivLVNrjhP WllSCI6tzVrRBfAX68jPjQY8l8uTOv2mpBhTVrrRs2ezyC41oAmWeCGOoQtOMcQDGHNk 76mDk7RCOIZ9S0eCIwWXqBweybcyVPbtHIM7o3g0PNupMTuNJZCJs54u6RIb8SkmpIIe 4lRQ== 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=3jtXUrVTno5qrrEaR7KDjKrS43RwfRwl9ttZ11n6g80=; b=R6FA0t5WDi/dAXuWVCZii5Tl5AztgCnIqbx74QCPBlKBrbyCZmW3v6vuTYYffVOUMd r7A8w6PFqLyuA/3LagITCMRYlM7qB+N5RqB1a8qRe+QU+YwlpLrBYRqMTpdYfv16i7t8 fTpTm77he9/alzNuzCxraaxDUoOqm73PRxWUyStX7tj0KToTubkBTEKvuMnGyfOIYAZs kwSkHkIGEB720R5fIn/WUz/uZRw1IKsPqryc7Qs6ckY+oGoCSPFsQPxVtDdPwwmYDnek 607OUBieKhu/frVbSad4HV37nrwlXbkDuUhV7XzqSMUIFL6Cry+KQy0koD2H4vMUnjyA /Blg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=vu4H1P68; spf=pass (google.com: domain of gcc-patches-return-464881-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-464881-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 i3si4302162pli.199.2017.10.23.10.43.20 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Oct 2017 10:43:20 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-464881-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.s=default header.b=vu4H1P68; spf=pass (google.com: domain of gcc-patches-return-464881-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-464881-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=WK5qBMUbjQT39bavclUQTxIykuYdm PcC2IX9RU3Fa1oMTtnoLI23puMje3sbo/n3F0K2HvRoj4y2xG2nn2g9+LVSYTcMb RY0Q9MMBS49B5v12NKAOmthp1G3gvxq0Oj5sLDpeAUSQjBtBvKi4s04cMQvWQMV4 QbpTbhTNwNQOHk= 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=/NfZfyUdM5eFvavKYn8LWRGL06k=; b=vu4 H1P68ub5KZyIwBPb5oagDTO4hL/TrVTP53K6mEzwPBRjXTwsluNWOoGxRqy53Fz4 zC2OeglL/988qFU4zk5DVaXC1jR7PFPu07Hf/TyKfl1PL1/TAAC+s2n1DezVXHYR JFyPUpVvgACqig6Nh4cbrHM+nwItB189LW93gp3o= Received: (qmail 1003 invoked by alias); 23 Oct 2017 17:43:01 -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 944 invoked by uid 89); 23 Oct 2017 17:43:00 -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-f44.google.com Received: from mail-wm0-f44.google.com (HELO mail-wm0-f44.google.com) (74.125.82.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 23 Oct 2017 17:42:59 +0000 Received: by mail-wm0-f44.google.com with SMTP id u138so11391408wmu.4 for ; Mon, 23 Oct 2017 10:42:58 -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=3jtXUrVTno5qrrEaR7KDjKrS43RwfRwl9ttZ11n6g80=; b=B/RBBLNDT/Vd1CuedAKKr1KTn+DJ9t+l5B1FHY6o/6UIFCRjg9TNiULciG3Y4KScsf GxRRESOvQaor/ouwFSjP+g17ZRGLCA5lo2XVykzkmEbzVoVTbgEYqoWHo0VfkbmPXqoP vcoN/+I7XBEKEb2cqywm6JidMUwXlYwQH8itLnEDgkjLzLjlioymx/xFyTF4nF6jzRpE IsdyEDtNA+dUaxXXcqLpji5InmQM0ctqAYOapb5Vzbhal8ACwSxAW9OcTl43m7GCH5cW S8ZBXi+9X+xtFZ8x7c3N4GxLr2dsyvaTf/XMdwDjOGfRx+cL3z9KmFPO3Fo1s7oZ5Q0P Gruw== X-Gm-Message-State: AMCzsaUebkETiay9E9ChmG9c2LtTWeaVRpAqX3tSgmIE82INCDBTVIM7 La82wnOXTJOj+XCQXp7o4sU4uYRS1uI= X-Google-Smtp-Source: ABhQp+RMWltoBFuul0XwlaBZYQE3LuEZ4hyExhYTxCDgbyNMuKAZwE8bTqGPj/68VjrP4XmeEljP6A== X-Received: by 10.28.23.129 with SMTP id 123mr3493290wmx.54.1508780577012; Mon, 23 Oct 2017 10:42:57 -0700 (PDT) Received: from localhost ([2.26.27.199]) by smtp.gmail.com with ESMTPSA id k13sm4769754wrd.95.2017.10.23.10.42.55 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 23 Oct 2017 10:42:56 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@linaro.org Subject: [105/nnn] poly_int: expand_assignment References: <871sltvm7r.fsf@linaro.org> Date: Mon, 23 Oct 2017 18:42:55 +0100 In-Reply-To: <871sltvm7r.fsf@linaro.org> (Richard Sandiford's message of "Mon, 23 Oct 2017 17:54:32 +0100") Message-ID: <877evldalc.fsf@linaro.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 This patch makes the CONCAT handing in expand_assignment cope with polynomial mode sizes. The mode of the CONCAT must be complex, so we can base the tests on the sizes of the real and imaginary components. 2017-10-23 Richard Sandiford Alan Hayward David Sherwood gcc/ * expr.c (expand_assignment): Cope with polynomial mode sizes when assigning to a CONCAT. Index: gcc/expr.c =================================================================== --- gcc/expr.c 2017-10-23 17:25:54.178292230 +0100 +++ gcc/expr.c 2017-10-23 17:25:56.086223649 +0100 @@ -5109,32 +5109,36 @@ expand_assignment (tree to, tree from, b /* Handle expand_expr of a complex value returning a CONCAT. */ else if (GET_CODE (to_rtx) == CONCAT) { - unsigned short mode_bitsize = GET_MODE_BITSIZE (GET_MODE (to_rtx)); + machine_mode to_mode = GET_MODE (to_rtx); + gcc_checking_assert (COMPLEX_MODE_P (to_mode)); + poly_int64 mode_bitsize = GET_MODE_BITSIZE (to_mode); + unsigned short inner_bitsize = GET_MODE_UNIT_BITSIZE (to_mode); if (COMPLEX_MODE_P (TYPE_MODE (TREE_TYPE (from))) && known_zero (bitpos) && must_eq (bitsize, mode_bitsize)) result = store_expr (from, to_rtx, false, nontemporal, reversep); - else if (must_eq (bitsize, mode_bitsize / 2) + else if (must_eq (bitsize, inner_bitsize) && (known_zero (bitpos) - || must_eq (bitpos, mode_bitsize / 2))) + || must_eq (bitpos, inner_bitsize))) result = store_expr (from, XEXP (to_rtx, maybe_nonzero (bitpos)), false, nontemporal, reversep); - else if (must_le (bitpos + bitsize, mode_bitsize / 2)) + else if (must_le (bitpos + bitsize, inner_bitsize)) result = store_field (XEXP (to_rtx, 0), bitsize, bitpos, bitregion_start, bitregion_end, mode1, from, get_alias_set (to), nontemporal, reversep); - else if (must_ge (bitpos, mode_bitsize / 2)) + else if (must_ge (bitpos, inner_bitsize)) result = store_field (XEXP (to_rtx, 1), bitsize, - bitpos - mode_bitsize / 2, + bitpos - inner_bitsize, bitregion_start, bitregion_end, mode1, from, get_alias_set (to), nontemporal, reversep); - else if (known_zero (bitpos) && must_eq (bitsize, mode_bitsize)) + else if (known_zero (bitpos) + && must_eq (bitsize, mode_bitsize)) { rtx from_rtx; result = expand_normal (from); - from_rtx = simplify_gen_subreg (GET_MODE (to_rtx), result, + from_rtx = simplify_gen_subreg (to_mode, result, TYPE_MODE (TREE_TYPE (from)), 0); emit_move_insn (XEXP (to_rtx, 0), read_complex_part (from_rtx, false));