From patchwork Wed May 15 02:39:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kugan Vivekanandarajah X-Patchwork-Id: 164256 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp200032ili; Tue, 14 May 2019 19:40:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqxqMY3E8Q8AsE9X74ke3N+cY4foGA+Kbv9NLS4vEmorD2pGqXwvcDSujpyNyTK9UGuGy9nG X-Received: by 2002:a62:1846:: with SMTP id 67mr25553475pfy.33.1557888041358; Tue, 14 May 2019 19:40:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557888041; cv=none; d=google.com; s=arc-20160816; b=dm5e1k8WdJjrNumtiCIfWSUPHHhDI3jgn2I1vDhVa9Qcun0u6Akmy4/WK6Yt7GXVx4 0tSuZQ1SRk46WsjzNcliAhLH1DuhlCg+/f2RE+goXPM7Zk0OUG65d7uf/vWXfPlYVQ0n hxPNiC3lanUVifZvgsiQtYxbKIzChKBlBhWGXlccTBAcZuT7zXpWqSpisH6A33txHDM5 /ZGgD+6bHV1j5JYTIZCv7xWQ4ZBnzBXYh+iXTTsv+tXM1vn34/JBo3DDmE39w7gg64uq vsY97fGdyqZ3HOO6tpOm1hejKBtxhI2QFYLoSsIijfoLXk/E8+K6kVloU4L8dw1m62Gx jJLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:delivered-to:sender:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature; bh=X1X+Tbg9NC9Te/t+8KuHGYFXHkCx/ITWin5MF4CWBG0=; b=yjrfL399tBVodnJCC1UfyABE40yvXtIUQSySyw2CIlSVx4btEYGv71LWYgYa12Tq4Y yMHiT+Hf+2ZmB6dYvsNcSqyBV0ABPaWvFuumgaQeAhFBe0EDt/C3Ouxvv/0G5pj7hWew G1GaN+Dc2D795irBVvD6vBj7CzQq3qSgM3CAelsbtGj0k5jPfeyN6Y3U813NCPv1ioKs yQ/p4PMmBNgr0EriI/nI7pDiOowR7uFbqm8xJZYUhYWcX7Q1efGwjOS9QYL+aSPJt/Vf lH1jMMlttFsiGo+jfTjvgbc3REs2C61pwjLDrA+FM/BHKoUeH3oSxVeqFnZM1xa7qf+X gD2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="Srl/Okd5"; dkim=pass header.i=@linaro.org header.s=google header.b=sAc24U0l; spf=pass (google.com: domain of gcc-patches-return-500708-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-500708-patch=linaro.org@gcc.gnu.org"; dmarc=pass (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 t10si601473pgv.533.2019.05.14.19.40.41 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 May 2019 19:40:41 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-500708-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="Srl/Okd5"; dkim=pass header.i=@linaro.org header.s=google header.b=sAc24U0l; spf=pass (google.com: domain of gcc-patches-return-500708-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-500708-patch=linaro.org@gcc.gnu.org"; dmarc=pass (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:cc:subject:date:message-id:in-reply-to:references; q=dns; s= default; b=oC0KvNUUIglllzZhEUtBrNXV0BiMQDYGRUnrKEafhpwIf6MwfNYei NFMBlqza0DTFwEFTZw2jOxJJBNkTqR64+MnW+WKmYCFc3RlZU1eX9bjSsrlmucza aSlrVWyFaopZfZZbr/keIfZumcnqaVvuN6Btoifd7uDrASV9SzmYZQ= 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:cc:subject:date:message-id:in-reply-to:references; s= default; bh=REgp9HJCp0npKKgavGRU3mTfkdw=; b=Srl/Okd5HBVX98s+TiJ6 J+YMeKXYvPOkViBnCIpGXcINtgiuMCwNN38FBnmX94Cgboz1DgAA7bU40YSlh0Ic XphcaQuiyHDfpQD5DNxpunFkD73lsoYn5Ap6AVjVUKzQbuxUiTUOuIUtJGlTW3w2 +Cx/BtqkBs8HLQ6bcRMkP44= Received: (qmail 52905 invoked by alias); 15 May 2019 02:40: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 52843 invoked by uid 89); 15 May 2019 02:40:25 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-16.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=UD:is_constant X-HELO: mail-pg1-f169.google.com Received: from mail-pg1-f169.google.com (HELO mail-pg1-f169.google.com) (209.85.215.169) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 15 May 2019 02:40:23 +0000 Received: by mail-pg1-f169.google.com with SMTP id c13so555221pgt.1 for ; Tue, 14 May 2019 19:40:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=X1X+Tbg9NC9Te/t+8KuHGYFXHkCx/ITWin5MF4CWBG0=; b=sAc24U0lLJxAhhBvyHREZ5p/1ecG0G/cq1D1wiIUEyveQuoyoBTTFgA3qmj08Nisn4 pSzl93f3tqvWk5Dqau/z7NlB5qmd8sxYUe8H1urnB2fMg7UY+dscKgf4U819c49rTURf 2Qdf266jg+305yXMgE1Uay+sjWo8wR/6fazEeZ47UpetNilpV1jlYvzTJbPEvX8ZXZUq mci+VGMkuOr1QuASdU4gcas7+k9oBr6lZroMlkLSds4VoKif6iyvh2Ci9UIiLJUOBaEk K3/JgBjh4BHAfdqz0IoR56ls9KmCSYWofJj2Mz7t7exvOcHyxFCKl63IcjPp+kwrpC1H R3LQ== Return-Path: Received: from localhost.localdomain (203-219-253-77.static.tpgi.com.au. [203.219.253.77]) by smtp.gmail.com with ESMTPSA id c5sm457976pgh.86.2019.05.14.19.40.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 14 May 2019 19:40:20 -0700 (PDT) From: kugan.vivekanandarajah@linaro.org To: gcc-patches@gcc.gnu.org Cc: Kugan Vivekanandarajah Subject: [PATCH 1/2] Add support for IVOPT Date: Wed, 15 May 2019 12:39:49 +1000 Message-Id: <1557887990-18668-2-git-send-email-kugan.vivekanandarajah@linaro.org> In-Reply-To: <1557887990-18668-1-git-send-email-kugan.vivekanandarajah@linaro.org> References: <1557887990-18668-1-git-send-email-kugan.vivekanandarajah@linaro.org> X-IsSubscribed: yes From: Kugan Vivekanandarajah gcc/ChangeLog: 2019-05-15 Kugan Vivekanandarajah PR target/88834 * tree-ssa-loop-ivopts.c (get_mem_type_for_internal_fn): Handle IFN_MASK_LOAD_LANES and IFN_MASK_STORE_LANES. (find_interesting_uses_stmt): Likewise. (get_alias_ptr_type_for_ptr_address): Likewise. (add_iv_candidate_for_use): Add scaled index candidate if useful. Change-Id: I8e8151fe2dde2845dedf38b090103694da6fc9d1 --- gcc/tree-ssa-loop-ivopts.c | 60 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 59 insertions(+), 1 deletion(-) -- 2.7.4 diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c index 9864b59..115a70c 100644 --- a/gcc/tree-ssa-loop-ivopts.c +++ b/gcc/tree-ssa-loop-ivopts.c @@ -2451,11 +2451,13 @@ get_mem_type_for_internal_fn (gcall *call, tree *op_p) switch (gimple_call_internal_fn (call)) { case IFN_MASK_LOAD: + case IFN_MASK_LOAD_LANES: if (op_p == gimple_call_arg_ptr (call, 0)) return TREE_TYPE (gimple_call_lhs (call)); return NULL_TREE; case IFN_MASK_STORE: + case IFN_MASK_STORE_LANES: if (op_p == gimple_call_arg_ptr (call, 0)) return TREE_TYPE (gimple_call_arg (call, 3)); return NULL_TREE; @@ -2545,7 +2547,7 @@ find_interesting_uses_stmt (struct ivopts_data *data, gimple *stmt) return; } - /* TODO -- we should also handle address uses of type + /* TODO -- we should also handle all address uses of type memory = call (whatever); @@ -2553,6 +2555,27 @@ find_interesting_uses_stmt (struct ivopts_data *data, gimple *stmt) call (memory). */ } + else if (is_gimple_call (stmt)) + { + gcall *call = dyn_cast (stmt); + if (call + && gimple_call_internal_p (call) + && (gimple_call_internal_fn (call) == IFN_MASK_LOAD_LANES + || gimple_call_internal_fn (call) == IFN_MASK_STORE_LANES)) + { + tree *arg = gimple_call_arg_ptr (call, 0); + struct iv *civ = get_iv (data, *arg); + tree mem_type = get_mem_type_for_internal_fn (call, arg); + if (civ && mem_type) + { + civ = alloc_iv (data, civ->base, civ->step); + record_group_use (data, arg, civ, stmt, USE_PTR_ADDRESS, + mem_type); + return; + } + } + } + if (gimple_code (stmt) == GIMPLE_PHI && gimple_bb (stmt) == data->current_loop->header) @@ -3500,6 +3523,39 @@ add_iv_candidate_for_use (struct ivopts_data *data, struct iv_use *use) basetype = sizetype; record_common_cand (data, build_int_cst (basetype, 0), iv->step, use); + /* Compare the cost of an address with an unscaled index with the cost of + an address with a scaled index and add candidate if useful. */ + if (use != NULL && use->type == USE_PTR_ADDRESS) + { + struct mem_address parts = {NULL_TREE, integer_one_node, + NULL_TREE, NULL_TREE, NULL_TREE}; + poly_uint64 temp; + poly_int64 fact; + bool speed = optimize_loop_for_speed_p (data->current_loop); + poly_int64 poly_step = tree_to_poly_int64 (iv->step); + machine_mode mem_mode = TYPE_MODE (use->mem_type); + addr_space_t as = TYPE_ADDR_SPACE (TREE_TYPE (use->iv->base)); + + fact = GET_MODE_SIZE (GET_MODE_INNER (TYPE_MODE (use->mem_type))); + parts.index = integer_one_node; + + if (fact.is_constant () + && can_div_trunc_p (poly_step, fact, &temp)) + { + /* Addressing mode "base + index". */ + rtx addr = addr_for_mem_ref (&parts, as, false); + unsigned cost = address_cost (addr, mem_mode, as, speed); + tree step = wide_int_to_tree (sizetype, + exact_div (poly_step, fact)); + parts.step = wide_int_to_tree (sizetype, fact); + /* Addressing mode "base + index << scale". */ + addr = addr_for_mem_ref (&parts, as, false); + unsigned new_cost = address_cost (addr, mem_mode, as, speed); + if (new_cost < cost) + add_candidate (data, size_int (0), step, true, NULL); + } + } + /* Record common candidate with constant offset stripped in base. Like the use itself, we also add candidate directly for it. */ base = strip_offset (iv->base, &offset); @@ -7112,6 +7168,8 @@ get_alias_ptr_type_for_ptr_address (iv_use *use) { case IFN_MASK_LOAD: case IFN_MASK_STORE: + case IFN_MASK_LOAD_LANES: + case IFN_MASK_STORE_LANES: /* The second argument contains the correct alias type. */ gcc_assert (use->op_p = gimple_call_arg_ptr (call, 0)); return TREE_TYPE (gimple_call_arg (call, 1)); From patchwork Wed May 15 02:39:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kugan Vivekanandarajah X-Patchwork-Id: 164257 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp200304ili; Tue, 14 May 2019 19:41:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqwNhP9Xnmas5cggyDyQYcpbW4p+gNvzJz8gyQPVU/iO8mctxRYC0skeKFCu/beekZZZK/h5 X-Received: by 2002:a65:4c86:: with SMTP id m6mr40848295pgt.75.1557888065137; Tue, 14 May 2019 19:41:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557888065; cv=none; d=google.com; s=arc-20160816; b=nuGoORZyUncbtyLhX0t4+R+uo+n/rLT7RWDmndY/6jLISMfAMsOGObcx0Zvq/fFDRq KR+izz/Ms2fGVQyNBDhEFgm2bwCYUF8QShACVFNg+CYYSyBOn3I+vWQ8as7Wfl11CF45 sOaNy+L4QY/4M3a5DXQ97xq8H+wzxuTaLf9cINtnoslotTEE0BjYlM/WpbZNfy72zRVL 8I9L6rmdw0lnXIol+9mFoL1XOpbRDI5o+H31HJlAL4Lc6xZZ0QIWuzloKvJULFavnENN 8mOCLpdz63jM3/4On/VFHyTVnr52A7HOeuQrRmG8KXRqR7v8bGgje+8Vn/YcPQpeS80O eTTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:delivered-to:sender:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature; bh=reCbttG64fjVvq3OAotmDLdVDlMiHArUH8X3bEoiZQw=; b=RqhMP7dX1JDl1vRe+NZ029C0z1jIwyJBenUqmGO7nE/xbumraLeEIF6hZmdm7pxaoU TIlr+//P10OwOD8D8O49B8T8thGucFmUN30Zkq1SgBiXpmJ7iXwhbRLkIvPkhGjlGkwf 4VkXEfxy3mojjw/sCavFrc5P8GCF4HYzFsp3h+ZbqMcq1LM9orzR55/OaZ3lY+6qED7k wQGVEAHr3z0UtIUYA6lfidizA2uuofGohlRm6XzoduFZuJafopRdRcgOr96wEFi/CWRw FXKie22Kz1NibpLT9iIQjjupdL3iykW7s5Xbgg0Uz6XmByeJzHtC008VrmrXXL7T63EI NW0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=TICTOcPd; dkim=pass header.i=@linaro.org header.s=google header.b=rOUzt5ky; spf=pass (google.com: domain of gcc-patches-return-500710-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-500710-patch=linaro.org@gcc.gnu.org"; dmarc=pass (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 go17si536144plb.357.2019.05.14.19.41.04 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 May 2019 19:41:05 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-500710-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=TICTOcPd; dkim=pass header.i=@linaro.org header.s=google header.b=rOUzt5ky; spf=pass (google.com: domain of gcc-patches-return-500710-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-500710-patch=linaro.org@gcc.gnu.org"; dmarc=pass (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:cc:subject:date:message-id:in-reply-to:references; q=dns; s= default; b=bmiBIkKdbhNkHiRZhA+RALf0fDy01fjm2cpcRilKdgUF3FkBPHVK5 ZcIosgLcl5SZXYIvdLjRwq0Vw0UWkMMC6T6vWxrA4MOSKwVYXp5xM3xbbmmbsFkI 2WkPSWFCS2+kXWWDZVkHdvUMbtdP95s/E0fyJoa8kx0xfLVthy8fgA= 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:cc:subject:date:message-id:in-reply-to:references; s= default; bh=SAY70WrK7gCA9gvflMiUVhXoF84=; b=TICTOcPdlfEgfQchP1IW Otv5zaYCreuyRArKFNpHuUl5FTODM+n55nitoBGPVmp0/aAdFyIOse120Raw7ckM xrzCpVVjLht06pNzEOjh7BkxKsEkqhXq9j6QX9Pi/DrV9wEvBl4eS0yp20AYE7vU 9GDM5KLhzJhOHNTKgmM7+Lc= Received: (qmail 53568 invoked by alias); 15 May 2019 02:40:29 -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 53518 invoked by uid 89); 15 May 2019 02:40:29 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=HX-Received:1d0d X-HELO: mail-pg1-f173.google.com Received: from mail-pg1-f173.google.com (HELO mail-pg1-f173.google.com) (209.85.215.173) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 15 May 2019 02:40:26 +0000 Received: by mail-pg1-f173.google.com with SMTP id e6so548316pgc.4 for ; Tue, 14 May 2019 19:40:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=reCbttG64fjVvq3OAotmDLdVDlMiHArUH8X3bEoiZQw=; b=rOUzt5kyZ4udk9hMGBTmQ4GMeFe/eCwwM8VyzEq0cbbO56WntQHoGO97x2RBNGCQFC tubMBxXYvQLAguSeioGo2W63miba5MmwIQWu66uq6frMY+wtgU+jVj7JrFgpdaO/LNl7 Fojvhl8Nz9tBhpu1GDVYh55TDFVw2JObZt3yHJolTc9hzhxdSPHdXNB5lli9+d3afMkC XutrW/fsrjXNueXWAJ6jhveNsRusTkYnFpl/o7VD0vXBOtzTwlkbQ22jphUOd08IfK4n kf6Ru0BddlBrfkKJlCE4avRJTz/rw92tCvVnW0e0A9eRS8n32hGiQpb50e5h/9vMzuYY 1ZPA== Return-Path: Received: from localhost.localdomain (203-219-253-77.static.tpgi.com.au. [203.219.253.77]) by smtp.gmail.com with ESMTPSA id c5sm457976pgh.86.2019.05.14.19.40.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 14 May 2019 19:40:23 -0700 (PDT) From: kugan.vivekanandarajah@linaro.org To: gcc-patches@gcc.gnu.org Cc: Kugan Vivekanandarajah Subject: [PATCH 2/2] aarch64 back-end changes Date: Wed, 15 May 2019 12:39:50 +1000 Message-Id: <1557887990-18668-3-git-send-email-kugan.vivekanandarajah@linaro.org> In-Reply-To: <1557887990-18668-1-git-send-email-kugan.vivekanandarajah@linaro.org> References: <1557887990-18668-1-git-send-email-kugan.vivekanandarajah@linaro.org> X-IsSubscribed: yes From: Kugan Vivekanandarajah gcc/ChangeLog: 2019-05-15 Kugan Vivekanandarajah PR target/88834 * config/aarch64/aarch64.c (aarch64_classify_address): Relax allow_reg_index_p. gcc/testsuite/ChangeLog: 2019-05-15 Kugan Vivekanandarajah PR target/88834 * gcc.target/aarch64/pr88834.c: New test. * gcc.target/aarch64/sve/struct_vect_1.c: Adjust. * gcc.target/aarch64/sve/struct_vect_14.c: Likewise. * gcc.target/aarch64/sve/struct_vect_15.c: Likewise. * gcc.target/aarch64/sve/struct_vect_16.c: Likewise. * gcc.target/aarch64/sve/struct_vect_17.c: Likewise. * gcc.target/aarch64/sve/struct_vect_7.c: Likewise. Change-Id: I840d08dc89a845b3913204228bae1bed40601d07 --- gcc/config/aarch64/aarch64.c | 2 +- gcc/testsuite/gcc.target/aarch64/pr88834.c | 15 +++++++++++++++ gcc/testsuite/gcc.target/aarch64/sve/struct_vect_1.c | 8 ++++---- gcc/testsuite/gcc.target/aarch64/sve/struct_vect_14.c | 8 ++++---- gcc/testsuite/gcc.target/aarch64/sve/struct_vect_15.c | 8 ++++---- gcc/testsuite/gcc.target/aarch64/sve/struct_vect_16.c | 8 ++++---- gcc/testsuite/gcc.target/aarch64/sve/struct_vect_17.c | 8 ++++---- gcc/testsuite/gcc.target/aarch64/sve/struct_vect_7.c | 8 ++++---- 8 files changed, 40 insertions(+), 25 deletions(-) create mode 100644 gcc/testsuite/gcc.target/aarch64/pr88834.c -- 2.7.4 diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 1f90467..34292eb 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -6592,7 +6592,7 @@ aarch64_classify_address (struct aarch64_address_info *info, bool allow_reg_index_p = (!load_store_pair_p && (known_lt (GET_MODE_SIZE (mode), 16) || vec_flags == VEC_ADVSIMD - || vec_flags == VEC_SVE_DATA)); + || vec_flags & VEC_SVE_DATA)); /* For SVE, only accept [Rn], [Rn, Rm, LSL #shift] and [Rn, #offset, MUL VL]. */ diff --git a/gcc/testsuite/gcc.target/aarch64/pr88834.c b/gcc/testsuite/gcc.target/aarch64/pr88834.c new file mode 100644 index 0000000..ea00967 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/pr88834.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-options "-S -O3 -march=armv8.2-a+sve" } */ + +void +f (int *restrict x, int *restrict y, int *restrict z, int n) +{ + for (int i = 0; i < n; i += 2) + { + x[i] = y[i] + z[i]; + x[i + 1] = y[i + 1] - z[i + 1]; + } +} + +/* { dg-final { scan-assembler-times {\tld2w\t{z[0-9]+.s - z[0-9]+.s}, p[0-7]/z, \[x[0-9]+, x[0-9]+, lsl 2\]\n} 2 } } */ +/* { dg-final { scan-assembler-times {\tst2w\t{z[0-9]+.s - z[0-9]+.s}, p[0-7], \[x[0-9]+, x[0-9]+, lsl 2\]\n} 1 } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/sve/struct_vect_1.c b/gcc/testsuite/gcc.target/aarch64/sve/struct_vect_1.c index 6e3c889..918a581 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/struct_vect_1.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/struct_vect_1.c @@ -83,9 +83,9 @@ NAME(g4) (TYPE *__restrict a, TYPE *__restrict b, TYPE *__restrict c, } } -/* { dg-final { scan-assembler {\tld2b\t{z[0-9]+.b - z[0-9]+.b}, p[0-7]/z, \[x[0-9]+\]\n} } } */ +/* { dg-final { scan-assembler {\tld2b\t{z[0-9]+.b - z[0-9]+.b}, p[0-7]/z, \[x[0-9]+, x[0-9]+\]\n} } } */ /* { dg-final { scan-assembler {\tld3b\t{z[0-9]+.b - z[0-9]+.b}, p[0-7]/z, \[x[0-9]+\]\n} } } */ -/* { dg-final { scan-assembler {\tld4b\t{z[0-9]+.b - z[0-9]+.b}, p[0-7]/z, \[x[0-9]+\]\n} } } */ -/* { dg-final { scan-assembler {\tst2b\t{z[0-9]+.b - z[0-9]+.b}, p[0-7], \[x[0-9]+\]\n} } } */ +/* { dg-final { scan-assembler {\tld4b\t{z[0-9]+.b - z[0-9]+.b}, p[0-7]/z, \[x[0-9]+, x[0-9]+\]\n} } } */ +/* { dg-final { scan-assembler {\tst2b\t{z[0-9]+.b - z[0-9]+.b}, p[0-7], \[x[0-9]+, x[0-9]+\]\n} } } */ /* { dg-final { scan-assembler {\tst3b\t{z[0-9]+.b - z[0-9]+.b}, p[0-7], \[x[0-9]+\]\n} } } */ -/* { dg-final { scan-assembler {\tst4b\t{z[0-9]+.b - z[0-9]+.b}, p[0-7], \[x[0-9]+\]\n} } } */ +/* { dg-final { scan-assembler {\tst4b\t{z[0-9]+.b - z[0-9]+.b}, p[0-7], \[x[0-9]+, x[0-9]+\]\n} } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/sve/struct_vect_14.c b/gcc/testsuite/gcc.target/aarch64/sve/struct_vect_14.c index 45644b6..a16a79e 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/struct_vect_14.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/struct_vect_14.c @@ -43,12 +43,12 @@ #undef NAME #undef TYPE -/* { dg-final { scan-assembler-times {\tld2b\t{z[0-9]+.b - z[0-9]+.b}, p[0-7]/z, \[x[0-9]+\]\n} 1 } } */ +/* { dg-final { scan-assembler-times {\tld2b\t{z[0-9]+.b - z[0-9]+.b}, p[0-7]/z, \[x[0-9]+, x[0-9]+\]\n} 1 } } */ /* { dg-final { scan-assembler-times {\tld3b\t{z[0-9]+.b - z[0-9]+.b}, p[0-7]/z, \[x[0-9]+\]\n} 1 } } */ -/* { dg-final { scan-assembler-times {\tld4b\t{z[0-9]+.b - z[0-9]+.b}, p[0-7]/z, \[x[0-9]+\]\n} 1 } } */ -/* { dg-final { scan-assembler-times {\tst2b\t{z[0-9]+.b - z[0-9]+.b}, p[0-7], \[x[0-9]+\]\n} 1 } } */ +/* { dg-final { scan-assembler-times {\tld4b\t{z[0-9]+.b - z[0-9]+.b}, p[0-7]/z, \[x[0-9]+, x[0-9]+\]\n} 1 } } */ +/* { dg-final { scan-assembler-times {\tst2b\t{z[0-9]+.b - z[0-9]+.b}, p[0-7], \[x[0-9]+, x[0-9]+\]\n} 1 } } */ /* { dg-final { scan-assembler-times {\tst3b\t{z[0-9]+.b - z[0-9]+.b}, p[0-7], \[x[0-9]+\]\n} 1 } } */ -/* { dg-final { scan-assembler-times {\tst4b\t{z[0-9]+.b - z[0-9]+.b}, p[0-7], \[x[0-9]+\]\n} 1 } } */ +/* { dg-final { scan-assembler-times {\tst4b\t{z[0-9]+.b - z[0-9]+.b}, p[0-7], \[x[0-9]+, x[0-9]+\]\n} 1 } } */ /* { dg-final { scan-assembler-times {\tld2h\t{z[0-9]+.h - z[0-9]+.h}, p[0-7]/z, \[x[0-9]+\]\n} 2 } } */ /* { dg-final { scan-assembler-times {\tld3h\t{z[0-9]+.h - z[0-9]+.h}, p[0-7]/z, \[x[0-9]+\]\n} 2 } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/sve/struct_vect_15.c b/gcc/testsuite/gcc.target/aarch64/sve/struct_vect_15.c index 814dbb3..bc00267 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/struct_vect_15.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/struct_vect_15.c @@ -3,12 +3,12 @@ #include "struct_vect_14.c" -/* { dg-final { scan-assembler-times {\tld2b\t{z[0-9]+.b - z[0-9]+.b}, p[0-7]/z, \[x[0-9]+\]\n} 1 } } */ +/* { dg-final { scan-assembler-times {\tld2b\t{z[0-9]+.b - z[0-9]+.b}, p[0-7]/z, \[x[0-9]+, x[0-9]+\]\n} 1 } } */ /* { dg-final { scan-assembler-times {\tld3b\t{z[0-9]+.b - z[0-9]+.b}, p[0-7]/z, \[x[0-9]+\]\n} 1 } } */ -/* { dg-final { scan-assembler-times {\tld4b\t{z[0-9]+.b - z[0-9]+.b}, p[0-7]/z, \[x[0-9]+\]\n} 1 } } */ -/* { dg-final { scan-assembler-times {\tst2b\t{z[0-9]+.b - z[0-9]+.b}, p[0-7], \[x[0-9]+\]\n} 1 } } */ +/* { dg-final { scan-assembler-times {\tld4b\t{z[0-9]+.b - z[0-9]+.b}, p[0-7]/z, \[x[0-9]+, x[0-9]+\]\n} 1 } } */ +/* { dg-final { scan-assembler-times {\tst2b\t{z[0-9]+.b - z[0-9]+.b}, p[0-7], \[x[0-9]+, x[0-9]+\]\n} 1 } } */ /* { dg-final { scan-assembler-times {\tst3b\t{z[0-9]+.b - z[0-9]+.b}, p[0-7], \[x[0-9]+\]\n} 1 } } */ -/* { dg-final { scan-assembler-times {\tst4b\t{z[0-9]+.b - z[0-9]+.b}, p[0-7], \[x[0-9]+\]\n} 1 } } */ +/* { dg-final { scan-assembler-times {\tst4b\t{z[0-9]+.b - z[0-9]+.b}, p[0-7], \[x[0-9]+, x[0-9]+\]\n} 1 } } */ /* { dg-final { scan-assembler-times {\tld2h\t{z[0-9]+.h - z[0-9]+.h}, p[0-7]/z, \[x[0-9]+\]\n} 2 } } */ /* { dg-final { scan-assembler-times {\tld3h\t{z[0-9]+.h - z[0-9]+.h}, p[0-7]/z, \[x[0-9]+\]\n} 2 } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/sve/struct_vect_16.c b/gcc/testsuite/gcc.target/aarch64/sve/struct_vect_16.c index 6ecf89b..9e2a549 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/struct_vect_16.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/struct_vect_16.c @@ -3,12 +3,12 @@ #include "struct_vect_14.c" -/* { dg-final { scan-assembler-times {\tld2b\t{z[0-9]+.b - z[0-9]+.b}, p[0-7]/z, \[x[0-9]+\]\n} 1 } } */ +/* { dg-final { scan-assembler-times {\tld2b\t{z[0-9]+.b - z[0-9]+.b}, p[0-7]/z, \[x[0-9]+, x[0-9]+\]\n} 1 } } */ /* { dg-final { scan-assembler-times {\tld3b\t{z[0-9]+.b - z[0-9]+.b}, p[0-7]/z, \[x[0-9]+\]\n} 1 } } */ -/* { dg-final { scan-assembler-times {\tld4b\t{z[0-9]+.b - z[0-9]+.b}, p[0-7]/z, \[x[0-9]+\]\n} 1 } } */ -/* { dg-final { scan-assembler-times {\tst2b\t{z[0-9]+.b - z[0-9]+.b}, p[0-7], \[x[0-9]+\]\n} 1 } } */ +/* { dg-final { scan-assembler-times {\tld4b\t{z[0-9]+.b - z[0-9]+.b}, p[0-7]/z, \[x[0-9]+, x[0-9]+\]\n} 1 } } */ +/* { dg-final { scan-assembler-times {\tst2b\t{z[0-9]+.b - z[0-9]+.b}, p[0-7], \[x[0-9]+, x[0-9]+\]\n} 1 } } */ /* { dg-final { scan-assembler-times {\tst3b\t{z[0-9]+.b - z[0-9]+.b}, p[0-7], \[x[0-9]+\]\n} 1 } } */ -/* { dg-final { scan-assembler-times {\tst4b\t{z[0-9]+.b - z[0-9]+.b}, p[0-7], \[x[0-9]+\]\n} 1 } } */ +/* { dg-final { scan-assembler-times {\tst4b\t{z[0-9]+.b - z[0-9]+.b}, p[0-7], \[x[0-9]+, x[0-9]+\]\n} 1 } } */ /* { dg-final { scan-assembler-times {\tld2h\t{z[0-9]+.h - z[0-9]+.h}, p[0-7]/z, \[x[0-9]+\]\n} 2 } } */ /* { dg-final { scan-assembler-times {\tld3h\t{z[0-9]+.h - z[0-9]+.h}, p[0-7]/z, \[x[0-9]+\]\n} 2 } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/sve/struct_vect_17.c b/gcc/testsuite/gcc.target/aarch64/sve/struct_vect_17.c index 571c6d0..e791e2e 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/struct_vect_17.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/struct_vect_17.c @@ -3,12 +3,12 @@ #include "struct_vect_14.c" -/* { dg-final { scan-assembler-times {\tld2b\t{z[0-9]+.b - z[0-9]+.b}, p[0-7]/z, \[x[0-9]+\]\n} 1 } } */ +/* { dg-final { scan-assembler-times {\tld2b\t{z[0-9]+.b - z[0-9]+.b}, p[0-7]/z, \[x[0-9]+, x[0-9]+\]\n} 1 } } */ /* { dg-final { scan-assembler-times {\tld3b\t{z[0-9]+.b - z[0-9]+.b}, p[0-7]/z, \[x[0-9]+\]\n} 1 } } */ -/* { dg-final { scan-assembler-times {\tld4b\t{z[0-9]+.b - z[0-9]+.b}, p[0-7]/z, \[x[0-9]+\]\n} 1 } } */ -/* { dg-final { scan-assembler-times {\tst2b\t{z[0-9]+.b - z[0-9]+.b}, p[0-7], \[x[0-9]+\]\n} 1 } } */ +/* { dg-final { scan-assembler-times {\tld4b\t{z[0-9]+.b - z[0-9]+.b}, p[0-7]/z, \[x[0-9]+, x[0-9]+\]\n} 1 } } */ +/* { dg-final { scan-assembler-times {\tst2b\t{z[0-9]+.b - z[0-9]+.b}, p[0-7], \[x[0-9]+, x[0-9]+\]\n} 1 } } */ /* { dg-final { scan-assembler-times {\tst3b\t{z[0-9]+.b - z[0-9]+.b}, p[0-7], \[x[0-9]+\]\n} 1 } } */ -/* { dg-final { scan-assembler-times {\tst4b\t{z[0-9]+.b - z[0-9]+.b}, p[0-7], \[x[0-9]+\]\n} 1 } } */ +/* { dg-final { scan-assembler-times {\tst4b\t{z[0-9]+.b - z[0-9]+.b}, p[0-7], \[x[0-9]+, x[0-9]+\]\n} 1 } } */ /* { dg-final { scan-assembler-times {\tld2h\t{z[0-9]+.h - z[0-9]+.h}, p[0-7]/z, \[x[0-9]+\]\n} 2 } } */ /* { dg-final { scan-assembler-times {\tld3h\t{z[0-9]+.h - z[0-9]+.h}, p[0-7]/z, \[x[0-9]+\]\n} 2 } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/sve/struct_vect_7.c b/gcc/testsuite/gcc.target/aarch64/sve/struct_vect_7.c index b741901..3d3070e 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/struct_vect_7.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/struct_vect_7.c @@ -78,9 +78,9 @@ g4 (TYPE *__restrict a, TYPE *__restrict b, TYPE *__restrict c, } } -/* { dg-final { scan-assembler {\tld2b\t{z[0-9]+.b - z[0-9]+.b}, p[0-7]/z, \[x[0-9]+\]\n} } } */ +/* { dg-final { scan-assembler {\tld2b\t{z[0-9]+.b - z[0-9]+.b}, p[0-7]/z, \[x[0-9]+, x[0-9]+\]\n} } } */ /* { dg-final { scan-assembler {\tld3b\t{z[0-9]+.b - z[0-9]+.b}, p[0-7]/z, \[x[0-9]+\]\n} } } */ -/* { dg-final { scan-assembler {\tld4b\t{z[0-9]+.b - z[0-9]+.b}, p[0-7]/z, \[x[0-9]+\]\n} } } */ -/* { dg-final { scan-assembler {\tst2b\t{z[0-9]+.b - z[0-9]+.b}, p[0-7], \[x[0-9]+\]\n} } } */ +/* { dg-final { scan-assembler {\tld4b\t{z[0-9]+.b - z[0-9]+.b}, p[0-7]/z, \[x[0-9]+, x[0-9]+\]\n} } } */ +/* { dg-final { scan-assembler {\tst2b\t{z[0-9]+.b - z[0-9]+.b}, p[0-7], \[x[0-9]+, x[0-9]+\]\n} } } */ /* { dg-final { scan-assembler {\tst3b\t{z[0-9]+.b - z[0-9]+.b}, p[0-7], \[x[0-9]+\]\n} } } */ -/* { dg-final { scan-assembler {\tst4b\t{z[0-9]+.b - z[0-9]+.b}, p[0-7], \[x[0-9]+\]\n} } } */ +/* { dg-final { scan-assembler {\tst4b\t{z[0-9]+.b - z[0-9]+.b}, p[0-7], \[x[0-9]+, x[0-9]+\]\n} } } */