From patchwork Fri Nov 3 16:15:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 117937 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp3650547qgn; Fri, 3 Nov 2017 09:16:25 -0700 (PDT) X-Google-Smtp-Source: ABhQp+SrLX81/+cjJEnYGV2JUNXh11aFQ0a6ubC9vv1ElO/P+zTFdkoV5BMbysrl1xgtmWpktYNb X-Received: by 10.84.235.134 with SMTP id p6mr7474320plk.326.1509725785782; Fri, 03 Nov 2017 09:16:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509725785; cv=none; d=google.com; s=arc-20160816; b=jaz4wR30vA4x8LKgvms4PnqyFE7P87jIYlL9dvz+JvjiiHzP8ijuxvdQbsNQO4cFnF +DLYsoq20ot5BIpTC/K+/GsYXRMRsJ7Y32EILYoOb2vDVjuJW+KAckb/qc9picf+w5r4 zZFdqP/3YOePwqR3Cv/g2DCOy2ggL0ncLbvyIa5i61nl147NAZCJ+GoVh9hPIFmUWzBe cuAPNyXyPUBUR4oErb5z5dtyCTtk8YblO4ReD/gZy94ZZeiVOrUMrC42uKEOZX04h9SY vppweXUDVwpe2lHeXpNJ4sSAeVN/c18RPC4wYkQbluBH74vIhiDk3BW/nZVuNPDjB43s j/Rg== 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=/MNEtEnAtBimHata7NqPSShlZpXkeoB1qSKKpVpUy28=; b=VebXtLmbz1lafyh1TmsbwXSkfXsuF+i7wB56Y9FIPykAbJNYVwR4kBWsOrwSINnty9 yHJL2e6KdXk7JERSn9w0sHlIXjU+kLTdrq24xQEmNr+0WyweQUCWiRrxrJAx/1PXzihe FGJZjpqspF87LA8RdBE1qwJDwLVAgg1v5X1q2PMOQs80IYl2oPFKJyghwcSz4gazIW1a 7/4GPBTkItF8gIY0MDKPD/ySiv7cA3TkpIXciDLvcR+LQoRuoLUzd8pHUUsX/yh8NWCG hg6T2pwsrHPpIjqsMmmMdxIORTHm8tUGMf51pz2g4CpXQJI7lQnwVZZR39GSsnS2/AMO /P8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=u4dz0njL; spf=pass (google.com: domain of gcc-patches-return-465869-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-465869-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 c23si5381315plo.446.2017.11.03.09.16.25 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Nov 2017 09:16:25 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-465869-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=u4dz0njL; spf=pass (google.com: domain of gcc-patches-return-465869-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-465869-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=NPLk0Nm/IMWRmRPfd0AKERNsQ9+JZ B8Ty8yuASABmZJm0cFNIfw+hftd5PxobTaZLCmYovq8wdnaegQk0jNH1y6b6E3d/ Z1GCp0rx50o/hJcnSk6Lv7+4kqubaO1EAk50B9jgAANC31cXbP1NKqp+4M6XDEVR woro/5R1lr7Vh8= 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=tW6bTtVLBCuRmhfnY8+k1/RxHHM=; b=u4d z0njLbffYGMCZ0i8uDLzFfd67H4EODcYeph4XR7+0JpbbPqMq6DQ1HeZkkxJwY5N bgKsdX+f0uY0h0IwsXf6bU/h/qSmQgUednC69Xv3EZ1WrYz1MSRMLiX2EQgNdIIh T/xUw43qEJZMca54tVpDeAy1eFuSwvEJ6/GJ4vgY= Received: (qmail 74590 invoked by alias); 3 Nov 2017 16:16:08 -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 70789 invoked by uid 89); 3 Nov 2017 16:16:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-10.5 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=sk:no-vfa-, sk:novfa, UD:vect-strided-a-u8-i2-gap.c, UD:vect-117.c X-HELO: mail-wr0-f177.google.com Received: from mail-wr0-f177.google.com (HELO mail-wr0-f177.google.com) (209.85.128.177) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 03 Nov 2017 16:15:57 +0000 Received: by mail-wr0-f177.google.com with SMTP id j15so2958279wre.8 for ; Fri, 03 Nov 2017 09:15:56 -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=/MNEtEnAtBimHata7NqPSShlZpXkeoB1qSKKpVpUy28=; b=t8JJ0u+HaWm7p57hbZFZ9Zcnrxh4tjiuLfc/yLebe7QZvr746L14rmN3j2sbISJmxJ BWTyoDF3RqKgZxTWvQEjexEJcJG84gGNKWAGS/Ayr1XuFjPEKC9gg36L4NwJ3izCuBAI EG2O9TxFk1xGwRV0CazJB+Tb6ijf01HAM9nXxvhi7n23YMwEs8z56bossTaB0XjenCdB JZ+TM7RGGYIUxRDtl+xGxl5IRLcDRZWOmF8CJ2zjfKVy2Vv/AQH0YmVseVfS7Fym4kn9 0LoNPbCqzS1gg9H2o03Wat+3OXxWsW9V2V8sRFNtdRXMLL4Aocz9hr+/zV36LIZo4ep/ chVQ== X-Gm-Message-State: AMCzsaXFUNBFECemknQ5N1/CkCUTjxFCYHZG50KvfNx+MmhdSJ89ab6t XqGqEKbC1Q9ET7o6B5kXpJnPexk0tF4= X-Received: by 10.223.172.106 with SMTP id v97mr6905464wrc.229.1509725753952; Fri, 03 Nov 2017 09:15:53 -0700 (PDT) Received: from localhost (188.29.164.162.threembb.co.uk. [188.29.164.162]) by smtp.gmail.com with ESMTPSA id 71sm4363427wmg.0.2017.11.03.09.15.51 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 Nov 2017 09:15:53 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@linaro.org Subject: [1/10] Consistently use asm volatile ("" ::: "memory") in vect tests References: <87inerqqyz.fsf@linaro.org> Date: Fri, 03 Nov 2017 16:15:50 +0000 In-Reply-To: <87inerqqyz.fsf@linaro.org> (Richard Sandiford's message of "Fri, 03 Nov 2017 16:14:44 +0000") Message-ID: <87efpfqqx5.fsf@linaro.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 The vectoriser tests used a combination of: 1) if (impossible condition) abort (); 2) volatile int x; ... *x = ...; 3) asm volatile ("" ::: "memory"); to prevent vectorisation of a set-up loop. The problem with 1) is that the compiler can often tell that the condition is false and optimise it away before vectorisation. This was already happening in slp-perm-9.c, which is why the test was expecting one loop to be vectorised even when the required permutes weren't supported. It becomes a bigger problem with SVE, which is able to vectorise more set-up loops. The point of this patch is therefore to replace 1) with something else. 2) should work most of the time, but we don't usually treat non-volatile accesses as aliasing unrelated volatile accesses, so I think in principle we could split the loop into one that does the set-up and one that does the volatile accesses. 3) seems more robust because it's also a wild read and write. The patch therefore tries to replace all instances of 1) and 2) with 3). 2017-11-03 Richard Sandiford Alan Hayward David Sherwood gcc/testsuite/ * gcc.dg/vect/bb-slp-cond-1.c (main): Add an asm volatile to the set-up loop. * gcc.dg/vect/slp-perm-7.c (main): Prevent vectorisation with asm volatile ("" ::: "memory") instead of a conditional abort. Update the expected vector loop count accordingly. * gcc.dg/vect/slp-perm-9.c (main): Likewise. * gcc.dg/vect/bb-slp-1.c (main1): Prevent vectorisation with asm volatile ("" ::: "memory") instead of a conditional abort. * gcc.dg/vect/slp-23.c (main): Likewise, * gcc.dg/vect/slp-35.c (main): Likewise, * gcc.dg/vect/slp-37.c (main): Likewise, * gcc.dg/vect/slp-perm-4.c (main): Likewise. * gcc.dg/vect/bb-slp-24.c (foo): Likewise. Remove dummy argument. (main): Update call accordingly. * gcc.dg/vect/bb-slp-25.c (foo, main): As for bb-slp-24.c. * gcc.dg/vect/bb-slp-26.c (foo, main): Likewise. * gcc.dg/vect/bb-slp-29.c (foo, main): Likewise. * gcc.dg/vect/no-vfa-vect-102.c (foo): Delete. (main): Don't initialize it. (main1): Prevent vectorisation with asm volatile ("" ::: "memory") instead of a conditional abort. * gcc.dg/vect/no-vfa-vect-102a.c (foo, main1, main): As for no-vfa-vect-102.c * gcc.dg/vect/vect-103.c (foo, main1, main): Likewise. * gcc.dg/vect/vect-104.c (foo, main1, main): Likewise. * gcc.dg/vect/pr42709.c (main1): Remove dummy argument. Prevent vectorisation with asm volatile ("" ::: "memory") instead of a conditional abort. * gcc.dg/vect/slp-13-big-array.c (y): Delete. (main1): Prevent vectorisation with asm volatile ("" ::: "memory") instead of a conditional abort. * gcc.dg/vect/slp-3-big-array.c (y, main1): As for slp-13-big-array.c. * gcc.dg/vect/slp-34-big-array.c (y, main1): Likewise. * gcc.dg/vect/slp-4-big-array.c (y, main1): Likewise. * gcc.dg/vect/slp-multitypes-11-big-array.c (y, main1): Likewise. * gcc.dg/vect/vect-105.c (y, main1): Likewise. * gcc.dg/vect/vect-105-big-array.c (y, main1): Likewise. * gcc.dg/vect/vect-112-big-array.c (y, main1): Likewise. * gcc.dg/vect/vect-15-big-array.c (y, main1): Likewise. * gcc.dg/vect/vect-2-big-array.c (y, main1): Likewise. * gcc.dg/vect/vect-34-big-array.c (y, main1): Likewise. * gcc.dg/vect/vect-6-big-array.c (y, main1): Likewise. * gcc.dg/vect/vect-73-big-array.c (y, main1): Likewise. * gcc.dg/vect/vect-74-big-array.c (y, main1): Likewise. * gcc.dg/vect/vect-75-big-array.c (y, main1): Likewise. * gcc.dg/vect/vect-76-big-array.c (y, main1): Likewise. * gcc.dg/vect/vect-80-big-array.c (y, main1): Likewise. * gcc.dg/vect/vect-97-big-array.c (y, main1): Likewise. * gcc.dg/vect/vect-all-big-array.c (y, main1): Likewise. * gcc.dg/vect/vect-reduc-1char-big-array.c (y, main1): Likewise. * gcc.dg/vect/vect-reduc-2char-big-array.c (y, main1): Likewise. * gcc.dg/vect/vect-strided-a-mult.c (y, main1): Likewise. * gcc.dg/vect/vect-strided-a-u16-i2.c (y, main1): Likewise. * gcc.dg/vect/vect-strided-a-u16-i4.c (y, main1): Likewise. * gcc.dg/vect/vect-strided-a-u16-mult.c (y, main1): Likewise. * gcc.dg/vect/vect-strided-a-u8-i2-gap.c (y, main1): Likewise. * gcc.dg/vect/vect-strided-a-u8-i8-gap2-big-array.c (y, main1): Likewise. * gcc.dg/vect/vect-strided-a-u8-i8-gap2.c (y, main1): Likewise. * gcc.dg/vect/vect-strided-a-u8-i8-gap7-big-array.c (y, main1): Likewise. * gcc.dg/vect/vect-strided-a-u8-i8-gap7.c (y, main1): Likewise. * gcc.dg/vect/slp-24.c (y): Delete. (main): Prevent vectorisation with asm volatile ("" ::: "memory") instead of a conditional abort. * gcc.dg/vect/slp-24-big-array.c (y, main): As for slp-24.c. * gcc.dg/vect/vect-98-big-array.c (y, main): Likewise. * gcc.dg/vect/vect-bswap16.c (y, main): Likewise. * gcc.dg/vect/vect-bswap32.c (y, main): Likewise. * gcc.dg/vect/vect-bswap64.c (y, main): Likewise. * gcc.dg/vect/vect-strided-mult-char-ls.c (y, main): Likewise. * gcc.dg/vect/vect-strided-mult.c (y, main): Likewise. * gcc.dg/vect/vect-strided-same-dr.c (y, main): Likewise. * gcc.dg/vect/vect-strided-u16-i2.c (y, main): Likewise. * gcc.dg/vect/vect-strided-u16-i4.c (y, main): Likewise. * gcc.dg/vect/vect-strided-u32-i4.c (y, main): Likewise. * gcc.dg/vect/vect-strided-u32-i8.c (y, main): Likewise. * gcc.dg/vect/vect-strided-u8-i2-gap.c (y, main): Likewise. * gcc.dg/vect/vect-strided-u8-i2.c (y, main): Likewise. * gcc.dg/vect/vect-strided-u8-i8-gap2-big-array.c (y, main): Likewise. * gcc.dg/vect/vect-strided-u8-i8-gap2.c (y, main): Likewise. * gcc.dg/vect/vect-strided-u8-i8-gap4-big-array.c (y, main): Likewise. * gcc.dg/vect/vect-strided-u8-i8-gap4-unknown.c (y, main): Likewise. * gcc.dg/vect/vect-strided-u8-i8-gap4.c (y, main): Likewise. * gcc.dg/vect/vect-strided-u8-i8-gap7-big-array.c (y, main): Likewise. * gcc.dg/vect/vect-strided-u8-i8-gap7.c (y, main): Likewise. * gcc.dg/vect/vect-strided-u8-i8.c (y, main): Likewise. * gcc.dg/vect/vect-10-big-array.c (y): Delete. (foo): Prevent vectorisation with asm volatile ("" ::: "memory") instead of a conditional abort. * gcc.dg/vect/vect-double-reduc-6-big-array.c (y, foo): As for vect-10-big-array.c. * gcc.dg/vect/vect-reduc-pattern-1b-big-array.c (y, foo): Likewise. * gcc.dg/vect/vect-reduc-pattern-1c-big-array.c (y, foo): Likewise. * gcc.dg/vect/vect-reduc-pattern-2b-big-array.c (y, foo): Likewise. * gcc.dg/vect/vect-117.c (foo): Delete. (main): Don't initalize it. Index: gcc/testsuite/gcc.dg/vect/bb-slp-cond-1.c =================================================================== --- gcc/testsuite/gcc.dg/vect/bb-slp-cond-1.c 2017-02-23 19:54:09.000000000 +0000 +++ gcc/testsuite/gcc.dg/vect/bb-slp-cond-1.c 2017-11-03 16:06:03.052282173 +0000 @@ -28,7 +28,10 @@ int main () check_vect (); for (i = 0; i < N; i++) - a[i] = i; + { + a[i] = i; + asm volatile ("" ::: "memory"); + } foo (a, 4); Index: gcc/testsuite/gcc.dg/vect/slp-perm-7.c =================================================================== --- gcc/testsuite/gcc.dg/vect/slp-perm-7.c 2016-01-13 13:48:42.000000000 +0000 +++ gcc/testsuite/gcc.dg/vect/slp-perm-7.c 2017-11-03 16:06:03.053282336 +0000 @@ -57,8 +57,7 @@ int main (int argc, const char* argv[]) input2[i] = i%256; output[i] = 0; output2[i] = 0; - if (input[i] > 200) - abort (); + asm volatile ("" ::: "memory"); } foo (input, output, input2, output2); @@ -70,7 +69,7 @@ int main (int argc, const char* argv[]) return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target vect_perm } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_perm } } } */ /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target { vect_perm && {! vect_load_lanes } } } } } */ /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" { target vect_load_lanes } } } */ /* { dg-final { scan-tree-dump "note: Built SLP cancelled: can use load/store-lanes" "vect" { target { vect_perm && vect_load_lanes } } } } */ Index: gcc/testsuite/gcc.dg/vect/slp-perm-9.c =================================================================== --- gcc/testsuite/gcc.dg/vect/slp-perm-9.c 2017-10-09 11:50:52.047711098 +0100 +++ gcc/testsuite/gcc.dg/vect/slp-perm-9.c 2017-11-03 16:06:03.054282499 +0000 @@ -33,8 +33,7 @@ int main (int argc, const char* argv[]) { input[i] = i; output[i] = 0; - if (input[i] > 256) - abort (); + asm volatile ("" ::: "memory"); } for (i = 0; i < N / 3; i++) @@ -54,8 +53,8 @@ int main (int argc, const char* argv[]) return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { {! vect_perm } || {! vect_sizes_16B_8B } } } } } */ -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target { { vect_perm } && { vect_sizes_16B_8B } } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 2 "vect" { target { {! vect_perm } || {! vect_sizes_16B_8B } } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { { vect_perm } && { vect_sizes_16B_8B } } } } } */ /* { dg-final { scan-tree-dump-times "permutation requires at least three vectors" 1 "vect" { target vect_perm_short } } } */ /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" { target { {! vect_perm } || {! vect_sizes_32B_16B } } } } } */ /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target { { vect_perm } && { vect_sizes_32B_16B } } } } } */ Index: gcc/testsuite/gcc.dg/vect/bb-slp-1.c =================================================================== --- gcc/testsuite/gcc.dg/vect/bb-slp-1.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/bb-slp-1.c 2017-11-03 16:06:03.051282010 +0000 @@ -25,9 +25,7 @@ main1 (int dummy) *pout++ = *pin++; *pout++ = *pin++; *pout++ = *pin++; - /* Avoid loop vectorization. */ - if (dummy == 32) - abort (); + asm volatile ("" ::: "memory"); } /* check results: */ Index: gcc/testsuite/gcc.dg/vect/slp-23.c =================================================================== --- gcc/testsuite/gcc.dg/vect/slp-23.c 2015-06-13 10:48:20.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/slp-23.c 2017-11-03 16:06:03.052282173 +0000 @@ -97,8 +97,7 @@ int main (void) arr[i].f = i * 5; arr[i].g = i - 3; arr[i].h = 56; - if (arr[i].a == 178) - abort(); + asm volatile ("" ::: "memory"); } main1 (arr); Index: gcc/testsuite/gcc.dg/vect/slp-35.c =================================================================== --- gcc/testsuite/gcc.dg/vect/slp-35.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/slp-35.c 2017-11-03 16:06:03.053282336 +0000 @@ -58,8 +58,7 @@ int main (void) arr[i].c = 17; arr[i].d = i+34; arr[i].e = i * 3 + 5; - if (arr[i].a == 178) - abort(); + asm volatile ("" ::: "memory"); } main1 (arr); Index: gcc/testsuite/gcc.dg/vect/slp-37.c =================================================================== --- gcc/testsuite/gcc.dg/vect/slp-37.c 2016-01-13 13:48:42.000000000 +0000 +++ gcc/testsuite/gcc.dg/vect/slp-37.c 2017-11-03 16:06:03.053282336 +0000 @@ -49,9 +49,7 @@ int main (void) arr1[i].a = i; arr1[i].b = i * 2; arr1[i].c = (void *)arr1; - - if (arr1[i].a == 178) - abort(); + asm volatile ("" ::: "memory"); } Index: gcc/testsuite/gcc.dg/vect/slp-perm-4.c =================================================================== --- gcc/testsuite/gcc.dg/vect/slp-perm-4.c 2015-12-18 10:17:16.000000000 +0000 +++ gcc/testsuite/gcc.dg/vect/slp-perm-4.c 2017-11-03 16:06:03.053282336 +0000 @@ -68,10 +68,8 @@ int main (int argc, const char* argv[]) for (i = 0; i < N; i++) { input[i] = i%256; - if (input[i] > 200) - abort(); output[i] = 0; - __asm__ volatile (""); + asm volatile ("" ::: "memory"); } foo (input, output); Index: gcc/testsuite/gcc.dg/vect/bb-slp-24.c =================================================================== --- gcc/testsuite/gcc.dg/vect/bb-slp-24.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/bb-slp-24.c 2017-11-03 16:06:03.051282010 +0000 @@ -9,7 +9,7 @@ #define N 256 short src[N], dst[N]; void foo (short * __restrict__ dst, short * __restrict__ src, int h, - int stride, int dummy) + int stride) { int i; h /= 8; @@ -25,8 +25,7 @@ void foo (short * __restrict__ dst, shor dst[7] += A*src[7]; dst += stride; src += stride; - if (dummy == 32) - abort (); + asm volatile ("" ::: "memory"); } } @@ -43,7 +42,7 @@ int main (void) src[i] = i; } - foo (dst, src, N, 8, 0); + foo (dst, src, N, 8); for (i = 0; i < N; i++) { Index: gcc/testsuite/gcc.dg/vect/bb-slp-25.c =================================================================== --- gcc/testsuite/gcc.dg/vect/bb-slp-25.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/bb-slp-25.c 2017-11-03 16:06:03.051282010 +0000 @@ -9,7 +9,8 @@ #define N 256 short src[N], dst[N]; -void foo (short * __restrict__ dst, short * __restrict__ src, int h, int stride, int dummy) +void foo (short * __restrict__ dst, short * __restrict__ src, int h, + int stride) { int i; h /= 16; @@ -25,8 +26,7 @@ void foo (short * __restrict__ dst, shor dst[7] += A*src[7] + src[7+stride]; dst += 8; src += 8; - if (dummy == 32) - abort (); + asm volatile ("" ::: "memory"); } } @@ -43,7 +43,7 @@ int main (void) src[i] = i; } - foo (dst, src, N, 8, 0); + foo (dst, src, N, 8); for (i = 0; i < N/2; i++) { Index: gcc/testsuite/gcc.dg/vect/bb-slp-26.c =================================================================== --- gcc/testsuite/gcc.dg/vect/bb-slp-26.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/bb-slp-26.c 2017-11-03 16:06:03.052282173 +0000 @@ -10,8 +10,7 @@ #define N 256 char src[N], dst[N]; void __attribute__((noinline,noclone)) -foo (char * __restrict__ dst, char * __restrict__ src, int h, - int stride, int dummy) +foo (char * __restrict__ dst, char * __restrict__ src, int h, int stride) { int i; h /= 16; @@ -27,8 +26,7 @@ foo (char * __restrict__ dst, char * __r dst[7] += A*src[7] + src[7+stride]; dst += 8; src += 8; - if (dummy == 32) - abort (); + asm volatile ("" ::: "memory"); } } @@ -45,7 +43,7 @@ int main (void) src[i] = i/8; } - foo (dst, src, N, 8, 0); + foo (dst, src, N, 8); for (i = 0; i < N/2; i++) { Index: gcc/testsuite/gcc.dg/vect/bb-slp-29.c =================================================================== --- gcc/testsuite/gcc.dg/vect/bb-slp-29.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/bb-slp-29.c 2017-11-03 16:06:03.052282173 +0000 @@ -9,7 +9,8 @@ #define N 256 short src[N], dst[N]; -void foo (short * __restrict__ dst, short * __restrict__ src, int h, int stride, int dummy) +void foo (short * __restrict__ dst, short * __restrict__ src, int h, + int stride) { int i; h /= 16; @@ -25,8 +26,7 @@ void foo (short * __restrict__ dst, shor dst[7] = A*src[7] + B*src[8]; dst += stride; src += stride; - if (dummy == 32) - abort (); + asm volatile ("" ::: "memory"); } } @@ -43,7 +43,7 @@ int main (void) src[i] = i; } - foo (dst, src, N, 8, 0); + foo (dst, src, N, 8); for (i = 0; i < N/2; i++) { Index: gcc/testsuite/gcc.dg/vect/no-vfa-vect-102.c =================================================================== --- gcc/testsuite/gcc.dg/vect/no-vfa-vect-102.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/no-vfa-vect-102.c 2017-11-03 16:06:03.052282173 +0000 @@ -14,7 +14,6 @@ struct extraction static int a[N] = {1,2,3,4,5,6,7,8,9}; static int b[N] = {2,3,4,5,6,7,8,9,9}; -volatile int foo; __attribute__ ((noinline)) int main1 (int x, int y) { @@ -24,9 +23,8 @@ int main1 (int x, int y) { for (i = 0; i < N; i++) { - p->a[i] = a[i]; - if (foo == 135) - abort (); /* to avoid vectorization */ + p->a[i] = a[i]; + asm volatile ("" ::: "memory"); } /* Not vectorizable: distance 1. */ @@ -48,7 +46,6 @@ int main (void) { check_vect (); - foo = 0; return main1 (0, N); } Index: gcc/testsuite/gcc.dg/vect/no-vfa-vect-102a.c =================================================================== --- gcc/testsuite/gcc.dg/vect/no-vfa-vect-102a.c 2015-06-02 23:53:35.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/no-vfa-vect-102a.c 2017-11-03 16:06:03.052282173 +0000 @@ -14,7 +14,6 @@ struct extraction static int a[N] = {1,2,3,4,5,6,7,8,9}; static int b[N] = {2,3,4,5,6,7,8,9,9}; -volatile int foo; __attribute__ ((noinline)) int main1 (int x, int y) { @@ -24,9 +23,8 @@ int main1 (int x, int y) { for (i = 0; i < N; i++) { - p->a[i] = a[i]; - if (foo == 135) - abort (); /* to avoid vectorization */ + p->a[i] = a[i]; + asm volatile ("" ::: "memory"); } /* Not vectorizable: distance 1. */ @@ -48,7 +46,6 @@ int main (void) { check_vect (); - foo = 0; return main1 (0, N); } Index: gcc/testsuite/gcc.dg/vect/vect-103.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-103.c 2017-05-31 13:03:54.441152727 +0100 +++ gcc/testsuite/gcc.dg/vect/vect-103.c 2017-11-03 16:06:03.054282499 +0000 @@ -15,7 +15,6 @@ struct extraction static int a[N] = {1,2,3,4,5,6,7,8,9}; static int b[N] = {17,24,7,0,2,3,4,31,82}; static int c[N] = {9,17,24,7,0,2,3,4,31}; -volatile int foo; __attribute__ ((noinline)) int main1 (int x, int y) { @@ -25,10 +24,9 @@ int main1 (int x, int y) { for (i = 0; i < N; i++) { - p->a[i] = a[i]; - p->b[i] = b[i]; - if (foo == 135) - abort (); /* to avoid vectorization */ + p->a[i] = a[i]; + p->b[i] = b[i]; + asm volatile ("" ::: "memory"); } /* Vectorizable: distance > VF. */ @@ -50,7 +48,6 @@ int main (void) { check_vect (); - foo = 0; return main1 (0, N); } Index: gcc/testsuite/gcc.dg/vect/vect-104.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-104.c 2017-05-03 08:46:27.807861752 +0100 +++ gcc/testsuite/gcc.dg/vect/vect-104.c 2017-11-03 16:06:03.054282499 +0000 @@ -16,7 +16,6 @@ struct extraction static int a[N][N] = {{1,2,3},{4,5,6},{7,8,9}}; static int b[N][N] = {{17,24,7},{0,2,3},{4,31,82}}; static int c[N][N] = {{1,2,3},{4,5,5},{5,5,5}}; -volatile int foo; __attribute__ ((noinline)) int main1 (int x) { @@ -30,8 +29,7 @@ int main1 (int x) { { p->a[i][j] = a[i][j]; p->b[i][j] = b[i][j]; - if (foo == 135) - abort (); /* to avoid vectorization */ + asm volatile ("" ::: "memory"); } } @@ -60,7 +58,6 @@ int main (void) { check_vect (); - foo = 0; return main1 (N); } Index: gcc/testsuite/gcc.dg/vect/pr42709.c =================================================================== --- gcc/testsuite/gcc.dg/vect/pr42709.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/pr42709.c 2017-11-03 16:06:03.052282173 +0000 @@ -9,7 +9,7 @@ #define N 128 int *res[N]; int -main1 (int *a, int *b, int *c, int *d, int dummy) +main1 (int *a, int *b, int *c, int *d) { int i; @@ -19,8 +19,7 @@ main1 (int *a, int *b, int *c, int *d, i res[i+1] = b + 16; res[i+2] = c + 16; res[i+3] = d + 16; - if (dummy == 32) - abort (); + asm volatile ("" ::: "memory"); } } Index: gcc/testsuite/gcc.dg/vect/slp-13-big-array.c =================================================================== --- gcc/testsuite/gcc.dg/vect/slp-13-big-array.c 2017-06-08 08:51:43.124296047 +0100 +++ gcc/testsuite/gcc.dg/vect/slp-13-big-array.c 2017-11-03 16:06:03.052282173 +0000 @@ -4,7 +4,6 @@ #include "tree-vect.h" #define N 64 -volatile int y = 0; int main1 () @@ -18,8 +17,7 @@ main1 () for (i = 0; i < N*8; i++) { in[i] = in2[i] = i; - if (y) /* Avoid vectorization. */ - abort (); + asm volatile ("" ::: "memory"); } /* Induction is SLPable. */ Index: gcc/testsuite/gcc.dg/vect/slp-3-big-array.c =================================================================== --- gcc/testsuite/gcc.dg/vect/slp-3-big-array.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/slp-3-big-array.c 2017-11-03 16:06:03.053282336 +0000 @@ -6,7 +6,6 @@ #define N 96 unsigned short in[N*8]; -volatile int y = 0; int main1 () @@ -17,8 +16,7 @@ main1 () for (i = 0; i < N*8; i++) { in[i] = i&63; - if (y) /* Avoid vectorization. */ - abort (); + asm volatile ("" ::: "memory"); } for (i = 0; i < N; i++) Index: gcc/testsuite/gcc.dg/vect/slp-34-big-array.c =================================================================== --- gcc/testsuite/gcc.dg/vect/slp-34-big-array.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/slp-34-big-array.c 2017-11-03 16:06:03.053282336 +0000 @@ -7,7 +7,6 @@ #define N 64 unsigned short in[N*8]; unsigned short in2[N*8]; -volatile int y = 0; int main1 () @@ -19,8 +18,7 @@ main1 () for (i = 0; i < N*8; i++) { in[i] = in2[i] = i; - if (y) /* Avoid vectorization. */ - abort (); + asm volatile ("" ::: "memory"); } /* SLP with unrolling by 8. */ Index: gcc/testsuite/gcc.dg/vect/slp-4-big-array.c =================================================================== --- gcc/testsuite/gcc.dg/vect/slp-4-big-array.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/slp-4-big-array.c 2017-11-03 16:06:03.053282336 +0000 @@ -4,7 +4,6 @@ #include "tree-vect.h" #define N 128 -volatile int y = 0; int main1 () @@ -17,8 +16,7 @@ main1 () for (i = 0; i < N*8; i++) { in[i] = i; - if (y) /* Avoid vectorization. */ - abort (); + asm volatile ("" ::: "memory"); } for (i = 0; i < N; i++) Index: gcc/testsuite/gcc.dg/vect/slp-multitypes-11-big-array.c =================================================================== --- gcc/testsuite/gcc.dg/vect/slp-multitypes-11-big-array.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/slp-multitypes-11-big-array.c 2017-11-03 16:06:03.053282336 +0000 @@ -13,7 +13,6 @@ struct s }; char in[N*3]; -volatile int y = 0; __attribute__ ((noinline)) int main1 () @@ -24,8 +23,7 @@ main1 () for (i = 0; i < N; i++) { in[i] = i&127; - if (y) /* Avoid vectorization. */ - abort (); + asm volatile ("" ::: "memory"); } for (i = 0; i < N; i++) Index: gcc/testsuite/gcc.dg/vect/vect-105.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-105.c 2015-06-02 23:53:35.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/vect-105.c 2017-11-03 16:06:03.054282499 +0000 @@ -16,8 +16,6 @@ static int a[N][N] = {{1,2,3,11},{4,5,6, static int b[N][N] = {{17,28,15,23},{0,2,3,24},{4,31,82,25},{29,31,432,256}}; static int c[N][N] = {{1,2,3,11},{4,9,13,34},{45,67,83,13},{34,45,67,83}}; -volatile int y; - __attribute__ ((noinline)) int main1 (int x) { int i,j; @@ -30,10 +28,7 @@ int main1 (int x) { { p->a[i][j] = a[i][j]; p->b[i][j] = b[i][j]; - /* Because Y is volatile, the compiler cannot move this check out - of the loop. */ - if (y) - abort (); /* to avoid vectorization */ + asm volatile ("" ::: "memory"); } } Index: gcc/testsuite/gcc.dg/vect/vect-105-big-array.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-105-big-array.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/vect-105-big-array.c 2017-11-03 16:06:03.054282499 +0000 @@ -16,8 +16,6 @@ struct extraction static int b[N][N]; static int c[N][N]; -volatile int y; - __attribute__ ((noinline)) int main1 (int x) { int i,j, off; @@ -29,8 +27,7 @@ int main1 (int x) { { a[i][j] = (i*7 + j*17)%53; b[i][j] = (i*11+ j*13)%41; - if (y) - abort (); /* to avoid vectorization. */ + asm volatile ("" ::: "memory"); } } for (i = 0; i < N; i++) @@ -38,8 +35,7 @@ int main1 (int x) { for (j = 0; j < N; j++) { c[i][j] = a[i][j]; - if (y) - abort (); /* to avoid vectorization. */ + asm volatile ("" ::: "memory"); } } for (i = 1; i < N; i++) @@ -53,8 +49,7 @@ int main1 (int x) { *(&c[0][0]+x+i+j) = *(&b[0][0] + off - N*N); else *(&c[0][0]+x+i+j) = *(&a[0][0] + off); - if (y) - abort (); /* to avoid vectorization. */ + asm volatile ("" ::: "memory"); } } @@ -64,10 +59,7 @@ int main1 (int x) { { p->a[i][j] = a[i][j]; p->b[i][j] = b[i][j]; - /* Because Y is volatile, the compiler cannot move this check out - of the loop. */ - if (y) - abort (); /* to avoid vectorization. */ + asm volatile ("" ::: "memory"); } } Index: gcc/testsuite/gcc.dg/vect/vect-112-big-array.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-112-big-array.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/vect-112-big-array.c 2017-11-03 16:06:03.054282499 +0000 @@ -8,8 +8,6 @@ #define N 128 char cb[N]; char cc[N]; -volatile int y = 0; - __attribute__ ((noinline)) int main1 (void) { @@ -20,9 +18,7 @@ main1 (void) cb[i] = i + 2; cc[i] = i + 1; check_diff += (cb[i] - cc[i]); - /* Avoid vectorization. */ - if (y) - abort (); + asm volatile ("" ::: "memory"); } /* Cross-iteration cycle. */ Index: gcc/testsuite/gcc.dg/vect/vect-15-big-array.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-15-big-array.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/vect-15-big-array.c 2017-11-03 16:06:03.054282499 +0000 @@ -5,8 +5,6 @@ #define N 128 -volatile int y = 0; - __attribute__ ((noinline)) int main1 () { @@ -17,8 +15,7 @@ int main1 () for (i = 0; i X-Patchwork-Id: 117938 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp3652435qgn; Fri, 3 Nov 2017 09:18:03 -0700 (PDT) X-Google-Smtp-Source: ABhQp+TUdvl7pM5BkB1xVx/FRhmZMIHz7z5WOsvF5Yo61u6llhdxWS05A4aHmqs27r4e2ApLGoXE X-Received: by 10.99.127.67 with SMTP id p3mr7620008pgn.321.1509725883351; Fri, 03 Nov 2017 09:18:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509725883; cv=none; d=google.com; s=arc-20160816; b=tpYEDNq6krpIEnm1Fd3UvbKx9CHkm6gTHYlmxvUj2WERbPuUZTDkHgXrcj2IYV9mer rrBMKGbh+0VNgp61CuQlHnRecNl4Ye9h+46Lc1hKtomMNLEgjUufzG4ZQrb3uqXVRaen 1V8tdjcgYO1bP0/jsBlVvpRuztYobXNkSMUAClgYD7HhOsAUFIuPzFroQD9drMXUfIf3 4P0nj4EcBgj5CPuC6ObxfT07aO2xSBILekOyDXn6/UQNnE4cMLJ9aYdeqkOd0oAS3fJV eL0KldPkI5tQko+/CXp0LQpnbpB/aukBkvhUaoK4IXEcd/bK9nAaG0kD89aP9csmuD3c tixA== 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=FIdnN0766nsghzlPU94WqxE0czx18VssTfCQVhhN9Po=; b=Hh411NjC3qUzTWM6cm/mwoQv/qERpdH4yuZCTCB6VkJdEp+VKAPQOSj+eXKZJHjnGl gXs26hOjxCL7QIP7BDXHV4QGlkxZTxZZWJmV1mUjJ/DpWQWr5X6tb673O/uCJJ2klgkE oW4Lo60/C61WFpTnuhtxj85gVeamj2eqg74JFxVuGdC+OHHWV+gGO7A91GiucCgpFCEb Ux7er0/SqS1z2EYCS3QH7mztQPMfZ/sxeRrQZu45WrKaWtWhWIttdNTq1R7GLXLXIl4p JJQntPpfnpYfnxarU7zA00FNRV+jww3Pa0WAsXPTNjjJjgpwSGfwacTCPhUxOpxB+4Sz oMMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=W761Cngh; spf=pass (google.com: domain of gcc-patches-return-465872-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-465872-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 b123si6255980pgc.302.2017.11.03.09.18.02 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Nov 2017 09:18:03 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-465872-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=W761Cngh; spf=pass (google.com: domain of gcc-patches-return-465872-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-465872-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=RYWYDh+Qmx4n9WgB+ZhIo54EadJ6/ 0Y/mU7jG3om1e0FA2x2cMnbbsBQ923klzzGg7ESUQLswHLfkEf60y6EDklS/gmuM XkDdNgcKNZFAa0fbrqmFHdE4A5XduYlagPyZ/ihuGutHWonp0lcIODxDUmQcKdLt yWtSVIFXKej25I= 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=wE4SM7Tr9HCGEUKoto3S4w2njvk=; b=W76 1CnghVNAUdT0FuxJFpcTauT4kPawcv9ZT+lrZblbPYagBEI099HD6moD2dsB4+NL IueHQfoX+dQ7db9rGWRJTq0ZxG1IzgH+EEi5PcQbV4t/RHz7ZMT/+N6bo8GFj2ke 1qTqPdgNsfM7NzRLfsy8DsBkSYBeyngq+AnxQ6F0= Received: (qmail 22215 invoked by alias); 3 Nov 2017 16:17:42 -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 21614 invoked by uid 89); 3 Nov 2017 16:17:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-10.5 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=influence, rgb, UD:section-anchors-vect-69.c, pr659475c X-HELO: mail-wr0-f175.google.com Received: from mail-wr0-f175.google.com (HELO mail-wr0-f175.google.com) (209.85.128.175) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 03 Nov 2017 16:17:36 +0000 Received: by mail-wr0-f175.google.com with SMTP id l1so2976486wrc.3 for ; Fri, 03 Nov 2017 09:17:35 -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=FIdnN0766nsghzlPU94WqxE0czx18VssTfCQVhhN9Po=; b=mLgkY7wxM6vYoTW+HPbZfa9NlaadZODEcqUGFMDj0JYCR6adPufQVuzxP1KrfpcKZG og2pWlXdUO+zQJdredscnblvz4oz4aJFUHHvE2RcB+xkxzulrgxJVCH1BjOPz07G0veo 7v7cVoILM58ZlGTcpaYkqWdAJbZ3y2EINQDRp/N8aKTOAWCTKXFjDKx1ZRvuJ/umiqjk Y/S94nkvOGWzWsDGnCIwNVMLlO+oRbNnAFNBjyPDp6hyZxlRfAMXWjFcqzVbLP5YJp/D t9w4NnXs8DCKoyS2e383n0MoHe7xg8xwl/ogIFaRBYgn50KaQ36MKg+7gaHHvItWlC9r ur9w== X-Gm-Message-State: AMCzsaVZ/XABvsnWN6QsHb02CIo5zJRGJigPBMn0XvdMBuatFIIt/7+d ocKUX0ttOAqN2Uat8m+x8gsJX8JoFgQ= X-Received: by 10.223.157.11 with SMTP id k11mr6694046wre.281.1509725852385; Fri, 03 Nov 2017 09:17:32 -0700 (PDT) Received: from localhost (188.29.164.162.threembb.co.uk. [188.29.164.162]) by smtp.gmail.com with ESMTPSA id c3sm3599111wrd.44.2017.11.03.09.17.30 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 Nov 2017 09:17:31 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@linaro.org Subject: [2/10] Add VECTOR_BITS to tree-vect.h References: <87inerqqyz.fsf@linaro.org> Date: Fri, 03 Nov 2017 16:17:28 +0000 In-Reply-To: <87inerqqyz.fsf@linaro.org> (Richard Sandiford's message of "Fri, 03 Nov 2017 16:14:44 +0000") Message-ID: <878tfnqquf.fsf@linaro.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Several vector tests are sensitive to the vector size. This patch adds a VECTOR_BITS macro to tree-vect.h to select the expected vector size and uses it to influence iteration counts and array sizes. The tests keep the original values if the vector size is small enough. For now VECTOR_BITS is always 128, but the SVE patches add other values. 2017-11-03 Richard Sandiford Alan Hayward David Sherwood gcc/testsuite/ * gcc.dg/vect/tree-vect.h (VECTOR_BITS): Define. * gcc.dg/vect/bb-slp-pr69907.c: Include tree-vect.h. (N): New macro. (foo): Use it instead of hard-coded 320. * gcc.dg/vect/no-scevccp-outer-7.c (N): Redefine if the default value is too small for VECTOR_BITS. * gcc.dg/vect/no-scevccp-vect-iv-3.c (N): Likewise. * gcc.dg/vect/no-section-anchors-vect-31.c (N): Likewise. * gcc.dg/vect/no-section-anchors-vect-36.c (N): Likewise. * gcc.dg/vect/slp-perm-9.c (N): Likewise. * gcc.dg/vect/vect-32.c (N): Likewise. * gcc.dg/vect/vect-75.c (N, OFF): Likewise. * gcc.dg/vect/vect-77-alignchecks.c (N, OFF): Likewise. * gcc.dg/vect/vect-78-alignchecks.c (N, OFF): Likewise. * gcc.dg/vect/vect-89.c (N): Likewise. * gcc.dg/vect/vect-96.c (N): Likewise. * gcc.dg/vect/vect-multitypes-3.c (N): Likewise. * gcc.dg/vect/vect-multitypes-6.c (N): Likewise. * gcc.dg/vect/vect-over-widen-1.c (N): Likewise. * gcc.dg/vect/vect-over-widen-4.c (N): Likewise. * gcc.dg/vect/vect-reduc-pattern-1a.c (N): Likewise. * gcc.dg/vect/vect-reduc-pattern-1b.c (N): Likewise. * gcc.dg/vect/vect-reduc-pattern-2a.c (N): Likewise. * gcc.dg/vect/no-section-anchors-vect-64.c (NINTS): New macro. (N): Redefine in terms of NINTS. (ia, ib, ic): Use NINTS instead of hard-coded constants in the array bounds. * gcc.dg/vect/no-section-anchors-vect-69.c (NINTS): New macro. (N): Redefine in terms of NINTS. (test1): Replace a and b fields with NINTS - 2 ints of padding. (main1): Use NINTS instead of hard-coded constants. * gcc.dg/vect/section-anchors-vect-69.c (NINTS): New macro. (N): Redefine in terms of NINTS. (test1): Replace a and b fields with NINTS - 2 ints of padding. (test2): Remove incorrect comments about alignment. (main1): Use NINTS instead of hard-coded constants. * gcc.dg/vect/pr45752.c (N): Redefine if the default value is too small for VECTOR_BITS. (main): Continue to use canned results for the default value of N, but compute the expected results from scratch for other values. * gcc.dg/vect/slp-perm-1.c (N, main): As for pr45752.c. * gcc.dg/vect/slp-perm-4.c (N, main): Likewise. * gcc.dg/vect/slp-perm-5.c (N, main): Likewise. * gcc.dg/vect/slp-perm-6.c (N, main): Likewise. * gcc.dg/vect/slp-perm-7.c (N, main): Likewise. * gcc.dg/vect/pr65518.c (NINTS, N, RESULT): New macros. (giga): Use NINTS as the array bound. (main): Use NINTS, N and RESULT. * gcc.dg/vect/pr65947-5.c (N): Redefine if the default value is too small for VECTOR_BITS. (main): Fill in any remaining elements of A programmatically. * gcc.dg/vect/pr81136.c: Include tree-vect.h. (a): Use VECTOR_BITS to set the alignment of the target structure. * gcc.dg/vect/slp-19c.c (N): Redefine if the default value is too small for VECTOR_BITS. (main1): Continue to use the canned input for the default value of N, but compute the input from scratch for other values. * gcc.dg/vect/slp-28.c (N): Redefine if the default value is too small for VECTOR_BITS. (in1, in2, in3): Remove initialization. (check1, check2): Delete. (main1): Initialize in1, in2 and in3 here. Check every element of the vectors and compute the expected values directly instead of using an array. * gcc.dg/vect/slp-perm-8.c (N): Redefine if the default value is too small for VECTOR_BITS. (foo, main): Change type of "i" to int. * gcc.dg/vect/vect-103.c (NINTS): New macro. (N): Redefine in terms of N. (c): Delete. (main1): Use NINTS. Check the result from a and b directly. * gcc.dg/vect/vect-67.c (NINTS): New macro. (N): Redefine in terms of N. (main1): Use NINTS for the inner array bounds. * gcc.dg/vect/vect-70.c (NINTS, OUTERN): New macros. (N): Redefine in terms of NINTS. (s): Keep the outer dimensions as 4 even if N is larger than 24. (tmp1): New variable. (main1): Only define a local tmp1 if NINTS is relatively small. Use OUTERN for the outer loops and NINTS for the inner loops. * gcc.dg/vect/vect-91.c (OFF): New macro. (a, main3): Use it. * gcc.dg/vect/vect-92.c (NITER): New macro. (main1, main2): Use it. * gcc.dg/vect/vect-93.c (N): Rename to... (N1): ...this. (main): Update accordingly. (N2): New macro. (main1): Use N1 instead of 3001 and N2 insteaed of 10. * gcc.dg/vect/vect-multitypes-1.c (NSHORTS, NINTS): New macros. (N): Redefine in terms of NSHORTS. (main1): Use NINTS - 1 instead of 3 and NSHORTS - 1 instead of 7. (main): Likewise. * gcc.dg/vect/vect-over-widen-3-big-array.c (N): Define to VECTOR_BITS. (foo): Truncate the expected value to the type of *d. * gcc.dg/vect/vect-peel-3.c (NINTS, EXTRA): New macros. (ia, ib, ic, main): Use EXTRA. (main): Use NINTS. (RES_A, RES_B, REC_C): New macros. (RES): Redefine as their sum. * gcc.dg/vect/vect-reduc-or_1.c (N): New macro. (in): Change number of elements to N. (main): Update accordingly. Calculate the expected result. * gcc.dg/vect/vect-reduc-or_2.c (N, in, main): As for vect-reduc-or-1.c. Index: gcc/testsuite/gcc.dg/vect/tree-vect.h =================================================================== --- gcc/testsuite/gcc.dg/vect/tree-vect.h 2016-11-22 21:16:10.000000000 +0000 +++ gcc/testsuite/gcc.dg/vect/tree-vect.h 2017-11-03 16:06:08.012090077 +0000 @@ -75,3 +75,5 @@ check_vect (void) #endif signal (SIGILL, SIG_DFL); } + +#define VECTOR_BITS 128 Index: gcc/testsuite/gcc.dg/vect/bb-slp-pr69907.c =================================================================== --- gcc/testsuite/gcc.dg/vect/bb-slp-pr69907.c 2016-05-02 10:44:34.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/bb-slp-pr69907.c 2017-11-03 16:06:08.010089752 +0000 @@ -2,10 +2,18 @@ /* { dg-additional-options "-O3" } */ /* { dg-require-effective-target vect_unpack } */ +#include "tree-vect.h" + +#if VECTOR_BITS > 512 +#define N (VECTOR_BITS * 10 / 16) +#else +#define N 320 +#endif + void foo(unsigned *p1, unsigned short *p2) { int n; - for (n = 0; n < 320; n++) + for (n = 0; n < N; n++) p1[n] = p2[n * 2]; } Index: gcc/testsuite/gcc.dg/vect/no-scevccp-outer-7.c =================================================================== --- gcc/testsuite/gcc.dg/vect/no-scevccp-outer-7.c 2017-05-03 08:46:27.807861752 +0100 +++ gcc/testsuite/gcc.dg/vect/no-scevccp-outer-7.c 2017-11-03 16:06:08.010089752 +0000 @@ -4,7 +4,11 @@ #include #include "tree-vect.h" +#if VECTOR_BITS > 256 +#define N (VECTOR_BITS / 16) +#else #define N 16 +#endif unsigned short in[N]; unsigned short coef[N]; Index: gcc/testsuite/gcc.dg/vect/no-scevccp-vect-iv-3.c =================================================================== --- gcc/testsuite/gcc.dg/vect/no-scevccp-vect-iv-3.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/no-scevccp-vect-iv-3.c 2017-11-03 16:06:08.010089752 +0000 @@ -4,7 +4,11 @@ #include #include "tree-vect.h" +#if VECTOR_BITS > 256 +#define N (VECTOR_BITS / 16 + 10) +#else #define N 26 +#endif __attribute__ ((noinline)) unsigned int main1 () Index: gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-31.c =================================================================== --- gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-31.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-31.c 2017-11-03 16:06:08.010089752 +0000 @@ -4,7 +4,12 @@ #include #include "tree-vect.h" +/* N / 2 bytes has to be worth vectorizing even with peeling. */ +#if VECTOR_BITS > 128 +#define N (VECTOR_BITS * 4 / 8) +#else #define N 64 +#endif struct t{ int k[N]; Index: gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-36.c =================================================================== --- gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-36.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-36.c 2017-11-03 16:06:08.010089752 +0000 @@ -4,7 +4,11 @@ #include #include "tree-vect.h" +#if VECTOR_BITS > 128 +#define N (VECTOR_BITS * 2 / 8) +#else #define N 32 +#endif struct { char ca[N]; Index: gcc/testsuite/gcc.dg/vect/slp-perm-9.c =================================================================== --- gcc/testsuite/gcc.dg/vect/slp-perm-9.c 2017-11-03 16:06:03.054282499 +0000 +++ gcc/testsuite/gcc.dg/vect/slp-perm-9.c 2017-11-03 16:06:08.012090077 +0000 @@ -3,7 +3,11 @@ #include #include "tree-vect.h" +#if VECTOR_BITS > 512 +#define N (VECTOR_BITS * 6 / 16) +#else #define N 200 +#endif void __attribute__((noinline)) foo (unsigned short *__restrict__ pInput, unsigned short *__restrict__ pOutput) Index: gcc/testsuite/gcc.dg/vect/vect-32.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-32.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/vect-32.c 2017-11-03 16:06:08.012090077 +0000 @@ -3,8 +3,12 @@ #include #include "tree-vect.h" +#if VECTOR_BITS > 128 +#define N (VECTOR_BITS / 8) +#else #define N 16 - +#endif + __attribute__ ((noinline)) int main1 () { Index: gcc/testsuite/gcc.dg/vect/vect-75.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-75.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/vect-75.c 2017-11-03 16:06:08.013090240 +0000 @@ -3,8 +3,13 @@ #include #include "tree-vect.h" +#if VECTOR_BITS > 128 +#define N (VECTOR_BITS * 2 / 32) +#define OFF (VECTOR_BITS / 32) +#else #define N 8 #define OFF 8 +#endif /* Check handling of accesses for which the "initial condition" - the expression that represents the first location accessed - is Index: gcc/testsuite/gcc.dg/vect/vect-77-alignchecks.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-77-alignchecks.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/vect-77-alignchecks.c 2017-11-03 16:06:08.013090240 +0000 @@ -3,8 +3,13 @@ #include #include "tree-vect.h" +#if VECTOR_BITS > 128 +#define N (VECTOR_BITS * 2 / 32) +#define OFF (VECTOR_BITS / 32) +#else #define N 8 #define OFF 8 +#endif /* Check handling of accesses for which the "initial condition" - the expression that represents the first location accessed - is Index: gcc/testsuite/gcc.dg/vect/vect-78-alignchecks.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-78-alignchecks.c 2017-07-29 16:32:10.909577688 +0100 +++ gcc/testsuite/gcc.dg/vect/vect-78-alignchecks.c 2017-11-03 16:06:08.013090240 +0000 @@ -3,8 +3,13 @@ #include #include "tree-vect.h" +#if VECTOR_BITS > 128 +#define N (VECTOR_BITS * 2 / 32) +#define OFF (VECTOR_BITS / 32) +#else #define N 8 #define OFF 8 +#endif /* Check handling of accesses for which the "initial condition" - the expression that represents the first location accessed - is Index: gcc/testsuite/gcc.dg/vect/vect-89.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-89.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/vect-89.c 2017-11-03 16:06:08.013090240 +0000 @@ -3,7 +3,11 @@ #include #include "tree-vect.h" +#if VECTOR_BITS > 256 +#define N (VECTOR_BITS * 2 / 32) +#else #define N 16 +#endif struct tmp_struct { Index: gcc/testsuite/gcc.dg/vect/vect-96.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-96.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/vect-96.c 2017-11-03 16:06:08.013090240 +0000 @@ -4,7 +4,11 @@ #include #include "tree-vect.h" +#if VECTOR_BITS > 256 +#define N (VECTOR_BITS * 2 / 32) +#else #define N 16 +#endif struct tmp { Index: gcc/testsuite/gcc.dg/vect/vect-multitypes-3.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-multitypes-3.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/vect-multitypes-3.c 2017-11-03 16:06:08.014090402 +0000 @@ -4,7 +4,11 @@ #include #include "tree-vect.h" +#if VECTOR_BITS > 128 +#define N (VECTOR_BITS * 2 / 8) +#else #define N 32 +#endif int ib[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; Index: gcc/testsuite/gcc.dg/vect/vect-multitypes-6.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-multitypes-6.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/vect-multitypes-6.c 2017-11-03 16:06:08.014090402 +0000 @@ -4,7 +4,11 @@ #include #include "tree-vect.h" +#if VECTOR_BITS > 128 +#define N (VECTOR_BITS * 2 / 8) +#else #define N 32 +#endif unsigned int ic[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; Index: gcc/testsuite/gcc.dg/vect/vect-over-widen-1.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-over-widen-1.c 2016-01-13 13:48:42.000000000 +0000 +++ gcc/testsuite/gcc.dg/vect/vect-over-widen-1.c 2017-11-03 16:06:08.014090402 +0000 @@ -4,7 +4,11 @@ #include #include "tree-vect.h" +#if VECTOR_BITS > 128 +#define N (VECTOR_BITS * 8 / 16) +#else #define N 64 +#endif /* Modified rgb to rgb conversion from FFmpeg. */ __attribute__ ((noinline)) void Index: gcc/testsuite/gcc.dg/vect/vect-over-widen-4.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-over-widen-4.c 2016-01-13 13:48:42.000000000 +0000 +++ gcc/testsuite/gcc.dg/vect/vect-over-widen-4.c 2017-11-03 16:06:08.014090402 +0000 @@ -4,7 +4,11 @@ #include #include "tree-vect.h" +#if VECTOR_BITS > 128 +#define N (VECTOR_BITS * 8 / 16) +#else #define N 64 +#endif /* Modified rgb to rgb conversion from FFmpeg. */ __attribute__ ((noinline)) int Index: gcc/testsuite/gcc.dg/vect/vect-reduc-pattern-1a.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-reduc-pattern-1a.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/vect-reduc-pattern-1a.c 2017-11-03 16:06:08.014090402 +0000 @@ -3,7 +3,12 @@ #include #include "tree-vect.h" +#if VECTOR_BITS > 128 +#define N (VECTOR_BITS * 2 / 16) +#else #define N 16 +#endif + unsigned short udata_sh[N] = { 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28 }; #define SUM 210 Index: gcc/testsuite/gcc.dg/vect/vect-reduc-pattern-1b.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-reduc-pattern-1b.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/vect-reduc-pattern-1b.c 2017-11-03 16:06:08.015090565 +0000 @@ -3,7 +3,12 @@ #include #include "tree-vect.h" +#if VECTOR_BITS > 128 +#define N (VECTOR_BITS * 2 / 16) +#else #define N 16 +#endif + unsigned char udata_ch[N] = { 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28 }; #define SUM 210 Index: gcc/testsuite/gcc.dg/vect/vect-reduc-pattern-2a.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-reduc-pattern-2a.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/vect-reduc-pattern-2a.c 2017-11-03 16:06:08.015090565 +0000 @@ -3,7 +3,12 @@ #include #include "tree-vect.h" +#if VECTOR_BITS > 128 +#define N (VECTOR_BITS * 2 / 16) +#else #define N 16 +#endif + signed short data_sh[N] = { 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28 }; #define SUM 210 Index: gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-64.c =================================================================== --- gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-64.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-64.c 2017-11-03 16:06:08.010089752 +0000 @@ -4,12 +4,18 @@ #include #include "tree-vect.h" -#define N 16 +#if VECTOR_BITS > 128 +#define NINTS (VECTOR_BITS / 32) +#else +#define NINTS 4 +#endif + +#define N (NINTS * 4) int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; -int ia[N][4][N+1]; -int ic[N][N][3][2*N+2]; -int id[N][N][N+4]; +int ia[N][NINTS][N + 1]; +int ic[N][N][NINTS - 1][2 * N + 2]; +int id[N][N][N + NINTS]; __attribute__ ((noinline)) int main1 () Index: gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-69.c =================================================================== --- gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-69.c 2017-08-03 10:40:54.012104085 +0100 +++ gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-69.c 2017-11-03 16:06:08.011089914 +0000 @@ -5,7 +5,13 @@ #include #include "tree-vect.h" -#define N 24 +#if VECTOR_BITS > 128 +#define NINTS (VECTOR_BITS / 32) +#else +#define NINTS 4 +#endif + +#define N (NINTS * 6) struct s{ int m; @@ -19,8 +25,7 @@ struct s2{ struct test1{ struct s a; /* array a.n is unaligned */ - int b; - int c; + int pad[NINTS - 2]; struct s e; /* array e.n is aligned */ }; @@ -54,13 +59,13 @@ int main1 () } /* 2. aligned */ - for (i = 3; i < N-1; i++) + for (i = NINTS - 1; i < N - 1; i++) { tmp1[2].a.n[1][2][i] = 6; } /* check results: */ - for (i = 3; i < N-1; i++) + for (i = NINTS; i < N - 1; i++) { if (tmp1[2].a.n[1][2][i] != 6) abort (); @@ -86,18 +91,18 @@ int main1 () } /* 4. unaligned (unknown misalignment) */ - for (i = 0; i < N-4; i++) + for (i = 0; i < N - NINTS; i++) { - for (j = 0; j < N-4; j++) + for (j = 0; j < N - NINTS; j++) { tmp2[2].e.n[1][i][j] = 8; } } /* check results: */ - for (i = 0; i < N-4; i++) + for (i = 0; i < N - NINTS; i++) { - for (j = 0; j < N-4; j++) + for (j = 0; j < N - NINTS; j++) { if (tmp2[2].e.n[1][i][j] != 8) abort (); Index: gcc/testsuite/gcc.dg/vect/section-anchors-vect-69.c =================================================================== --- gcc/testsuite/gcc.dg/vect/section-anchors-vect-69.c 2017-08-03 10:40:54.013104709 +0100 +++ gcc/testsuite/gcc.dg/vect/section-anchors-vect-69.c 2017-11-03 16:06:08.011089914 +0000 @@ -4,7 +4,13 @@ #include #include "tree-vect.h" -#define N 32 +#if VECTOR_BITS > 128 +#define NINTS (VECTOR_BITS / 32) +#else +#define NINTS 4 +#endif + +#define N (NINTS * 8) struct s{ int m; @@ -18,16 +24,15 @@ struct s2{ struct test1{ struct s a; /* array a.n is unaligned */ - int b; - int c; + int pad[NINTS - 2]; struct s e; /* array e.n is aligned */ }; struct test2{ - struct s2 a; /* array a.n is unaligned */ + struct s2 a; int b; int c; - struct s2 e; /* array e.n is aligned */ + struct s2 e; }; @@ -52,13 +57,13 @@ int main1 () } /* 2. aligned */ - for (i = 3; i < N-1; i++) + for (i = NINTS - 1; i < N - 1; i++) { tmp1[2].a.n[1][2][i] = 6; } /* check results: */ - for (i = 3; i < N-1; i++) + for (i = NINTS - 1; i < N - 1; i++) { if (tmp1[2].a.n[1][2][i] != 6) abort (); @@ -84,18 +89,18 @@ int main1 () } /* 4. unaligned */ - for (i = 0; i < N-4; i++) + for (i = 0; i < N - NINTS; i++) { - for (j = 0; j < N-4; j++) + for (j = 0; j < N - NINTS; j++) { tmp2[2].e.n[1][i][j] = 8; } } /* check results: */ - for (i = 0; i < N-4; i++) + for (i = 0; i < N - NINTS; i++) { - for (j = 0; j < N-4; j++) + for (j = 0; j < N - NINTS; j++) { if (tmp2[2].e.n[1][i][j] != 8) abort (); Index: gcc/testsuite/gcc.dg/vect/pr45752.c =================================================================== --- gcc/testsuite/gcc.dg/vect/pr45752.c 2015-12-18 10:17:16.000000000 +0000 +++ gcc/testsuite/gcc.dg/vect/pr45752.c 2017-11-03 16:06:08.011089914 +0000 @@ -35,7 +35,11 @@ #define M24 115 #define M34 7716 #define M44 16 +#if VECTOR_BITS > 128 +#define N (VECTOR_BITS * 5 / 32) +#else #define N 20 +#endif void foo (unsigned int *__restrict__ pInput, unsigned int *__restrict__ pOutput, @@ -77,12 +81,6 @@ void foo (unsigned int *__restrict__ pIn int main (int argc, const char* argv[]) { unsigned int input[N], output[N], i, input2[N], output2[N]; - unsigned int check_results[N] - = {3208, 1334, 28764, 35679, 2789, 13028, 4754, 168364, 91254, 12399, - 22848, 8174, 307964, 146829, 22009, 32668, 11594, 447564, 202404, 31619 }; - unsigned int check_results2[N] - = {7136, 2702, 84604, 57909, 6633, 16956, 6122, 224204, 113484, 16243, - 26776, 9542, 363804, 169059, 25853, 36596, 12962, 503404, 224634, 35463 }; check_vect (); @@ -95,6 +93,57 @@ int main (int argc, const char* argv[]) __asm__ volatile (""); } +#if N == 20 + unsigned int check_results[N] + = { 3208, 1334, 28764, 35679, 2789, 13028, 4754, 168364, 91254, 12399, + 22848, 8174, 307964, 146829, 22009, 32668, 11594, 447564, 202404, + 31619 }; + unsigned int check_results2[N] + = { 7136, 2702, 84604, 57909, 6633, 16956, 6122, 224204, 113484, 16243, + 26776, 9542, 363804, 169059, 25853, 36596, 12962, 503404, 224634, + 35463 }; +#else + volatile unsigned int check_results[N]; + volatile unsigned int check_results2[N]; + + for (i = 0; i < N / 5; i++) + { + unsigned int a = input[i * 5]; + unsigned int b = input[i * 5 + 1]; + unsigned int c = input[i * 5 + 2]; + unsigned int d = input[i * 5 + 3]; + unsigned int e = input[i * 5 + 4]; + + check_results[i * 5] = M00 * a + M01 * b + M02 * c + M03 * d + M04 * e; + check_results[i * 5 + 1] = (M10 * a + M11 * b + M12 * c + + M13 * d + M14 * e); + check_results[i * 5 + 2] = (M20 * a + M21 * b + M22 * c + + M23 * d + M24 * e); + check_results[i * 5 + 3] = (M30 * a + M31 * b + M32 * c + + M33 * d + M34 * e); + check_results[i * 5 + 4] = (M40 * a + M41 * b + M42 * c + + M43 * d + M44 * e); + + a = input2[i * 5]; + b = input2[i * 5 + 1]; + c = input2[i * 5 + 2]; + d = input2[i * 5 + 3]; + e = input2[i * 5 + 4]; + + check_results2[i * 5] = M00 * a + M01 * b + M02 * c + M03 * d + M04 * e; + check_results2[i * 5 + 1] = (M10 * a + M11 * b + M12 * c + + M13 * d + M14 * e); + check_results2[i * 5 + 2] = (M20 * a + M21 * b + M22 * c + + M23 * d + M24 * e); + check_results2[i * 5 + 3] = (M30 * a + M31 * b + M32 * c + + M33 * d + M34 * e); + check_results2[i * 5 + 4] = (M40 * a + M41 * b + M42 * c + + M43 * d + M44 * e); + + asm volatile ("" ::: "memory"); + } +#endif + foo (input, output, input2, output2); for (i = 0; i < N; i++) Index: gcc/testsuite/gcc.dg/vect/slp-perm-1.c =================================================================== --- gcc/testsuite/gcc.dg/vect/slp-perm-1.c 2016-01-13 13:48:42.000000000 +0000 +++ gcc/testsuite/gcc.dg/vect/slp-perm-1.c 2017-11-03 16:06:08.011089914 +0000 @@ -13,7 +13,11 @@ #define M02 74 #define M12 191 #define M22 500 +#if VECTOR_BITS > 128 +#define N (VECTOR_BITS * 3 / 32 + 4) +#else #define N 16 +#endif void foo (unsigned int *__restrict__ pInput, unsigned int *__restrict__ pOutput) { @@ -34,7 +38,6 @@ void foo (unsigned int *__restrict__ pIn int main (int argc, const char* argv[]) { unsigned int input[N], output[N], i; - unsigned int check_results[N] = {1470, 395, 28271, 5958, 1655, 111653, 10446, 2915, 195035, 14934, 4175, 278417, 19422, 5435, 361799, 0}; check_vect (); @@ -45,6 +48,25 @@ int main (int argc, const char* argv[]) __asm__ volatile (""); } +#if N == 16 + unsigned int check_results[N] = {1470, 395, 28271, 5958, 1655, 111653, 10446, 2915, 195035, 14934, 4175, 278417, 19422, 5435, 361799, 0}; +#else + volatile unsigned int check_results[N] = {}; + + for (unsigned int i = 0; i < N / 3; i++) + { + unsigned int a = input[i * 3]; + unsigned int b = input[i * 3 + 1]; + unsigned int c = input[i * 3 + 2]; + + check_results[i * 3] = M00 * a + M01 * b + M02 * c; + check_results[i * 3 + 1] = M10 * a + M11 * b + M12 * c; + check_results[i * 3 + 2] = M20 * a + M21 * b + M22 * c; + + asm volatile ("" ::: "memory"); + } +#endif + foo (input, output); for (i = 0; i < N; i++) Index: gcc/testsuite/gcc.dg/vect/slp-perm-4.c =================================================================== --- gcc/testsuite/gcc.dg/vect/slp-perm-4.c 2017-11-03 16:06:03.053282336 +0000 +++ gcc/testsuite/gcc.dg/vect/slp-perm-4.c 2017-11-03 16:06:08.012090077 +0000 @@ -34,7 +34,11 @@ #define M24 115 #define M34 7716 #define M44 16 +#if VECTOR_BITS > 128 +#define N (VECTOR_BITS * 5 / 32) +#else #define N 20 +#endif void foo (unsigned int *__restrict__ pInput, unsigned int *__restrict__ pOutput) { @@ -59,9 +63,6 @@ void foo (unsigned int *__restrict__ pIn int main (int argc, const char* argv[]) { unsigned int input[N], output[N], i; - unsigned int check_results[N] - = {3208, 1334, 28764, 35679, 2789, 13028, 4754, 168364, 91254, 12399, - 22848, 8174, 307964, 146829, 22009, 32668, 11594, 447564, 202404, 31619}; check_vect (); @@ -72,6 +73,34 @@ int main (int argc, const char* argv[]) asm volatile ("" ::: "memory"); } +#if N == 20 + unsigned int check_results[N] + = {3208, 1334, 28764, 35679, 2789, 13028, 4754, 168364, 91254, 12399, + 22848, 8174, 307964, 146829, 22009, 32668, 11594, 447564, 202404, 31619}; +#else + volatile unsigned int check_results[N]; + + for (i = 0; i < N / 5; i++) + { + unsigned int a = input[i * 5]; + unsigned int b = input[i * 5 + 1]; + unsigned int c = input[i * 5 + 2]; + unsigned int d = input[i * 5 + 3]; + unsigned int e = input[i * 5 + 4]; + + check_results[i * 5] = M00 * a + M01 * b + M02 * c + M03 * d + M04 * e; + check_results[i * 5 + 1] = (M10 * a + M11 * b + M12 * c + + M13 * d + M14 * e); + check_results[i * 5 + 2] = (M20 * a + M21 * b + M22 * c + + M23 * d + M24 * e); + check_results[i * 5 + 3] = (M30 * a + M31 * b + M32 * c + + M33 * d + M34 * e); + check_results[i * 5 + 4] = (M40 * a + M41 * b + M42 * c + + M43 * d + M44 * e); + asm volatile (""); + } +#endif + foo (input, output); for (i = 0; i < N; i++) Index: gcc/testsuite/gcc.dg/vect/slp-perm-5.c =================================================================== --- gcc/testsuite/gcc.dg/vect/slp-perm-5.c 2016-01-13 13:48:42.000000000 +0000 +++ gcc/testsuite/gcc.dg/vect/slp-perm-5.c 2017-11-03 16:06:08.012090077 +0000 @@ -18,7 +18,11 @@ #define K10 112 #define K01 4322 #define K11 135 +#if VECTOR_BITS > 128 +#define N (VECTOR_BITS * 3 / 32 + 4) +#else #define N 16 +#endif void foo (int *__restrict__ pInput, int *__restrict__ pOutput, int *__restrict__ pInput2, int *__restrict__ pOutput2) @@ -46,9 +50,7 @@ void foo (int *__restrict__ pInput, int int main (int argc, const char* argv[]) { int input[N], output[N], i; - int check_results[N] = {1470, 395, 28271, 5958, 1655, 111653, 10446, 2915, 195035, 14934, 4175, 278417, 19422, 5435, 361799, 0}; int input2[N], output2[N]; - int check_results2[N] = {4322, 135, 13776, 629, 23230, 1123, 32684, 1617, 42138, 2111, 0, 0, 0, 0, 0, 0}; check_vect (); @@ -63,6 +65,35 @@ int main (int argc, const char* argv[]) __asm__ volatile (""); } +#if N == 16 + int check_results[N] = { 1470, 395, 28271, 5958, 1655, 111653, 10446, 2915, + 195035, 14934, 4175, 278417, 19422, 5435, 361799, + 0 }; + int check_results2[N] = { 4322, 135, 13776, 629, 23230, 1123, 32684, 1617, + 42138, 2111, 0, 0, 0, 0, 0, 0 }; +#else + volatile int check_results[N] = {}; + volatile int check_results2[N] = {}; + + for (int i = 0; i < N / 3; i++) + { + int a = input[i * 3]; + int b = input[i * 3 + 1]; + int c = input[i * 3 + 2]; + int d = input2[i * 2]; + int e = input2[i * 2 + 1]; + + check_results[i * 3] = M00 * a + M01 * b + M02 * c; + check_results[i * 3 + 1] = M10 * a + M11 * b + M12 * c; + check_results[i * 3 + 2] = M20 * a + M21 * b + M22 * c; + + check_results2[i * 2] = K00 * d + K01 * e; + check_results2[i * 2 + 1] = K10 * d + K11 * e; + + asm volatile ("" ::: "memory"); + } +#endif + foo (input, output, input2, output2); for (i = 0; i < N; i++) Index: gcc/testsuite/gcc.dg/vect/slp-perm-6.c =================================================================== --- gcc/testsuite/gcc.dg/vect/slp-perm-6.c 2016-01-13 13:48:42.000000000 +0000 +++ gcc/testsuite/gcc.dg/vect/slp-perm-6.c 2017-11-03 16:06:08.012090077 +0000 @@ -18,7 +18,11 @@ #define K10 112 #define K01 4322 #define K11 135 +#if VECTOR_BITS > 128 +#define N (VECTOR_BITS * 3 / 32 + 4) +#else #define N 16 +#endif void foo (int *__restrict__ pInput, int *__restrict__ pOutput, int *__restrict__ pInput2, int *__restrict__ pOutput2) @@ -47,9 +51,7 @@ void foo (int *__restrict__ pInput, int int main (int argc, const char* argv[]) { int input[N], output[N], i; - int check_results[N] = {1470, 395, 28271, 5958, 1655, 111653, 10446, 2915, 195035, 14934, 4175, 278417, 19422, 5435, 361799, 0}; int input2[N], output2[N]; - int check_results2[N] = {0, 112, 810, 336, 1620, 560, 2430, 784, 3240, 1008, 0, 0, 0, 0, 0, 0}; check_vect (); @@ -62,6 +64,35 @@ int main (int argc, const char* argv[]) __asm__ volatile (""); } +#if N == 16 + int check_results[N] = { 1470, 395, 28271, 5958, 1655, 111653, 10446, 2915, + 195035, 14934, 4175, 278417, 19422, 5435, 361799, + 0 }; + int check_results2[N] = { 0, 112, 810, 336, 1620, 560, 2430, 784, 3240, 1008, + 0, 0, 0, 0, 0, 0 }; +#else + volatile int check_results[N] = {}; + volatile int check_results2[N] = {}; + + for (int i = 0; i < N / 3; i++) + { + int a = input[i * 3]; + int b = input[i * 3 + 1]; + int c = input[i * 3 + 2]; + int d = input2[i * 2]; + int e = input2[i * 2 + 1]; + + check_results[i * 3] = M00 * a + M01 * b + M02 * c; + check_results[i * 3 + 1] = M10 * a + M11 * b + M12 * c; + check_results[i * 3 + 2] = M20 * a + M21 * b + M22 * c; + + check_results2[i * 2] = K00 * d; + check_results2[i * 2 + 1] = K10 * e; + + asm volatile ("" ::: "memory"); + } +#endif + foo (input, output, input2, output2); for (i = 0; i < N; i++) Index: gcc/testsuite/gcc.dg/vect/slp-perm-7.c =================================================================== --- gcc/testsuite/gcc.dg/vect/slp-perm-7.c 2017-11-03 16:06:03.053282336 +0000 +++ gcc/testsuite/gcc.dg/vect/slp-perm-7.c 2017-11-03 16:06:08.012090077 +0000 @@ -18,7 +18,11 @@ #define K10 112 #define K01 4322 #define K11 135 +#if VECTOR_BITS > 128 +#define N (VECTOR_BITS * 3 / 32 + 4) +#else #define N 16 +#endif /* SLP with load permutation and loop-based vectorization. */ void foo (int *__restrict__ pInput, int *__restrict__ pOutput, @@ -45,9 +49,7 @@ void foo (int *__restrict__ pInput, int int main (int argc, const char* argv[]) { int input[N], output[N], i; - int check_results[N] = {1470, 395, 28271, 5958, 1655, 111653, 10446, 2915, 195035, 14934, 4175, 278417, 19422, 5435, 361799, 0}; int input2[N], output2[N]; - int check_results2[N] = {0, 405, 810, 1215, 1620, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; check_vect (); @@ -60,6 +62,30 @@ int main (int argc, const char* argv[]) asm volatile ("" ::: "memory"); } +#if N == 16 + int check_results[N] = {1470, 395, 28271, 5958, 1655, 111653, 10446, 2915, 195035, 14934, 4175, 278417, 19422, 5435, 361799, 0}; + int check_results2[N] = {0, 405, 810, 1215, 1620, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; +#else + volatile int check_results[N] = {}; + volatile int check_results2[N] = {}; + + for (int i = 0; i < N / 3; i++) + { + int a = input[i * 3]; + int b = input[i * 3 + 1]; + int c = input[i * 3 + 2]; + int d = input2[i]; + + check_results[i * 3] = M00 * a + M01 * b + M02 * c; + check_results[i * 3 + 1] = M10 * a + M11 * b + M12 * c; + check_results[i * 3 + 2] = M20 * a + M21 * b + M22 * c; + + check_results2[i] = K00 * d; + + asm volatile ("" ::: "memory"); + } +#endif + foo (input, output, input2, output2); for (i = 0; i < N; i++) Index: gcc/testsuite/gcc.dg/vect/pr65518.c =================================================================== --- gcc/testsuite/gcc.dg/vect/pr65518.c 2016-11-22 21:16:10.000000000 +0000 +++ gcc/testsuite/gcc.dg/vect/pr65518.c 2017-11-03 16:06:08.011089914 +0000 @@ -1,10 +1,19 @@ #include "tree-vect.h" +#if VECTOR_BITS > 256 +#define NINTS (VECTOR_BITS / 32) +#else +#define NINTS 8 +#endif + +#define N (NINTS * 2) +#define RESULT (NINTS * (NINTS - 1) / 2 * N + NINTS) + extern void abort (void); typedef struct giga { - unsigned int g[16]; + unsigned int g[N]; } giga; unsigned long __attribute__((noinline,noclone)) @@ -19,17 +28,17 @@ addfst(giga const *gptr, int num) int main () { - struct giga g[8]; + struct giga g[NINTS]; unsigned int n = 1; int i, j; check_vect (); - for (i = 0; i < 8; ++i) - for (j = 0; j < 16; ++j) + for (i = 0; i < NINTS; ++i) + for (j = 0; j < N; ++j) { g[i].g[j] = n++; __asm__ volatile (""); } - if (addfst (g, 8) != 456) + if (addfst (g, NINTS) != RESULT) abort (); return 0; } Index: gcc/testsuite/gcc.dg/vect/pr65947-5.c =================================================================== --- gcc/testsuite/gcc.dg/vect/pr65947-5.c 2017-06-30 12:50:37.704687511 +0100 +++ gcc/testsuite/gcc.dg/vect/pr65947-5.c 2017-11-03 16:06:08.011089914 +0000 @@ -4,7 +4,11 @@ extern void abort (void) __attribute__ ((noreturn)); +#if VECTOR_BITS > 256 +#define N (VECTOR_BITS / 8) +#else #define N 32 +#endif /* Condition reduction where loop size is not known at compile time. Will fail to vectorize. Version inlined into main loop will vectorize. */ @@ -30,6 +34,11 @@ main (void) 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32 }; + for (int i = 32; i < N; ++i) + { + a[i] = 70 + (i & 3); + asm volatile ("" ::: "memory"); + } check_vect (); Index: gcc/testsuite/gcc.dg/vect/pr81136.c =================================================================== --- gcc/testsuite/gcc.dg/vect/pr81136.c 2017-08-04 11:42:45.937164489 +0100 +++ gcc/testsuite/gcc.dg/vect/pr81136.c 2017-11-03 16:06:08.011089914 +0000 @@ -1,6 +1,8 @@ /* { dg-do compile } */ -struct __attribute__((aligned (32))) +#include "tree-vect.h" + +struct __attribute__((aligned (VECTOR_BITS / 8))) { char misaligner; int foo[100]; Index: gcc/testsuite/gcc.dg/vect/slp-19c.c =================================================================== --- gcc/testsuite/gcc.dg/vect/slp-19c.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/slp-19c.c 2017-11-03 16:06:08.011089914 +0000 @@ -3,14 +3,27 @@ #include #include "tree-vect.h" +#if VECTOR_BITS > 128 +#define N (VECTOR_BITS * 2 / 32) +#else #define N 16 +#endif int main1 () { unsigned int i; unsigned int out[N*8]; +#if N == 16 unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63}; +#else + unsigned int in[N * 8]; + for (unsigned int i = 0; i < N * 8; ++i) + { + in[i] = i & 63; + asm volatile ("" ::: "memory"); + } +#endif unsigned int ia[N*2], a0, a1, a2, a3; /* The last stmt requires interleaving of not power of 2 size - not Index: gcc/testsuite/gcc.dg/vect/slp-28.c =================================================================== --- gcc/testsuite/gcc.dg/vect/slp-28.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/slp-28.c 2017-11-03 16:06:08.011089914 +0000 @@ -3,19 +3,27 @@ #include #include "tree-vect.h" -#define N 32 - -unsigned short in[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31}; -unsigned short in2[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31}; -unsigned short in3[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31}; -unsigned short check[N] = {0,1,2,3,5,6,7,8,10,11,12,13,15,16,17,18,20,21,22,23,25,26,27,28,30,31,32,33,35,36,37,38}; -unsigned short check3[N] = {0,1,2,3,4,5,6,7,8,9,10,11,5,6,7,8,9,10,11,12,13,14,15,16,10,11,12,13,14,15,16,17}; +#if VECTOR_BITS > 128 +#define N (VECTOR_BITS * 4 / 16) +#else +#define N 32 +#endif + +unsigned short in[N] = {}; +unsigned short in2[N] = {}; +unsigned short in3[N] = {}; int main1 () { int i; + for (i = 0; i < N; i++) + { + in[i] = in2[i] = in3[i] = i; + asm volatile ("" ::: "memory"); + } + for (i = 0; i < N/4; i++) { in[i*4] = in[i*4] + 5; @@ -43,9 +51,9 @@ main1 () } /* check results: */ - for (i = 4; i < N; i++) + for (i = 0; i < N; i++) { - if (in2[i] != check[i]) + if (in2[i] != (i % 4) + (i / 4) * 5) abort (); } @@ -61,9 +69,9 @@ main1 () } /* check results: */ - for (i = 12; i < N; i++) + for (i = 0; i < N; i++) { - if (in3[i] != check3[i]) + if (in3[i] != (i % 12) + (i / 12) * 5) abort (); } Index: gcc/testsuite/gcc.dg/vect/slp-perm-8.c =================================================================== --- gcc/testsuite/gcc.dg/vect/slp-perm-8.c 2017-06-08 08:51:43.123296190 +0100 +++ gcc/testsuite/gcc.dg/vect/slp-perm-8.c 2017-11-03 16:06:08.012090077 +0000 @@ -3,12 +3,17 @@ #include #include "tree-vect.h" +#if VECTOR_BITS > 512 +#define N (VECTOR_BITS * 6 / 16) +#else #define N 200 +#endif void __attribute__((noinline)) foo (unsigned char *__restrict__ pInput, unsigned char *__restrict__ pOutput) { - unsigned char i, a, b, c; + unsigned char a, b, c; + unsigned int i; for (i = 0; i < N / 3; i++) { @@ -24,8 +29,9 @@ foo (unsigned char *__restrict__ pInput, int main (int argc, const char* argv[]) { - unsigned char input[N], output[N], i; + unsigned char input[N], output[N]; unsigned char check_results[N]; + unsigned int i; check_vect (); Index: gcc/testsuite/gcc.dg/vect/vect-103.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-103.c 2017-11-03 16:06:03.054282499 +0000 +++ gcc/testsuite/gcc.dg/vect/vect-103.c 2017-11-03 16:06:08.012090077 +0000 @@ -4,7 +4,13 @@ #include #include "tree-vect.h" -#define N 9 +#if VECTOR_BITS > 256 +#define NINTS (VECTOR_BITS / 32) +#else +#define NINTS 8 +#endif + +#define N (NINTS + 1) struct extraction { @@ -14,7 +20,6 @@ struct extraction static int a[N] = {1,2,3,4,5,6,7,8,9}; static int b[N] = {17,24,7,0,2,3,4,31,82}; -static int c[N] = {9,17,24,7,0,2,3,4,31}; __attribute__ ((noinline)) int main1 (int x, int y) { @@ -31,16 +36,15 @@ int main1 (int x, int y) { /* Vectorizable: distance > VF. */ for (i = 0; i < N; i++) - { - *((int *)p + x + i) = *((int *)p + x + i + 8); - } + *((int *)p + x + i) = *((int *)p + x + i + NINTS); /* check results: */ - for (i = 0; i < N; i++) - { - if (p->a[i] != c[i]) - abort(); - } + if (p->a[0] != a[N - 1]) + abort (); + for (i = 1; i < N; i++) + if (p->a[i] != b[i - 1]) + abort (); + return 0; } Index: gcc/testsuite/gcc.dg/vect/vect-67.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-67.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/vect-67.c 2017-11-03 16:06:08.013090240 +0000 @@ -3,13 +3,19 @@ #include #include "tree-vect.h" -#define N 16 +#if VECTOR_BITS > 256 +#define NINTS (VECTOR_BITS / 32) +#else +#define NINTS 8 +#endif + +#define N (NINTS * 2) __attribute__ ((noinline)) int main1 (int a, int b) { int i, j; - int ia[N][4][N+8]; + int ia[N][4][N + NINTS]; /* Multidimensional array. Aligned. The "inner" dimensions are invariant in the inner loop. Store. @@ -18,7 +24,7 @@ int main1 (int a, int b) { for (j = 0; j < N; j++) { - ia[i][1][j+8] = (a == b); + ia[i][1][j + NINTS] = (a == b); } } @@ -27,7 +33,7 @@ int main1 (int a, int b) { for (j = 0; j < N; j++) { - if (ia[i][1][j+8] != (a == b)) + if (ia[i][1][j + NINTS] != (a == b)) abort(); } } Index: gcc/testsuite/gcc.dg/vect/vect-70.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-70.c 2017-08-03 10:40:54.012104085 +0100 +++ gcc/testsuite/gcc.dg/vect/vect-70.c 2017-11-03 16:06:08.013090240 +0000 @@ -4,11 +4,24 @@ #include #include "tree-vect.h" -#define N 24 +#if VECTOR_BITS > 128 +#define NINTS (VECTOR_BITS / 32) +#else +#define NINTS 4 +#endif + +#define N (NINTS * 6) + +/* Keep execution time down. */ +#if N <= 24 +#define OUTERN N +#else +#define OUTERN NINTS +#endif struct s{ int m; - int n[N/6][N/6][N]; + int n[4][4][N]; }; struct test1{ @@ -18,36 +31,43 @@ struct test1{ struct s e[N]; /* array e.n is aligned */ }; +/* Avoid big local temporaries. */ +#if NINTS > 8 +struct test1 tmp1; +#endif + __attribute__ ((noinline)) int main1 () { int i,j; +#if NINTS <= 8 struct test1 tmp1; +#endif - for (i = 0; i < N; i++) - for (j = 3; j < N-3; j++) + for (i = 0; i < OUTERN; i++) + for (j = NINTS - 1; j < N - NINTS + 1; j++) { tmp1.e[i].n[1][2][j] = 8; } /* check results: */ - for (i = 0; i < N; i++) - for (j = 3; j < N-3; j++) + for (i = 0; i < OUTERN; i++) + for (j = NINTS - 1; j < N - NINTS + 1; j++) { if (tmp1.e[i].n[1][2][j] != 8) abort (); } /* not consecutive, will use strided stores */ - for (i = 0; i < N; i++) - for (j = 3; j < N-3; j++) + for (i = 0; i < OUTERN; i++) + for (j = NINTS - 1; j < N - NINTS + 1; j++) { tmp1.e[j].n[1][2][j] = 8; } /* check results: */ - for (i = 0; i < N; i++) - for (j = 3; j < N-3; j++) + for (i = 0; i < OUTERN; i++) + for (j = NINTS - 1; j < N - NINTS + 1; j++) { if (tmp1.e[j].n[1][2][j] != 8) abort (); Index: gcc/testsuite/gcc.dg/vect/vect-91.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-91.c 2017-08-03 10:40:54.013104709 +0100 +++ gcc/testsuite/gcc.dg/vect/vect-91.c 2017-11-03 16:06:08.013090240 +0000 @@ -7,7 +7,14 @@ #define N 256 -extern int a[N+20]; +/* Pick a value greater than the vector length. */ +#if VECTOR_BITS > 128 +#define OFF (VECTOR_BITS * 5 / 32) +#else +#define OFF 20 +#endif + +extern int a[N + OFF]; /* The alignment of 'pa' is unknown. Yet we do know that both the read access and write access have @@ -52,7 +59,7 @@ main3 () for (i = 0; i < N; i++) { - a[i] = a[i+20]; + a[i] = a[i + OFF]; } return 0; Index: gcc/testsuite/gcc.dg/vect/vect-92.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-92.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/vect-92.c 2017-11-03 16:06:08.013090240 +0000 @@ -17,12 +17,18 @@ float pc[N] __attribute__ ((__aligned__( can use this information (generate prolog and epilog loops with known number of iterations, and only if needed). */ +#if VECTOR_BITS > 128 +#define NITER (VECTOR_BITS * 3 / 32) +#else +#define NITER 12 +#endif + __attribute__ ((noinline)) int main1 () { int i; - for (i = 0; i < 10; i++) + for (i = 0; i < NITER - 2; i++) { pa[i+1] = pb[i+1] * pc[i+1]; } @@ -42,7 +48,7 @@ main2 () { int i; - for (i = 0; i < 12; i++) + for (i = 0; i < NITER; i++) { pa[i+1] = pb[i+1] * pc[i+1]; } Index: gcc/testsuite/gcc.dg/vect/vect-93.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-93.c 2017-08-03 10:40:54.013104709 +0100 +++ gcc/testsuite/gcc.dg/vect/vect-93.c 2017-11-03 16:06:08.013090240 +0000 @@ -4,33 +4,38 @@ #include #include "tree-vect.h" -#define N 3001 +#define N1 3001 +#if VECTOR_BITS > 256 +#define N2 (VECTOR_BITS / 32 + 2) +#else +#define N2 10 +#endif __attribute__ ((noinline)) int main1 (float *pa) { int i; - for (i = 0; i < 3001; i++) + for (i = 0; i < N1; i++) { pa[i] = 2.0; } /* check results: */ - for (i = 0; i < 3001; i++) + for (i = 0; i < N1; i++) { if (pa[i] != 2.0) abort (); } - for (i = 1; i <= 10; i++) + for (i = 1; i <= N2; i++) { pa[i] = 3.0; } /* check results: */ - for (i = 1; i <= 10; i++) + for (i = 1; i <= N2; i++) { if (pa[i] != 3.0) abort (); @@ -42,13 +47,14 @@ main1 (float *pa) int main (void) { int i; - float a[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))); - float b[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))); + float a[N1] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))); + float b[N1] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))); check_vect (); /* from bzip2: */ - for (i=0; i #include "tree-vect.h" -#define N 32 +#if VECTOR_BITS > 128 +#define NSHORTS (VECTOR_BITS / 16) +#else +#define NSHORTS 8 +#endif + +#define NINTS (NSHORTS / 2) +#define N (NSHORTS * 4) short sa[N]; short sb[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15, @@ -27,14 +34,14 @@ __attribute__ ((noinline)) int main1 (in copmutations. Vectorizable. */ for (i = 0; i < n; i++) { - sa[i+7] = sb[i]; - ia[i+3] = ib[i+1]; + sa[i + NSHORTS - 1] = sb[i]; + ia[i + NINTS - 1] = ib[i + 1]; } /* check results: */ for (i = 0; i < n; i++) { - if (sa[i+7] != sb[i] || ia[i+3] != ib[i+1]) + if (sa[i + NSHORTS - 1] != sb[i] || ia[i + NINTS - 1] != ib[i + 1]) abort (); } @@ -57,14 +64,14 @@ __attribute__ ((noinline)) int main2 (in copmutations. */ for (i = 0; i < n; i++) { - ia[i+3] = ib[i]; - sa[i+3] = sb[i+1]; + ia[i + NINTS - 1] = ib[i]; + sa[i + NINTS - 1] = sb[i + 1]; } /* check results: */ for (i = 0; i < n; i++) { - if (sa[i+3] != sb[i+1] || ia[i+3] != ib[i]) + if (sa[i + NINTS - 1] != sb[i + 1] || ia[i + NINTS - 1] != ib[i]) abort (); } @@ -75,8 +82,8 @@ int main (void) { check_vect (); - main1 (N-7); - main2 (N-3); + main1 (N - NSHORTS + 1); + main2 (N - NINTS + 1); return 0; } Index: gcc/testsuite/gcc.dg/vect/vect-over-widen-3-big-array.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-over-widen-3-big-array.c 2016-01-30 10:07:34.000000000 +0000 +++ gcc/testsuite/gcc.dg/vect/vect-over-widen-3-big-array.c 2017-11-03 16:06:08.014090402 +0000 @@ -4,7 +4,7 @@ #include #include "tree-vect.h" -#define N 128 +#define N VECTOR_BITS /* Modified rgb to rgb conversion from FFmpeg. */ __attribute__ ((noinline)) void @@ -32,7 +32,9 @@ foo (unsigned char *src, unsigned char * const int g = *s++; const int r = *s++; const int a = *s++; - if (*d != ((b>>3) | ((g&0xFFC)<<3) | ((r+0xF8)>>8) | (a<<9))) + unsigned short expected + = ((b>>3) | ((g&0xFFC)<<3) | ((r+0xF8)>>8) | (a<<9)); + if (*d != expected) abort (); d++; } Index: gcc/testsuite/gcc.dg/vect/vect-peel-3.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-peel-3.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/vect-peel-3.c 2017-11-03 16:06:08.014090402 +0000 @@ -4,12 +4,24 @@ #include #include "tree-vect.h" +#if VECTOR_BITS > 128 +#define NINTS (VECTOR_BITS / 32) +#define EXTRA (NINTS * 2) +#else +#define NINTS 4 +#define EXTRA 10 +#endif + #define N 128 -#define RES 21640 -int ib[N+10]; -int ia[N+10]; -int ic[N+10]; +#define RES_A (N * N / 4) +#define RES_B (N * (N + 1) / 2 + (NINTS + 3) * (N + 1)) +#define RES_C (N * (N + 1) / 2 + (N + 1)) +#define RES (RES_A + RES_B + RES_C) + +int ib[N + EXTRA]; +int ia[N + EXTRA]; +int ic[N + EXTRA]; __attribute__ ((noinline)) int main1 () @@ -20,8 +32,8 @@ int main1 () for (i = 0; i <= N; i++) { suma += ia[i]; - sumb += ib[i+5]; - sumc += ic[i+1]; + sumb += ib[i + NINTS + 1]; + sumc += ic[i + 1]; } /* check results: */ @@ -37,7 +49,7 @@ int main (void) check_vect (); - for (i = 0; i < N+10; i++) + for (i = 0; i < N + EXTRA; i++) { asm volatile ("" : "+r" (i)); ib[i] = i; Index: gcc/testsuite/gcc.dg/vect/vect-reduc-or_1.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-reduc-or_1.c 2016-11-22 21:16:10.000000000 +0000 +++ gcc/testsuite/gcc.dg/vect/vect-reduc-or_1.c 2017-11-03 16:06:08.014090402 +0000 @@ -4,28 +4,41 @@ #include "tree-vect.h" +#if VECTOR_BITS > 128 +#define N (VECTOR_BITS / 8) +#else +#define N 16 +#endif + extern void abort(void); -unsigned char in[16] __attribute__((__aligned__(16))); +unsigned char in[N] __attribute__((__aligned__(16))); int main (unsigned char argc, char **argv) { unsigned char i = 0; unsigned char sum = 1; + unsigned char expected = 1; check_vect (); - for (i = 0; i < 16; i++) + for (i = 0; i < N; i++) in[i] = (i + i + 1) & 0xfd; + for (i = 0; i < N; i++) + { + expected |= in[i]; + asm volatile (""); + } + /* Prevent constant propagation of the entire loop below. */ asm volatile ("" : : : "memory"); - for (i = 0; i < 16; i++) + for (i = 0; i < N; i++) sum |= in[i]; - if (sum != 29) + if (sum != expected) { __builtin_printf("Failed %d\n", sum); abort(); Index: gcc/testsuite/gcc.dg/vect/vect-reduc-or_2.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-reduc-or_2.c 2016-11-22 21:16:10.000000000 +0000 +++ gcc/testsuite/gcc.dg/vect/vect-reduc-or_2.c 2017-11-03 16:06:08.014090402 +0000 @@ -4,24 +4,37 @@ #include "tree-vect.h" +#if VECTOR_BITS > 128 +#define N (VECTOR_BITS / 8) +#else +#define N 16 +#endif + extern void abort(void); int main (unsigned char argc, char **argv) { - unsigned char in[16] __attribute__((aligned(16))); + unsigned char in[N] __attribute__((aligned(16))); unsigned char i = 0; unsigned char sum = 1; + unsigned char expected = 1; check_vect (); - for (i = 0; i < 16; i++) + for (i = 0; i < N; i++) in[i] = (i + i + 1) & 0xfd; - for (i = 0; i < 16; i++) + for (i = 0; i < N; i++) + { + expected |= in[i]; + asm volatile (""); + } + + for (i = 0; i < N; i++) sum |= in[i]; - if (sum != 29) + if (sum != expected) { __builtin_printf("Failed %d\n", sum); abort(); From patchwork Fri Nov 3 16:18:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 117939 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp3652837qgn; Fri, 3 Nov 2017 09:18:28 -0700 (PDT) X-Google-Smtp-Source: ABhQp+TWJY3XaHNkC3j8Nd26Kj5fHxLjc4VbWNhBd9CaWVq2zgm/2zPx3UeDZjxK63g9vBq8A6vj X-Received: by 10.84.245.15 with SMTP id i15mr7355021pll.437.1509725908099; Fri, 03 Nov 2017 09:18:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509725908; cv=none; d=google.com; s=arc-20160816; b=UL5zyeE6DERPFnd/SRc1awVK5rdRNi8IVbk0UAbwlGQaba5WmjbrtQeOa6l03TEFBL dfFq5ma45EEX02jw2s2o5NjgEY2Y5lPuZ3GKJGyAHRcGxFv9Ug2WMmYVH2Wez30BmTgs 0RxBCJhK9TufdLl3eKivxT9M1nqEDDa540yqDLz8h9lV7SDLwZsqOlL2lDYf0TdtofzS S6aXGtSF8ecCp3Dqb1IZRXyrrh8K7EApKjT1rZn1zRJP1t0qLiAUqg99tX4h1GhiegYB V8sa9KHnegY4aktYM3ngg/6d8sNReey0eHHt/piDRGGqBVTxUH1yA/ZHvkE1Vn7GxsQ+ r5fg== 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=WtAjjH+zdTeNlcsk4Yo1NJzWPRE2gO0tERROkcxfHHw=; b=kndKJgzW5uHk1GY3MeQfKh+jwvaZt7uDT3Y7GPKTSEeq754iClooHvBFyfj2QdmP44 mniyneeMU2TjzxsvJG0WttKyxdradLn0ZE0Jb0dzF+hcABQNWCd8mDUdzobISdORIO6z QS1+soGt/nTEBwO7GZPOxgQ2uWN4uXqU06/RaPlPuhydbjf6O8u/elgp8NfBxdJR09/m KjN3tU/oYvyvtGLi4R2YDX9sB6z7EwaI7IFqvgCtEiFakRbo1B8EVmYTMT1jrNK6DE3a 0WIMTgXOF52gCXcnlKZtbZebyjsMHi5njr31Bm7b/rvZMOnMWCAQ6MuwC8Wo2Tm2kBDV YwAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=ySOwyHGf; spf=pass (google.com: domain of gcc-patches-return-465873-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-465873-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 p24si5470382plr.533.2017.11.03.09.18.27 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Nov 2017 09:18:28 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-465873-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=ySOwyHGf; spf=pass (google.com: domain of gcc-patches-return-465873-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-465873-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=ETzvBVgyPTMUso/syFrnw6HqhThE9 efhy90S4ir/2H0f9CfJ5TO453XuB/unD8B3DzhBovn6XZHe3p+Ic0PR7n/EDhLEc P8kVVnZpfEKb/i6KnqRRasmvU2ma5bYGyNAW2mmMvzh9MUavXKe8WZiRAy3PZ5Nu eCMBproUc+ESBg= 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=7pqhfrjyz+7ToL4RNzzhH9PhiBI=; b=ySO wyHGfAwNJBku0ZUwM0T65qRSsRg9aW9Ea0fDy9qFxcMUDQAJxhlMVxK4FIe6JzOD kklw2Yg9Ew/oMKNiUiq6pv0oEaYqVCzwS1CEk2WXQUaXi2opYMNyBPBIpehUDr0k QmYPDasCf3pXzWOoSLBCxQLrmF943FnjVFBFXqqI= Received: (qmail 33437 invoked by alias); 3 Nov 2017 16:18:16 -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 33426 invoked by uid 89); 3 Nov 2017 16:18:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-15.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy=sk:check_a X-HELO: mail-wr0-f173.google.com Received: from mail-wr0-f173.google.com (HELO mail-wr0-f173.google.com) (209.85.128.173) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 03 Nov 2017 16:18:14 +0000 Received: by mail-wr0-f173.google.com with SMTP id z55so2981173wrz.1 for ; Fri, 03 Nov 2017 09:18:14 -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=WtAjjH+zdTeNlcsk4Yo1NJzWPRE2gO0tERROkcxfHHw=; b=E7dOgkfYfoA6J4fE1r/BbA8XutHKHq3a2ZXUCWhZZgOoaoXbFlk7ABLAtxcIWDqZXl +19DWThZ4igbwTqsJyiMeZPJNL6+gS6qX6moVn1zNIK2HEylVEwdHJAvzQ16QNSQqak/ 2S9yrdmI28SSedojEkJhCNQ1azePTJEzb/HNjEy0dsdvTI5OG2BgE7eetwxcp6s2oyE1 fjJbk+yJ7vfazS7T9Qra/chaHAcIeL8p4xCa6KYBpms74allJILxEkQZ95H81ocF7qbo d8McL5Z/GvscePLzmfB0FxkHKBBIuALLOycFRxEh/LTO7W7YzC8wqN6pk5K70EAueS1M fuhA== X-Gm-Message-State: AMCzsaV382uK+SzsegjFu05j18XoYrD8h0EGAcZd6qYxKgIpRt+Qzufr j1LHb8EHqJarzS/UlqZwC1WoGw0Phhw= X-Received: by 10.223.147.39 with SMTP id 36mr5953378wro.175.1509725892059; Fri, 03 Nov 2017 09:18:12 -0700 (PDT) Received: from localhost (188.29.164.162.threembb.co.uk. [188.29.164.162]) by smtp.gmail.com with ESMTPSA id i16sm5717604wrf.19.2017.11.03.09.18.11 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 Nov 2017 09:18:11 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@linaro.org Subject: [3/10] Add available_vector_sizes to target-supports.exp References: <87inerqqyz.fsf@linaro.org> Date: Fri, 03 Nov 2017 16:18:09 +0000 In-Reply-To: <87inerqqyz.fsf@linaro.org> (Richard Sandiford's message of "Fri, 03 Nov 2017 16:14:44 +0000") Message-ID: <874lqbqqta.fsf@linaro.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 This patch adds a routine that lists the available vector sizes for a target and uses it for some existing target conditions. Later patches add more uses. The cases are taken from multiple_sizes. 2017-11-03 Richard Sandiford Alan Hayward David Sherwood gcc/testsuite/ * lib/target-supports.exp (available_vector_sizes): New proc. (check_effective_target_vect_multiple_sizes): Use it. (check_effective_target_vect64): Likewise. (check_effective_target_vect_sizes_32B_16B): Likewise. Index: gcc/testsuite/lib/target-supports.exp =================================================================== --- gcc/testsuite/lib/target-supports.exp 2017-11-03 12:16:58.605777011 +0000 +++ gcc/testsuite/lib/target-supports.exp 2017-11-03 16:06:12.625838683 +0000 @@ -6581,46 +6581,38 @@ foreach N {2 3 4 8} { }] } -# Return 1 if the target supports multiple vector sizes +# Return the list of vector sizes (in bits) that each target supports. +# A vector length of "0" indicates variable-length vectors. -proc check_effective_target_vect_multiple_sizes { } { - global et_vect_multiple_sizes_saved - global et_index - - set et_vect_multiple_sizes_saved($et_index) 0 - if { [istarget aarch64*-*-*] - || [is-effective-target arm_neon] - || (([istarget i?86-*-*] || [istarget x86_64-*-*]) - && ([check_avx_available] && ![check_prefer_avx128])) } { - set et_vect_multiple_sizes_saved($et_index) 1 +proc available_vector_sizes { } { + set result {} + if { [istarget aarch64*-*-*] } { + lappend result 128 64 + } elseif { [istarget arm*-*-*] + && [check_effective_target_arm_neon_ok] } { + lappend result 128 64 + } elseif { (([istarget i?86-*-*] || [istarget x86_64-*-*]) + && ([check_avx_available] && ![check_prefer_avx128])) } { + lappend result 256 128 + } elseif { [istarget sparc*-*-*] } { + lappend result 64 + } else { + # The traditional default asumption. + lappend result 128 } + return $result +} + +# Return 1 if the target supports multiple vector sizes - verbose "check_effective_target_vect_multiple_sizes:\ - returning $et_vect_multiple_sizes_saved($et_index)" 2 - return $et_vect_multiple_sizes_saved($et_index) +proc check_effective_target_vect_multiple_sizes { } { + return [expr { [llength [available_vector_sizes]] > 1 }] } # Return 1 if the target supports vectors of 64 bits. proc check_effective_target_vect64 { } { - global et_vect64_saved - global et_index - - if [info exists et_vect64_saved($et_index)] { - verbose "check_effective_target_vect64: using cached result" 2 - } else { - set et_vect64_saved($et_index) 0 - if { ([is-effective-target arm_neon] - && [check_effective_target_arm_little_endian]) - || [istarget aarch64*-*-*] - || [istarget sparc*-*-*] } { - set et_vect64_saved($et_index) 1 - } - } - - verbose "check_effective_target_vect64:\ - returning $et_vect64_saved($et_index)" 2 - return $et_vect64_saved($et_index) + return [expr { [lsearch -exact [available_vector_sizes] 64] >= 0 }] } # Return 1 if the target supports vector copysignf calls. @@ -7747,11 +7739,7 @@ proc check_avx_available { } { # Return true if 32- and 16-bytes vectors are available. proc check_effective_target_vect_sizes_32B_16B { } { - if { [check_avx_available] && ![check_prefer_avx128] } { - return 1; - } else { - return 0; - } + return [expr { [available_vector_sizes] == [list 256 128] }] } # Return true if 16- and 8-bytes vectors are available. From patchwork Fri Nov 3 16:18:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 117940 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp3653647qgn; Fri, 3 Nov 2017 09:19:13 -0700 (PDT) X-Google-Smtp-Source: ABhQp+QKznxEZli/SOrJSZNjJc0vSFEIvEVuMjJM9RHGU5L37IBryKhv4/9DVT4dIAsizoPkfn/3 X-Received: by 10.159.234.147 with SMTP id d19mr7238455plr.280.1509725953223; Fri, 03 Nov 2017 09:19:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509725953; cv=none; d=google.com; s=arc-20160816; b=k2IWOICWWPRV4bHCeoE+Q8HUe0P+e0V1xO8O4NZ3rxb0WU0UqD4C2EFSnSK8Nye9/M H0tS67Gk+IXPY6TUjzCKek9lOlBZonPHhXp1AWPhQuUewChNBdZiB04BlpYzE/O9BCfX u65LcSA5fs+U5Edwzqovo9OYeAdQKNyEAK06g1dBd1CvvL37TkqB3Xzm3OJ5E/YbN7Zz 1MCd2CE/BBhXrGqfKUQGuFV9xWmxM9y3W1iRGQLtCBz5MHQkf3jQ7J0rpMgmIipZg5ZH 7E5KXOypomwsv9ACDJP+/oXnHBQRLKCEyy9p9/s1edBp7JrfLtTum+p50PTzgTnXnYnz jRWw== 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=vhH4mqfpkpkcaLSt9whSO4SxYOWyDJBuXUnwblX8ksc=; b=juSYR4h5SzoSTtQCzytx1VmgmbunJ8AncsnJ8b4gDFRM4hYRMBlPZ4wdGBYVmNw/VG 0mt4iSwMt3zQg5el/loZDCalFoPEpTrdGqIkvuTdFyEK3jZwAhKMotJAPSI3dl5JBZhs 8Sre4X8uj6LjdkJR7tppr1okovAd0Gt5PiTpqvtTYxmssEf/U13vOoA5AGMLQP05LGQi ALB2yTVobU+oxIe0Bxw/O7nxIAoRSvg0eEvnTLkqZkSHjTP9dCsDMIh9v+ht1UKoE4GT QLEwT0QzugSLUFaK8LEhWUAzCqAcy0bwPeYIFJT/AP1B477sAC+9URkVBhwnUDRUbS8v OdlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=bcc7+UWd; spf=pass (google.com: domain of gcc-patches-return-465874-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-465874-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 e90si6742808pfb.291.2017.11.03.09.19.12 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Nov 2017 09:19:13 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-465874-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=bcc7+UWd; spf=pass (google.com: domain of gcc-patches-return-465874-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-465874-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=dlTz+2rC/tyH4Jkqqs6zGXbK2Mrwx DyEQVuDukSjbdBAxw7lQailBDZLdXJ0hmDuv8+60t9f/tMHKQTjrkOFJw2cZzMKo O0hrpa6VoPIUkoXYKeiE+//uQurN/4CfGVlGieBHpNBI7RzUe28mmAFmtgs2xfYp E0/7VmVqtwU070= 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=wXpQ03WHE6JafCGI7FnLQGkU2pw=; b=bcc 7+UWdBckssMLLjmxr05jqMeIxquz6HSPfIrbWF22aEk8CloXr1JNwMNk3ejw3O/m QglAsZWqqeAgyqgDhFSBYmemN8Q3D8h/FVVokuec3rmVgoeTdFQMRRKbjdbfyZvW 0+vTX4XqPy9IyxAXD8q1C9i4vDMc7femwEKMdBoU= Received: (qmail 35042 invoked by alias); 3 Nov 2017 16:18:58 -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 35030 invoked by uid 89); 3 Nov 2017 16:18:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=46, 5, dependence X-HELO: mail-wr0-f182.google.com Received: from mail-wr0-f182.google.com (HELO mail-wr0-f182.google.com) (209.85.128.182) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 03 Nov 2017 16:18:56 +0000 Received: by mail-wr0-f182.google.com with SMTP id l1so2979778wrc.3 for ; Fri, 03 Nov 2017 09:18:55 -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=vhH4mqfpkpkcaLSt9whSO4SxYOWyDJBuXUnwblX8ksc=; b=jOcqs4BjSa41CrkfYofLIlfW42fbDptKezbFtK/1zVvk+4lPD0OJ4CAgI9lrD9RTWA CyrqinL9lJC9Ra1MMFiTqtyIC9zmvDNXj4twLoyVkdNLaI3a0wDPPMwCesIA3w7I/7h4 Ry/uBbnSF3h33bahBiC/SZVV3MfB3qCqxx7qmna1+sfS10B8FemZ0lZrLx0Z/uRc0OdS 2tBoTr/oi2/UFf/Nuhi+2DmVFow1424eoMMwrrALRu0+JCDtUm+HGCw0AtCYog+K/kSq jFMXR01042McPfx33BEgj/feh1gujJCb2IyD8qM30dYbZgzZ27B5wpz1nHQBRgi9cUyK +MtQ== X-Gm-Message-State: AMCzsaVYs5ztkMUVEX6ZScWlRvDjgBR8auICU91mvb5PNRadMxgIqvD4 nMm2uQLmx7eIdYFlqv6CWw+thJMgaEs= X-Received: by 10.223.132.101 with SMTP id 92mr6205048wrf.85.1509725934097; Fri, 03 Nov 2017 09:18:54 -0700 (PDT) Received: from localhost (188.29.164.162.threembb.co.uk. [188.29.164.162]) by smtp.gmail.com with ESMTPSA id u18sm8170892wrg.94.2017.11.03.09.18.53 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 Nov 2017 09:18:53 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@linaro.org Subject: [4/10] Don't assume vect_multiple_sizes means 2 sizes References: <87inerqqyz.fsf@linaro.org> Date: Fri, 03 Nov 2017 16:18:51 +0000 In-Reply-To: <87inerqqyz.fsf@linaro.org> (Richard Sandiford's message of "Fri, 03 Nov 2017 16:14:44 +0000") Message-ID: <87zi83pc7o.fsf@linaro.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Some tests assumed that there would only be 2 vector sizes if vect_multiple_sizes, whereas for SVE there are three (SVE, 128-bit and 64-bit). This patch replaces scan-tree-dump-times with scan-tree-dump for vect_multiple_sizes but keeps it for !vect_multiple_sizes. 2017-11-03 Richard Sandiford Alan Hayward David Sherwood gcc/testsuite/ * gcc.dg/vect/no-vfa-vect-101.c: Use scan-tree-dump rather than scan-tree-dump-times for vect_multiple_sizes. * gcc.dg/vect/no-vfa-vect-102.c: Likewise. * gcc.dg/vect/no-vfa-vect-102a.c: Likewise. * gcc.dg/vect/no-vfa-vect-37.c: Likewise. * gcc.dg/vect/no-vfa-vect-79.c: Likewise. * gcc.dg/vect/vect-104.c: Likewise. Index: gcc/testsuite/gcc.dg/vect/no-vfa-vect-101.c =================================================================== --- gcc/testsuite/gcc.dg/vect/no-vfa-vect-101.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/no-vfa-vect-101.c 2017-11-03 16:06:16.141037152 +0000 @@ -46,5 +46,5 @@ int main (void) /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" } } */ /* { dg-final { scan-tree-dump-times "can't determine dependence" 1 "vect" { target { ! vect_multiple_sizes } } } } */ -/* { dg-final { scan-tree-dump-times "can't determine dependence" 2 "vect" { target vect_multiple_sizes } } } */ +/* { dg-final { scan-tree-dump "can't determine dependence" "vect" { target vect_multiple_sizes } } } */ Index: gcc/testsuite/gcc.dg/vect/no-vfa-vect-102.c =================================================================== --- gcc/testsuite/gcc.dg/vect/no-vfa-vect-102.c 2017-11-03 16:06:03.052282173 +0000 +++ gcc/testsuite/gcc.dg/vect/no-vfa-vect-102.c 2017-11-03 16:06:16.141037152 +0000 @@ -51,5 +51,5 @@ int main (void) /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" } } */ /* { dg-final { scan-tree-dump-times "possible dependence between data-refs" 1 "vect" { target { ! vect_multiple_sizes } } } } */ -/* { dg-final { scan-tree-dump-times "possible dependence between data-refs" 2 "vect" { target vect_multiple_sizes } } } */ +/* { dg-final { scan-tree-dump "possible dependence between data-refs" "vect" { target vect_multiple_sizes } } } */ Index: gcc/testsuite/gcc.dg/vect/no-vfa-vect-102a.c =================================================================== --- gcc/testsuite/gcc.dg/vect/no-vfa-vect-102a.c 2017-11-03 16:06:03.052282173 +0000 +++ gcc/testsuite/gcc.dg/vect/no-vfa-vect-102a.c 2017-11-03 16:06:16.141037152 +0000 @@ -51,5 +51,5 @@ int main (void) /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" } } */ /* { dg-final { scan-tree-dump-times "possible dependence between data-refs" 1 "vect" { target { ! vect_multiple_sizes } } } } */ -/* { dg-final { scan-tree-dump-times "possible dependence between data-refs" 2 "vect" { target vect_multiple_sizes } } } */ +/* { dg-final { scan-tree-dump "possible dependence between data-refs" "vect" { target vect_multiple_sizes } } } */ Index: gcc/testsuite/gcc.dg/vect/no-vfa-vect-37.c =================================================================== --- gcc/testsuite/gcc.dg/vect/no-vfa-vect-37.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/no-vfa-vect-37.c 2017-11-03 16:06:16.141037152 +0000 @@ -59,4 +59,4 @@ int main (void) prevent vectorization on some targets. */ /* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { xfail *-*-* } } } */ /* { dg-final { scan-tree-dump-times "can't determine dependence" 2 "vect" { target { ! vect_multiple_sizes } } } } */ -/* { dg-final { scan-tree-dump-times "can't determine dependence" 4 "vect" { target vect_multiple_sizes } } } */ +/* { dg-final { scan-tree-dump "can't determine dependence" "vect" { target vect_multiple_sizes } } } */ Index: gcc/testsuite/gcc.dg/vect/no-vfa-vect-79.c =================================================================== --- gcc/testsuite/gcc.dg/vect/no-vfa-vect-79.c 2015-06-02 23:53:35.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/no-vfa-vect-79.c 2017-11-03 16:06:16.141037152 +0000 @@ -47,4 +47,4 @@ int main (void) prevent vectorization on some targets. */ /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail *-*-* } } } */ /* { dg-final { scan-tree-dump-times "can't determine dependence" 1 "vect" { target { ! vect_multiple_sizes } } } } */ -/* { dg-final { scan-tree-dump-times "can't determine dependence" 2 "vect" { target vect_multiple_sizes } } } */ +/* { dg-final { scan-tree-dump "can't determine dependence" "vect" { target vect_multiple_sizes } } } */ Index: gcc/testsuite/gcc.dg/vect/vect-104.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-104.c 2017-11-03 16:06:03.054282499 +0000 +++ gcc/testsuite/gcc.dg/vect/vect-104.c 2017-11-03 16:06:16.142036841 +0000 @@ -63,5 +63,5 @@ int main (void) /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" } } */ /* { dg-final { scan-tree-dump-times "possible dependence between data-refs" 1 "vect" { target { ! vect_multiple_sizes } } } } */ -/* { dg-final { scan-tree-dump-times "possible dependence between data-refs" 2 "vect" { target vect_multiple_sizes } } } */ +/* { dg-final { scan-tree-dump "possible dependence between data-refs" "vect" { target vect_multiple_sizes } } } */ From patchwork Fri Nov 3 16:19:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 117941 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp3654527qgn; Fri, 3 Nov 2017 09:20:02 -0700 (PDT) X-Google-Smtp-Source: ABhQp+TRvLH9bZZYgMls7bREI3F4qjEeRLSYY0NXAxCl410W69D/I5AdS/JQ1XzTmYCT7vgNSH2k X-Received: by 10.99.137.72 with SMTP id v69mr7780662pgd.130.1509726002610; Fri, 03 Nov 2017 09:20:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509726002; cv=none; d=google.com; s=arc-20160816; b=dojyvWVEKUaiToSTyQDHto9mD2Igqfim+QPP2JHwuD+jFqMmxqQb4OI7UP87yk08OS eNJstGT96TwkNA3vXMv3kf9LsWZE2O4Pnvik3h2z8lr2nr+P8PDRonT/Nh5xzMJNtTWN osg9Kj95BsGu5h9Jc4iVBaZgGpez7zAlOMhbxoQki/5bR3n0b2NT03laSTnLNRqu5DVr 3u6oWF2brdq6UWzw/KYgNuoavYpwdt49tNpsMXYyshgkr0rEGzCXANJi/zQdJ0ISCzuz KwKatqeS3YIuqbNYijZ39l/oA+4AN2TlQPyDmPNIkjC4+M/FIXLm5L1CpTbrkaYORSZ6 vnwA== 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=mAL/+rmD3iIWDPrO+bTME3Ac808Xm7qpD7vhAm05wsM=; b=u0805Ae+TblNoNa47ajveys3CWWsSM7LGHj1QaLYqXeO8n9u71RmD8wSoT9S62bJku 3vWGbNXlkVuGwL4FU8j+XUhNy6fAT1ECICrU+Mm0MOpUO+Tpa/7LiPjlTaVZnH5afyjk jMlG0cTz3Kfyq4ZGkC7shKElKPLdwPm+oXuqTzGuYKbb/N3FlGrHSrq5D+3dPfjXwqQl Bi+9z2rFkyk0qBUN0I0/tyCekDOsOqjYdxF5hPalNym8pgd7uD88xBQdkF7z/+2w67Xr DSz1sN146Rr1cVkxgrMSQt2GohH5ayfDh5Wu9aEUpIJK7s4uPebRVYduClQBmKwZeoUJ /MGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=o7/KGvSG; spf=pass (google.com: domain of gcc-patches-return-465876-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-465876-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 98si5409115plt.495.2017.11.03.09.20.02 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Nov 2017 09:20:02 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-465876-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=o7/KGvSG; spf=pass (google.com: domain of gcc-patches-return-465876-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-465876-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=hhIAsDQytO18q2OalxCnnkiXGKvJE GRepAx3K2ZqcM4ei4w93kfkwuoBYr+3Ueo2J5YS1JAES5cW9yo05mBWm/vcttXw4 qIxw1v0OJ4V+3drlT+A+SyG8ChIlVVhSsFcPeZlrFGkVcb/Zok1W7OJu4Rw8Cn4O b5IKuxHTpOQ98M= 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=GdrVwK5F9BKZy9VoWXpsFaoUNb4=; b=o7/ KGvSGNBPPFmloZvPd9OCu1Hh9wRHPZHBHXMaZb0Nh1DKQNuKeVBwziUpOt6x1+S9 UvBNyypqvhNuwSUXbbLOU6VTM7ZcUi2sJ3U0RtFPt95XnxsGByQhv9QdgphwE9xT R0C+5fITWwjn1weczi4qR6uCeTIVOlUSIvxxCVjo= Received: (qmail 38659 invoked by alias); 3 Nov 2017 16:19:45 -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 38616 invoked by uid 89); 3 Nov 2017 16:19:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-15.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=dots X-HELO: mail-wm0-f54.google.com Received: from mail-wm0-f54.google.com (HELO mail-wm0-f54.google.com) (74.125.82.54) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 03 Nov 2017 16:19:41 +0000 Received: by mail-wm0-f54.google.com with SMTP id r68so2638729wmr.3 for ; Fri, 03 Nov 2017 09:19:41 -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=mAL/+rmD3iIWDPrO+bTME3Ac808Xm7qpD7vhAm05wsM=; b=I0J8DXJL+1W3s0Rb2LpRYCENjynXK4xF+Zo/hP1Lc4zs3bnUslTNpGSQVs1uKQPSiG POOUvjEbZxTRfpbiRBr+gCPynqM+I9fOAhrI9/h25OJRjcYJxsH9tVcV1dcRfsI7/IYP 2pm+3okL/8RAyzEcWmZlFjrn1/SJzD6pHRUYVtRlURIZLiBt0sK7LNImGyaisJgBmbGA PlMArwmOxV4IWL2QpPnxHiagTdTno0qmQCeyLJRtVS1RV6wO0WVefuRTLqKRjxVlU3lF V1lxIei+7HiL8rU6RtDQd3tyyw8njSfWqyxSwrD2YFctkFx2B9SqI9GET0MgmjUj/eis bDlg== X-Gm-Message-State: AJaThX5bHVNk2/ed+ugt2wyQP179IRWTWgFPrzUknZ7pJIKyEpaqlVc1 4mV76a2cZPX576pEb17slO16R71BSSw= X-Received: by 10.28.55.197 with SMTP id e188mr291951wma.60.1509725979329; Fri, 03 Nov 2017 09:19:39 -0700 (PDT) Received: from localhost (188.29.164.162.threembb.co.uk. [188.29.164.162]) by smtp.gmail.com with ESMTPSA id h185sm2488948wma.19.2017.11.03.09.19.38 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 Nov 2017 09:19:38 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@linaro.org Subject: [5/10] Add vect_perm3_* target selectors References: <87inerqqyz.fsf@linaro.org> Date: Fri, 03 Nov 2017 16:19:36 +0000 In-Reply-To: <87inerqqyz.fsf@linaro.org> (Richard Sandiford's message of "Fri, 03 Nov 2017 16:14:44 +0000") Message-ID: <87vairpc6f.fsf@linaro.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 SLP load permutation fails if any individual permutation requires more than two vector inputs. For 128-bit vectors, it's possible to permute 3 contiguous loads of 32-bit and 8-bit elements, but not 16-bit elements or 64-bit elements. The results are reversed for 256-bit vectors, and so on for wider vectors. This patch adds a routine that tests whether a permute will require three vectors for a given vector count and element size, then adds vect_perm3_* target selectors for the cases that we currently use. 2017-11-03 Richard Sandiford Alan Hayward David Sherwood gcc/ * doc/sourcebuild.texi (vect_perm_short, vect_perm_byte): Document previously undocumented selectors. (vect_perm3_byte, vect_perm3_short, vect_perm3_int): Document. gcc/testsuite/ * lib/target-supports.exp (vect_perm_supported): New proc. (check_effective_target_vect_perm3_int): Likewise. (check_effective_target_vect_perm3_short): Likewise. (check_effective_target_vect_perm3_byte): Likewise. * gcc.dg/vect/slp-perm-1.c: Expect SLP load permutation to succeed if vect_perm3_int. * gcc.dg/vect/slp-perm-5.c: Likewise. * gcc.dg/vect/slp-perm-6.c: Likewise. * gcc.dg/vect/slp-perm-7.c: Likewise. * gcc.dg/vect/slp-perm-8.c: Likewise vect_perm3_byte. * gcc.dg/vect/slp-perm-9.c: Likewise vect_perm3_short. Use vect_perm_short instead of vect_perm. Add a scan-tree-dump-not test for vect_perm3_short targets. Index: gcc/doc/sourcebuild.texi =================================================================== --- gcc/doc/sourcebuild.texi 2017-10-26 12:27:58.124235242 +0100 +++ gcc/doc/sourcebuild.texi 2017-11-03 16:06:19.377029536 +0000 @@ -1448,6 +1448,32 @@ element types. @item vect_perm Target supports vector permutation. +@item vect_perm_byte +Target supports permutation of vectors with 8-bit elements. + +@item vect_perm_short +Target supports permutation of vectors with 16-bit elements. + +@item vect_perm3_byte +Target supports permutation of vectors with 8-bit elements, and for the +default vector length it is possible to permute: +@example +@{ a0, a1, a2, b0, b1, b2, @dots{} @} +@end example +to: +@example +@{ a0, a0, a0, b0, b0, b0, @dots{} @} +@{ a1, a1, a1, b1, b1, b1, @dots{} @} +@{ a2, a2, a2, b2, b2, b2, @dots{} @} +@end example +using only two-vector permutes, regardless of how long the sequence is. + +@item vect_perm3_int +Like @code{vect_perm3_byte}, but for 32-bit elements. + +@item vect_perm3_short +Like @code{vect_perm3_byte}, but for 16-bit elements. + @item vect_shift Target supports a hardware vector shift operation. Index: gcc/testsuite/lib/target-supports.exp =================================================================== --- gcc/testsuite/lib/target-supports.exp 2017-11-03 16:06:12.625838683 +0000 +++ gcc/testsuite/lib/target-supports.exp 2017-11-03 16:06:19.378029224 +0000 @@ -5547,6 +5547,78 @@ proc check_effective_target_vect_perm { return $et_vect_perm_saved($et_index) } +# Return 1 if, for some VF: +# +# - the target's default vector size is VF * ELEMENT_BITS bits +# +# - it is possible to implement the equivalent of: +# +# int_t s1[COUNT][COUNT * VF], s2[COUNT * VF]; +# for (int i = 0; i < COUNT; ++i) +# for (int j = 0; j < COUNT * VF; ++j) +# s1[i][j] = s2[j - j % COUNT + i] +# +# using only a single 2-vector permute for each vector in s1. +# +# E.g. for COUNT == 3 and vector length 4, the two arrays would be: +# +# s2 | a0 a1 a2 a3 | b0 b1 b2 b3 | c0 c1 c2 c3 +# ------+-------------+-------------+------------ +# s1[0] | a0 a0 a0 a3 | a3 a3 b2 b2 | b2 c1 c1 c1 +# s1[1] | a1 a1 a1 b0 | b0 b0 b3 b3 | b3 c2 c2 c2 +# s1[2] | a2 a2 a2 b1 | b1 b1 c0 c0 | c0 c3 c3 c3 +# +# Each s1 permute requires only two of a, b and c. +# +# The distance between the start of vector n in s1[0] and the start +# of vector n in s2 is: +# +# A = (n * VF) % COUNT +# +# The corresponding value for the end of vector n is: +# +# B = (n * VF + VF - 1) % COUNT +# +# Subtracting i from each value gives the corresponding difference +# for s1[i]. The condition being tested by this function is false +# iff A - i > 0 and B - i < 0 for some i and n, such that the first +# element for s1[i] comes from vector n - 1 of s2 and the last element +# comes from vector n + 1 of s2. The condition is therefore true iff +# A <= B for all n. This is turn means the condition is true iff: +# +# (n * VF) % COUNT + (VF - 1) % COUNT < COUNT +# +# for all n. COUNT - (n * VF) % COUNT is bounded by gcd (VF, COUNT), +# and will be that value for at least one n in [0, COUNT), so we want: +# +# (VF - 1) % COUNT < gcd (VF, COUNT) + +proc vect_perm_supported { count element_bits } { + set vector_bits [lindex [available_vector_sizes] 0] + if { $vector_bits <= 0 } { + return 0 + } + set vf [expr { $vector_bits / $element_bits }] + + # Compute gcd (VF, COUNT). + set gcd $vf + set temp1 $count + while { $temp1 > 0 } { + set temp2 [expr { $gcd % $temp1 }] + set gcd $temp1 + set temp1 $temp2 + } + return [expr { ($vf - 1) % $count < $gcd }] +} + +# Return 1 if the target supports SLP permutation of 3 vectors when each +# element has 32 bits. + +proc check_effective_target_vect_perm3_int { } { + return [expr { [check_effective_target_vect_perm] + && [vect_perm_supported 3 32] }] +} + # Return 1 if the target plus current options supports vector permutation # on byte-sized elements, 0 otherwise. # @@ -5578,6 +5650,14 @@ proc check_effective_target_vect_perm_by return $et_vect_perm_byte_saved($et_index) } +# Return 1 if the target supports SLP permutation of 3 vectors when each +# element has 8 bits. + +proc check_effective_target_vect_perm3_byte { } { + return [expr { [check_effective_target_vect_perm_byte] + && [vect_perm_supported 3 8] }] +} + # Return 1 if the target plus current options supports vector permutation # on short-sized elements, 0 otherwise. # @@ -5609,6 +5689,14 @@ proc check_effective_target_vect_perm_sh return $et_vect_perm_short_saved($et_index) } +# Return 1 if the target supports SLP permutation of 3 vectors when each +# element has 16 bits. + +proc check_effective_target_vect_perm3_short { } { + return [expr { [check_effective_target_vect_perm_short] + && [vect_perm_supported 3 16] }] +} + # Return 1 if the target plus current options supports folding of # copysign into XORSIGN. # Index: gcc/testsuite/gcc.dg/vect/slp-perm-1.c =================================================================== --- gcc/testsuite/gcc.dg/vect/slp-perm-1.c 2017-11-03 16:06:08.011089914 +0000 +++ gcc/testsuite/gcc.dg/vect/slp-perm-1.c 2017-11-03 16:06:19.377029536 +0000 @@ -80,9 +80,9 @@ int main (int argc, const char* argv[]) } /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_perm } } } */ -/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target { vect_perm && {! vect_load_lanes } } } } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target { vect_perm3_int && {! vect_load_lanes } } } } } */ /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" { target vect_load_lanes } } } */ -/* { dg-final { scan-tree-dump "note: Built SLP cancelled: can use load/store-lanes" "vect" { target { vect_perm && vect_load_lanes } } } } */ +/* { dg-final { scan-tree-dump "note: Built SLP cancelled: can use load/store-lanes" "vect" { target { vect_perm3_int && vect_load_lanes } } } } */ /* { dg-final { scan-tree-dump "LOAD_LANES" "vect" { target vect_load_lanes } } } */ /* { dg-final { scan-tree-dump "STORE_LANES" "vect" { target vect_load_lanes } } } */ Index: gcc/testsuite/gcc.dg/vect/slp-perm-5.c =================================================================== --- gcc/testsuite/gcc.dg/vect/slp-perm-5.c 2017-11-03 16:06:08.012090077 +0000 +++ gcc/testsuite/gcc.dg/vect/slp-perm-5.c 2017-11-03 16:06:19.377029536 +0000 @@ -104,9 +104,9 @@ int main (int argc, const char* argv[]) } /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_perm } } } */ -/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { target { vect_perm && {! vect_load_lanes } } } } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { target { vect_perm3_int && {! vect_load_lanes } } } } } */ /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" { target vect_load_lanes } } } */ -/* { dg-final { scan-tree-dump "note: Built SLP cancelled: can use load/store-lanes" "vect" { target { vect_perm && vect_load_lanes } } } } */ +/* { dg-final { scan-tree-dump "note: Built SLP cancelled: can use load/store-lanes" "vect" { target { vect_perm3_int && vect_load_lanes } } } } */ /* { dg-final { scan-tree-dump "LOAD_LANES" "vect" { target vect_load_lanes } } } */ /* { dg-final { scan-tree-dump "STORE_LANES" "vect" { target vect_load_lanes } } } */ Index: gcc/testsuite/gcc.dg/vect/slp-perm-6.c =================================================================== --- gcc/testsuite/gcc.dg/vect/slp-perm-6.c 2017-11-03 16:06:08.012090077 +0000 +++ gcc/testsuite/gcc.dg/vect/slp-perm-6.c 2017-11-03 16:06:19.377029536 +0000 @@ -103,8 +103,8 @@ int main (int argc, const char* argv[]) } /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_perm } } } */ -/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { target { vect_perm && {! vect_load_lanes } } } } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { target { vect_perm3_int && {! vect_load_lanes } } } } } */ /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_load_lanes } } } */ -/* { dg-final { scan-tree-dump "note: Built SLP cancelled: can use load/store-lanes" "vect" { target { vect_perm && vect_load_lanes } } } } */ +/* { dg-final { scan-tree-dump "note: Built SLP cancelled: can use load/store-lanes" "vect" { target { vect_perm3_int && vect_load_lanes } } } } */ /* { dg-final { scan-tree-dump "LOAD_LANES" "vect" { target vect_load_lanes } } } */ /* { dg-final { scan-tree-dump "STORE_LANES" "vect" { target vect_load_lanes } } } */ Index: gcc/testsuite/gcc.dg/vect/slp-perm-7.c =================================================================== --- gcc/testsuite/gcc.dg/vect/slp-perm-7.c 2017-11-03 16:06:08.012090077 +0000 +++ gcc/testsuite/gcc.dg/vect/slp-perm-7.c 2017-11-03 16:06:19.377029536 +0000 @@ -96,8 +96,8 @@ int main (int argc, const char* argv[]) } /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_perm } } } */ -/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target { vect_perm && {! vect_load_lanes } } } } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target { vect_perm3_int && { ! vect_load_lanes } } } } } */ /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" { target vect_load_lanes } } } */ -/* { dg-final { scan-tree-dump "note: Built SLP cancelled: can use load/store-lanes" "vect" { target { vect_perm && vect_load_lanes } } } } */ +/* { dg-final { scan-tree-dump "note: Built SLP cancelled: can use load/store-lanes" "vect" { target { vect_perm3_int && vect_load_lanes } } } } */ /* { dg-final { scan-tree-dump "LOAD_LANES" "vect" { target vect_load_lanes } } } */ /* { dg-final { scan-tree-dump "STORE_LANES" "vect" { target vect_load_lanes } } } */ Index: gcc/testsuite/gcc.dg/vect/slp-perm-8.c =================================================================== --- gcc/testsuite/gcc.dg/vect/slp-perm-8.c 2017-11-03 16:06:08.012090077 +0000 +++ gcc/testsuite/gcc.dg/vect/slp-perm-8.c 2017-11-03 16:06:19.377029536 +0000 @@ -60,8 +60,8 @@ int main (int argc, const char* argv[]) } /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_perm_byte } } } } */ -/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target { vect_perm_byte && {! vect_load_lanes } } } } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target { vect_perm3_byte && { ! vect_load_lanes } } } } } */ /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" { target vect_load_lanes } } } */ -/* { dg-final { scan-tree-dump "note: Built SLP cancelled: can use load/store-lanes" "vect" { target { vect_perm_byte && vect_load_lanes } } } } */ +/* { dg-final { scan-tree-dump "note: Built SLP cancelled: can use load/store-lanes" "vect" { target { vect_perm3_byte && vect_load_lanes } } } } */ /* { dg-final { scan-tree-dump "LOAD_LANES" "vect" { target vect_load_lanes } } } */ /* { dg-final { scan-tree-dump "STORE_LANES" "vect" { target vect_load_lanes } } } */ Index: gcc/testsuite/gcc.dg/vect/slp-perm-9.c =================================================================== --- gcc/testsuite/gcc.dg/vect/slp-perm-9.c 2017-11-03 16:06:08.012090077 +0000 +++ gcc/testsuite/gcc.dg/vect/slp-perm-9.c 2017-11-03 16:06:19.378029224 +0000 @@ -57,9 +57,10 @@ int main (int argc, const char* argv[]) return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 2 "vect" { target { {! vect_perm } || {! vect_sizes_16B_8B } } } } } */ -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { { vect_perm } && { vect_sizes_16B_8B } } } } } */ -/* { dg-final { scan-tree-dump-times "permutation requires at least three vectors" 1 "vect" { target vect_perm_short } } } */ -/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" { target { {! vect_perm } || {! vect_sizes_32B_16B } } } } } */ -/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target { { vect_perm } && { vect_sizes_32B_16B } } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 2 "vect" { target { ! { vect_perm_short || vect_load_lanes } } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_perm_short || vect_load_lanes } } } } */ +/* { dg-final { scan-tree-dump-times "permutation requires at least three vectors" 1 "vect" { target { vect_perm_short && { ! vect_perm3_short } } } } } */ +/* { dg-final { scan-tree-dump-not "permutation requires at least three vectors" "vect" { target vect_perm3_short } } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" { target { { ! vect_perm3_short } || vect_load_lanes } } } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target { vect_perm3_short && { ! vect_load_lanes } } } } } */ From patchwork Fri Nov 3 16:20:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 117942 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp3654962qgn; Fri, 3 Nov 2017 09:20:30 -0700 (PDT) X-Google-Smtp-Source: ABhQp+SJqgSVU8vXmRmhCGizOCKVwkgHv7oqEl0MxV6ir/b6YVFaizNu+xXjFotMWL17cQ5Lm6rp X-Received: by 10.84.224.132 with SMTP id s4mr7234784plj.409.1509726030516; Fri, 03 Nov 2017 09:20:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509726030; cv=none; d=google.com; s=arc-20160816; b=XuuIBSdIPJIDITlRVd8h/yQ9cKW7oIJXeiSJbf0RaEU9YraK6Xr0r94/PeL418ptZT TXfZznlV5JE9wwg8O0CNOQzTdanYvRgbIakA2TE1IChLVElED7SrXILs6uZkvrHq6Qrk C0oJRLalBDBvxX5b2re6oeDx5CAUHBC389KEZXGePmNFe5uAVK9Ns7mKGsK3UA+oIiny mzJg7RzDoZYKKIA4TfdZKW4S+o7QRViszmhoFdHU8tTCfcAA0n8JQH4jSOdCCea3EcIp /2yTwPAH0OGPSoB/gEILqGE7zo/26nC7FXTF2rz0d5ptlOAFQXbb+6pdIBaYGJ6vM5Ee 0K+g== 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=l9M2Gih1JTqNRQH7lZP9w6uyIQsd8n71FFhQ74LixBM=; b=Pe/ptwz6/qt0+fd08UXKbfSpynoxoDj68jTYQqn2+jIdCWDAkvruKtV0pBc2hGUquq lgoOqJEgj5DgkcWTJZz/5aZJ7F7K9c99c/o1lJGCzxdvd6P7RPPdyIMMvpc5zkpztplD g0ywbrebLr/Zcg1T5lq9EN1Dlp4QuU4uA600KkWSjPpSc4CBLBWW2QcsmxVv44qmBdS6 1wyavOSmjLyxI1JBppKuJ2Ft400OpqIQTnyngpurEQf3hdshvg3Oas9IyoUoUTvKVX69 TXqomn8VTOd6gg01vLWpz4nnn3dw/1bsoyno8qI3+0RgTi61FukKLicvi5Va2EBxwyVY NjYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=ae//omyb; spf=pass (google.com: domain of gcc-patches-return-465877-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-465877-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 r10si6833125pfd.323.2017.11.03.09.20.30 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Nov 2017 09:20:30 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-465877-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=ae//omyb; spf=pass (google.com: domain of gcc-patches-return-465877-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-465877-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=dGIDC0+beVg8XR/r4wNsi4u4TE6EF EydiMsmAgn8YM0Ks3ZMlrJm/AEROEhHXHs90UjCL4VgRq0GZD2GjVlFq3XgZS5KX J0erBx/hnbPHayAPrh5Qpn3Rq3nqHB+g6yFKgRAs3/PZaUi99cqOugtSdzU+EPit KocixGMKTHGM/Q= 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=/DifDBee2FmljIXeE+/uDml+dM8=; b=ae/ /omybhE6zBZR+LB+nv5HweQorAD3W595VfkisbjMTRtEuFlq68Hcv4CD1p8Azaxi +c7aAJPWXQprW6TTJms1a4G1kvgndwvwchM+f1wD+uFjjmvFc7lcjSMUgCap+pF1 0Nm3y9bHYWAFKlGV8698/yO2VZ5CsN5TS2bi4Ioc= Received: (qmail 40436 invoked by alias); 3 Nov 2017 16:20:12 -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 40427 invoked by uid 89); 3 Nov 2017 16:20:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-10.5 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-wm0-f51.google.com Received: from mail-wm0-f51.google.com (HELO mail-wm0-f51.google.com) (74.125.82.51) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 03 Nov 2017 16:20:09 +0000 Received: by mail-wm0-f51.google.com with SMTP id z3so2625867wme.5 for ; Fri, 03 Nov 2017 09:20:08 -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=l9M2Gih1JTqNRQH7lZP9w6uyIQsd8n71FFhQ74LixBM=; b=N7BrKgFcWZaxKof+kRBDFHIkOJl55CVOzjL4QNqAcfs0M01DWfyiyf3Rto5XSfzgot oF/z0L+igJ6WK60y0Tj2lm0K26jJ64QX8Ns+yhHnZ7ctyj2gHtkP9oXkOscjE4lhCfFS +Wse+GwiMS58T0c86IHglkXOORJ7cBdA7FInbY200cEnbcPRUY8mDJT9wdu/lVRo/mct MZUDpL8Wfh2bECwo7oD7k8MLX+190JRU+JNw2xV3rQY00cP0jRqtDBvY4TaPeKkcGTVV n2gYqrHIPPRPzMlQ4BeNhRNf++muPY11hU2LKkROfV3k29vrZIC3utdwAIYCU0DpdnjZ VWEg== X-Gm-Message-State: AJaThX4XzNgcKmKML+S6yz7t3gRMSyjQuoigHOhbvqLUqUF3Pv3dSa3o O3TqOHrQ2FMxDfxLter89ps8pW1ohcQ= X-Received: by 10.28.139.144 with SMTP id n138mr278599wmd.78.1509726006586; Fri, 03 Nov 2017 09:20:06 -0700 (PDT) Received: from localhost (188.29.164.162.threembb.co.uk. [188.29.164.162]) by smtp.gmail.com with ESMTPSA id p28sm5011596wmf.2.2017.11.03.09.20.05 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 Nov 2017 09:20:05 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@linaro.org Subject: [6/10] Add a vect_element_align_preferred target selector References: <87inerqqyz.fsf@linaro.org> Date: Fri, 03 Nov 2017 16:20:03 +0000 In-Reply-To: <87inerqqyz.fsf@linaro.org> (Richard Sandiford's message of "Fri, 03 Nov 2017 16:14:44 +0000") Message-ID: <87r2tfpc5o.fsf@linaro.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 This patch adds a target selector for targets whose preferred_vector_alignment is the alignment of one element. We'll never peel in that case, and the step of a loop that operates on normal (as opposed to packed) elements will always divide the preferred alignment. 2017-11-03 Richard Sandiford Alan Hayward David Sherwood gcc/ * doc/sourcebuild.texi (vect_element_align_preferred): Document. gcc/testsuite/ * lib/target-supports.exp (check_effective_target_vect_element_align_preferred): New proc. (check_effective_target_vect_peeling_profitable): Test it. * gcc.dg/vect/no-section-anchors-vect-31.c: Don't expect peeling if vect_element_align_preferred. * gcc.dg/vect/no-section-anchors-vect-64.c: Likewise. * gcc.dg/vect/pr65310.c: Likewise. * gcc.dg/vect/vect-26.c: Likewise. * gcc.dg/vect/vect-54.c: Likewise. * gcc.dg/vect/vect-56.c: Likewise. * gcc.dg/vect/vect-58.c: Likewise. * gcc.dg/vect/vect-60.c: Likewise. * gcc.dg/vect/vect-89-big-array.c: Likewise. * gcc.dg/vect/vect-89.c: Likewise. * gcc.dg/vect/vect-92.c: Likewise. * gcc.dg/vect/vect-peel-1.c: Likewise. * gcc.dg/vect/vect-outer-3a-big-array.c: Expect the step to divide the alignment if vect_element_align_preferred. * gcc.dg/vect/vect-outer-3a.c: Likewise. Index: gcc/doc/sourcebuild.texi =================================================================== --- gcc/doc/sourcebuild.texi 2017-11-03 16:06:19.377029536 +0000 +++ gcc/doc/sourcebuild.texi 2017-11-03 16:06:22.561036988 +0000 @@ -1383,6 +1383,10 @@ have different type from the value opera @item vect_double Target supports hardware vectors of @code{double}. +@item vect_element_align_preferred +The target's preferred vector alignment is the same as the element +alignment. + @item vect_float Target supports hardware vectors of @code{float}. Index: gcc/testsuite/lib/target-supports.exp =================================================================== --- gcc/testsuite/lib/target-supports.exp 2017-11-03 16:06:19.378029224 +0000 +++ gcc/testsuite/lib/target-supports.exp 2017-11-03 16:06:22.564036053 +0000 @@ -3290,7 +3290,8 @@ proc check_effective_target_vect_peeling } else { set et_vect_peeling_profitable_saved($et_index) 1 if { ([istarget s390*-*-*] - && [check_effective_target_s390_vx]) } { + && [check_effective_target_s390_vx]) + || [check_effective_target_vect_element_align_preferred] } { set et_vect_peeling_profitable_saved($et_index) 0 } } @@ -6342,6 +6343,13 @@ proc check_effective_target_vect_natural return $et_vect_natural_alignment } +# Return 1 if the target doesn't prefer any alignment beyond element +# alignment during vectorization. + +proc check_effective_target_vect_element_align_preferred { } { + return [check_effective_target_vect_variable_length] +} + # Return 1 if vector alignment (for types of size 32 bit or less) is reachable, 0 otherwise. proc check_effective_target_vector_alignment_reachable { } { Index: gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-31.c =================================================================== --- gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-31.c 2017-11-03 16:06:08.010089752 +0000 +++ gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-31.c 2017-11-03 16:06:22.561036988 +0000 @@ -94,4 +94,4 @@ int main (void) /* { dg-final { scan-tree-dump-times "vectorized 4 loops" 1 "vect" } } */ /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */ -/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" } } */ +/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { xfail vect_element_align_preferred } } } */ Index: gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-64.c =================================================================== --- gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-64.c 2017-11-03 16:06:08.010089752 +0000 +++ gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-64.c 2017-11-03 16:06:22.562036677 +0000 @@ -91,4 +91,4 @@ int main (void) /* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" } } */ /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */ -/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" } } */ +/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { xfail vect_element_align_preferred } } } */ Index: gcc/testsuite/gcc.dg/vect/pr65310.c =================================================================== --- gcc/testsuite/gcc.dg/vect/pr65310.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/pr65310.c 2017-11-03 16:06:22.562036677 +0000 @@ -18,5 +18,5 @@ int t(b *a) /* The memory access is through a pointer of type c which means *ptr is not aligned. */ -/* { dg-final { scan-tree-dump "can't force alignment" "vect" } } */ -/* { dg-final { scan-tree-dump-not "misalign = 0" "vect" } } */ +/* { dg-final { scan-tree-dump "can't force alignment" "vect" { xfail vect_element_align_preferred } } } */ +/* { dg-final { scan-tree-dump-not "misalign = 0" "vect" { xfail vect_element_align_preferred } } } */ Index: gcc/testsuite/gcc.dg/vect/vect-26.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-26.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/vect-26.c 2017-11-03 16:06:22.562036677 +0000 @@ -37,4 +37,4 @@ int main (void) /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */ -/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" } } */ +/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail vect_element_align_preferred } } } */ Index: gcc/testsuite/gcc.dg/vect/vect-54.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-54.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/vect-54.c 2017-11-03 16:06:22.562036677 +0000 @@ -61,4 +61,4 @@ int main (void) /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */ -/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" } } */ +/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail vect_element_align_preferred } } } */ Index: gcc/testsuite/gcc.dg/vect/vect-56.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-56.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/vect-56.c 2017-11-03 16:06:22.562036677 +0000 @@ -70,5 +70,5 @@ int main (void) /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */ /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { vect_no_align || vect_element_align } } } } */ /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target { vect_element_align } } } } */ -/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" { xfail { vect_element_align } } } } */ -/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { target { vect_element_align } } } } */ +/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" { target { { ! vect_element_align } || vect_element_align_preferred} } } } */ +/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { target { vect_element_align && { ! vect_element_align_preferred } } } } } */ Index: gcc/testsuite/gcc.dg/vect/vect-58.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-58.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/vect-58.c 2017-11-03 16:06:22.562036677 +0000 @@ -59,4 +59,4 @@ int main (void) /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */ -/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" } } */ +/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail vect_element_align_preferred } } } */ Index: gcc/testsuite/gcc.dg/vect/vect-60.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-60.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/vect-60.c 2017-11-03 16:06:22.562036677 +0000 @@ -71,5 +71,5 @@ int main (void) /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */ /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { vect_no_align || vect_element_align } } } } */ /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target { vect_element_align } } } } */ -/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" { xfail { vect_element_align } } } } */ -/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { target { vect_element_align } } } } */ +/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" { target { { ! vect_element_align } || vect_element_align_preferred } } } } */ +/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { target { vect_element_align && { ! vect_element_align_preferred } } } } } */ Index: gcc/testsuite/gcc.dg/vect/vect-89-big-array.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-89-big-array.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/vect-89-big-array.c 2017-11-03 16:06:22.562036677 +0000 @@ -46,4 +46,4 @@ int main (void) /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */ -/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" } } */ +/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail vect_element_align_preferred } } } */ Index: gcc/testsuite/gcc.dg/vect/vect-89.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-89.c 2017-11-03 16:06:08.013090240 +0000 +++ gcc/testsuite/gcc.dg/vect/vect-89.c 2017-11-03 16:06:22.562036677 +0000 @@ -50,4 +50,4 @@ int main (void) /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */ -/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" } } */ +/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail vect_element_align_preferred } } } */ Index: gcc/testsuite/gcc.dg/vect/vect-92.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-92.c 2017-11-03 16:06:08.013090240 +0000 +++ gcc/testsuite/gcc.dg/vect/vect-92.c 2017-11-03 16:06:22.563036365 +0000 @@ -98,4 +98,4 @@ int main (void) /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 3 "vect" } } */ /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */ -/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 3 "vect" } } */ +/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 3 "vect" { xfail vect_element_align_preferred } } } */ Index: gcc/testsuite/gcc.dg/vect/vect-peel-1.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-peel-1.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/vect-peel-1.c 2017-11-03 16:06:22.563036365 +0000 @@ -49,4 +49,4 @@ int main (void) /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target { { vect_element_align } && { vect_aligned_arrays } } } } } */ -/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" } } */ +/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail vect_element_align_preferred } } } */ Index: gcc/testsuite/gcc.dg/vect/vect-outer-3a-big-array.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-outer-3a-big-array.c 2017-09-22 17:44:23.043135080 +0100 +++ gcc/testsuite/gcc.dg/vect/vect-outer-3a-big-array.c 2017-11-03 16:06:22.563036365 +0000 @@ -49,4 +49,4 @@ int main (void) } /* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */ -/* { dg-final { scan-tree-dump-times "step doesn't divide the vector alignment" 1 "vect" } } */ +/* { dg-final { scan-tree-dump-times "step doesn't divide the vector alignment" 1 "vect" { xfail vect_element_align_preferred } } } */ Index: gcc/testsuite/gcc.dg/vect/vect-outer-3a.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-outer-3a.c 2017-09-22 17:44:23.043135080 +0100 +++ gcc/testsuite/gcc.dg/vect/vect-outer-3a.c 2017-11-03 16:06:22.563036365 +0000 @@ -49,4 +49,4 @@ int main (void) } /* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */ -/* { dg-final { scan-tree-dump-times "step doesn't divide the vector alignment" 1 "vect" } } */ +/* { dg-final { scan-tree-dump-times "step doesn't divide the vector alignment" 1 "vect" { xfail vect_element_align_preferred } } } */ From patchwork Fri Nov 3 16:20:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 117943 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp3655871qgn; Fri, 3 Nov 2017 09:21:23 -0700 (PDT) X-Google-Smtp-Source: ABhQp+SFs84WXfWwRcP8cbiRK1aRIBKf4KLLXmZHbyfrmXNkMIvM3//rtD5uBu/DMHn5pGqgX30D X-Received: by 10.159.233.202 with SMTP id b10mr7065879plr.50.1509726083560; Fri, 03 Nov 2017 09:21:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509726083; cv=none; d=google.com; s=arc-20160816; b=1G7TeNRWPf60yybVE8tgTgxQSczSpzTZs2vOWU+ZxXWnqKCjhp/gvAkSDw3onJ0R63 s10ty7vYadRp+RV3ptZO/TmPtcoM7Dmp+WwERfcxEtBlw8NFJ/5MHocy72oka5Kg20CT 6YCp4UyujDBNspY02X/tJrwl+kKlOwvQD7/TJA+vP+A+waFBxyhAWB6wK7BBBL758MOn zx90yaUwrJk13oH99C1q3UsknrX7s/PHhs4FNU5g/eMmx+TPCIWFIFJHtx0NAs1VIeXe TGbMW0OpjCwYztW2wEt1GRtRaNwFUli6KRywq25HzNBdeQrsbKUzCdXUGr1+nEODr3DR fKPA== 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=h10a1xTvEDGwDOkViYzP0yGWVkcPFFLXLWYGDulRuYw=; b=fhq8UtSTKPMPekTcxHgP0X0QvxvPNPjchMr4ubDxeAAThcQtGQqFFY7vxaD2q0DTba 85vlNLqn1qTV2mg/oAmWQNhjcX9OinmUWaNfHBkPtal/m2aQsOZ0XBK65AGB1NYxt9VW XSPkSI2UVm4CNp+CUMO2eO5H5khBn+Xhg+9W51y8JWV3MgqPrgaIHujJr96uB854tZir iCbrguPpPOIGQyHx53OLBaLjNoM47Bsq2Fbm1001Utgk0qPC7+1CJpzVkOj/yh6G70a7 ywwIztYdCvgtGZzbnVXMfckJbQISC7jGQX0Z/SEnoWzZ/7NWqKeKCRPZeDIyQH8Fx8it sn5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=KG59XdJ3; spf=pass (google.com: domain of gcc-patches-return-465878-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-465878-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 p27si6435026pgn.758.2017.11.03.09.21.23 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Nov 2017 09:21:23 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-465878-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=KG59XdJ3; spf=pass (google.com: domain of gcc-patches-return-465878-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-465878-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=BiufZddn08zt+VNkK1Rp0q+odw/b4 xfGZ16VcVLCxxpK7lBzChGbGz1cT5bvPNi23yxYPFTI1/L6A170ohs9YXi/hFVnu q0ZYS/lH6kdM+GroIsjGrBWJoHplVe+pf1fZlFoV8Lrbvf9/gzeqTVjrpVx9lKAX WK6Icelrvx/TsA= 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=M2i8BEHDgljzvXgqBb0hJmODxpA=; b=KG5 9XdJ3fVE5X4KoTPNXA9NkkSnm46CpFi7PvlRbEdKaKr3CzuamyHHaxopdJkxbJyF TDelrBg/ca30AxkjP854Igl2C6jREnlMCsRm69DJ8K4GaYcDt9SWGVFYicK8ybWz bVgg7UW8gIM5mQezWjbWysteGa4dvj7IK5GEhXNo= Received: (qmail 42445 invoked by alias); 3 Nov 2017 16:21:08 -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 42432 invoked by uid 89); 3 Nov 2017 16:21:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-10.5 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-f179.google.com Received: from mail-wr0-f179.google.com (HELO mail-wr0-f179.google.com) (209.85.128.179) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 03 Nov 2017 16:21:04 +0000 Received: by mail-wr0-f179.google.com with SMTP id r79so2956404wrb.13 for ; Fri, 03 Nov 2017 09:21:03 -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=h10a1xTvEDGwDOkViYzP0yGWVkcPFFLXLWYGDulRuYw=; b=OEhKS7jskx/WRFnsza2+QCTduEz7cYNAprLa5s/sC+WTrK9TYxIQYfUwQWvbM7KEm8 ttA+JXphuSYsv3uN80ixmTAMnguOF6IBsGSmo6OY2r7M5IvWnBzlIoFGZCjTEh8YRjQ2 4JgcZHy+wKvafYfXNuTITwkuZ0EleVQZSvK4YalxGw5yFvx2ACd/FJD7+dIEONGrIEOu ziMU2LYudf2zuVp2BTKQfATavzyZHIQROD19ZjHWYGQXO4u1b9yDyEfXaXZG0FZOVBZx 86N2ENw3NDDg7pk0nZtonAZz3CafWcKTjMoYFdIgeOIAM5r2gEeEcgktT6bF/iru1QUn FAWg== X-Gm-Message-State: AMCzsaXxDXaSyQSFVrpCUUP/yxGLlE8s03dqUPajnW7mg+miXToUazyU GzkxhXOLZLcQ7SuKgWTLaJ+E8hEv1d8= X-Received: by 10.223.186.20 with SMTP id o20mr7206266wrg.3.1509726061059; Fri, 03 Nov 2017 09:21:01 -0700 (PDT) Received: from localhost (188.29.164.162.threembb.co.uk. [188.29.164.162]) by smtp.gmail.com with ESMTPSA id n129sm1605115wmn.33.2017.11.03.09.20.59 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 Nov 2017 09:21:00 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@linaro.org Subject: [7/10] Add a vect_unaligned_possible target selector References: <87inerqqyz.fsf@linaro.org> Date: Fri, 03 Nov 2017 16:20:58 +0000 In-Reply-To: <87inerqqyz.fsf@linaro.org> (Richard Sandiford's message of "Fri, 03 Nov 2017 16:14:44 +0000") Message-ID: <87mv43pc45.fsf@linaro.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 This patch adds a target selector that says whether we can ever generate an "unaligned" accesses, where "unaligned" is relative to the target's preferred vector alignment. This is already true if: vect_no_align && { ! vect_hw_misalign } i.e. if the target doesn't have any alignment mechanism and also doesn't allow unaligned accesses. It is also true (for the things tested by gcc.dg/vect) if the target only wants things to be aligned to an element; in that case every normal scalar access is "vector aligned". 2017-11-03 Richard Sandiford Alan Hayward David Sherwood gcc/ * doc/sourcebuild.texi (vect_unaligned_possible): Document. gcc/testsuite/ * lib/target-supports.exp (check_effective_target_vect_unaligned_possible): New proc. * gcc.dg/vect/slp-25.c: Extend XFAIL of peeling for alignment from vect_no_align && { ! vect_hw_misalign } to ! vect_unaligned_possible. * gcc.dg/vect/vect-multitypes-1.c: Likewise. * gcc.dg/vect/vect-109.c: XFAIL vectorisation of an unaligned access to ! vect_unaligned_possible. * gcc.dg/vect/vect-33.c: Likewise. * gcc.dg/vect/vect-42.c: Likewise. * gcc.dg/vect/vect-56.c: Likewise. * gcc.dg/vect/vect-60.c: Likewise. * gcc.dg/vect/vect-96.c: Likewise. * gcc.dg/vect/vect-peel-1.c: Likewise. * gcc.dg/vect/vect-27.c: Extend XFAIL of unaligned vectorization from vect_no_align && { ! vect_hw_misalign } to ! vect_unaligned_possible. * gcc.dg/vect/vect-29.c: Likewise. * gcc.dg/vect/vect-44.c: Likewise. * gcc.dg/vect/vect-48.c: Likewise. * gcc.dg/vect/vect-50.c: Likewise. * gcc.dg/vect/vect-52.c: Likewise. * gcc.dg/vect/vect-72.c: Likewise. * gcc.dg/vect/vect-75-big-array.c: Likewise. * gcc.dg/vect/vect-75.c: Likewise. * gcc.dg/vect/vect-77-alignchecks.c: Likewise. * gcc.dg/vect/vect-77-global.c: Likewise. * gcc.dg/vect/vect-78-alignchecks.c: Likewise. * gcc.dg/vect/vect-78-global.c: Likewise. * gcc.dg/vect/vect-multitypes-3.c: Likewise. * gcc.dg/vect/vect-multitypes-4.c: Likewise. * gcc.dg/vect/vect-multitypes-6.c: Likewise. * gcc.dg/vect/vect-peel-4.c: Likewise. * gcc.dg/vect/vect-peel-3.c: Likewise, and also for peeling for alignment. Index: gcc/doc/sourcebuild.texi =================================================================== --- gcc/doc/sourcebuild.texi 2017-11-03 16:06:22.561036988 +0000 +++ gcc/doc/sourcebuild.texi 2017-11-03 16:06:26.237889385 +0000 @@ -1481,6 +1481,11 @@ Like @code{vect_perm3_byte}, but for 16- @item vect_shift Target supports a hardware vector shift operation. +@item vect_unaligned_possible +Target prefers vectors to have an alignment greater than element +alignment, but also allows unaligned vector accesses in some +circumstances. + @item vect_widen_sum_hi_to_si Target supports a vector widening summation of @code{short} operands into @code{int} results, or can promote (unpack) from @code{short} Index: gcc/testsuite/lib/target-supports.exp =================================================================== --- gcc/testsuite/lib/target-supports.exp 2017-11-03 16:06:22.564036053 +0000 +++ gcc/testsuite/lib/target-supports.exp 2017-11-03 16:06:26.241888136 +0000 @@ -6399,6 +6399,15 @@ proc check_effective_target_vect_element return $et_vect_element_align($et_index) } +# Return 1 if we expect to see unaligned accesses in at least some +# vector dumps. + +proc check_effective_target_vect_unaligned_possible { } { + return [expr { ![check_effective_target_vect_element_align_preferred] + && (![check_effective_target_vect_no_align] + || [check_effective_target_vect_hw_misalign]) }] +} + # Return 1 if the target supports vector LOAD_LANES operations, 0 otherwise. proc check_effective_target_vect_load_lanes { } { Index: gcc/testsuite/gcc.dg/vect/slp-25.c =================================================================== --- gcc/testsuite/gcc.dg/vect/slp-25.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/slp-25.c 2017-11-03 16:06:26.237889385 +0000 @@ -57,4 +57,4 @@ int main (void) /* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */ /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */ -/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { xfail { { vect_no_align && { ! vect_hw_misalign } } || { ! vect_natural_alignment } } } } } */ +/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { xfail { { ! vect_unaligned_possible } || { ! vect_natural_alignment } } } } } */ Index: gcc/testsuite/gcc.dg/vect/vect-multitypes-1.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-multitypes-1.c 2017-11-03 16:06:08.014090402 +0000 +++ gcc/testsuite/gcc.dg/vect/vect-multitypes-1.c 2017-11-03 16:06:26.239888760 +0000 @@ -89,6 +89,6 @@ int main (void) } /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */ -/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { xfail {{ vect_no_align && { ! vect_hw_misalign } } || {vect_sizes_32B_16B }}} } } */ +/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { xfail { { ! vect_unaligned_possible } || vect_sizes_32B_16B } } } } */ /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 4 "vect" { target { vect_no_align && { { ! vect_hw_misalign } && vect_sizes_32B_16B } } }} } */ Index: gcc/testsuite/gcc.dg/vect/vect-109.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-109.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/vect-109.c 2017-11-03 16:06:26.237889385 +0000 @@ -76,5 +76,5 @@ int main (void) /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target vect_element_align } } } */ /* { dg-final { scan-tree-dump-times "not vectorized: unsupported unaligned store" 2 "vect" { xfail vect_element_align } } } */ -/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" { target vect_element_align } } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" { target vect_element_align xfail { ! vect_unaligned_possible } } } } */ Index: gcc/testsuite/gcc.dg/vect/vect-33.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-33.c 2015-06-02 23:53:35.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/vect-33.c 2017-11-03 16:06:26.237889385 +0000 @@ -37,6 +37,6 @@ int main (void) } /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ -/* { dg-final { scan-tree-dump "Vectorizing an unaligned access" "vect" { target { { { ! powerpc*-*-* } && vect_hw_misalign } && { { ! vect64 } || vect_multiple_sizes } } } } } */ +/* { dg-final { scan-tree-dump "Vectorizing an unaligned access" "vect" { target { { { ! powerpc*-*-* } && vect_hw_misalign } && { { ! vect64 } || vect_multiple_sizes } } xfail { ! vect_unaligned_possible } } } } */ /* { dg-final { scan-tree-dump "Alignment of access forced using peeling" "vect" { target { vector_alignment_reachable && { vect64 && {! vect_multiple_sizes} } } } } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target { { {! vector_alignment_reachable} || {! vect64} } && {! vect_hw_misalign} } } } } */ Index: gcc/testsuite/gcc.dg/vect/vect-42.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-42.c 2015-06-02 23:53:35.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/vect-42.c 2017-11-03 16:06:26.237889385 +0000 @@ -67,5 +67,5 @@ int main (void) /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 3 "vect" { target { vect_no_align && { ! vect_hw_misalign } } } } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target { { ! vector_alignment_reachable } && { ! vect_element_align } } } } } */ /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 4 "vect" { xfail { vect_no_align || { { ! vector_alignment_reachable } || vect_element_align } } } } } */ -/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" { target vect_element_align } } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" { target vect_element_align xfail { ! vect_unaligned_possible } } } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { vect_no_align || { { ! vector_alignment_reachable } || vect_element_align } } } } } */ Index: gcc/testsuite/gcc.dg/vect/vect-56.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-56.c 2017-11-03 16:06:22.562036677 +0000 +++ gcc/testsuite/gcc.dg/vect/vect-56.c 2017-11-03 16:06:26.238889073 +0000 @@ -68,7 +68,7 @@ int main (void) } /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */ -/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { vect_no_align || vect_element_align } } } } */ -/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target { vect_element_align } } } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { target { ! vect_element_align } xfail { ! vect_unaligned_possible } } } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target { vect_element_align } xfail { ! vect_unaligned_possible } } } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" { target { { ! vect_element_align } || vect_element_align_preferred} } } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { target { vect_element_align && { ! vect_element_align_preferred } } } } } */ Index: gcc/testsuite/gcc.dg/vect/vect-60.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-60.c 2017-11-03 16:06:22.562036677 +0000 +++ gcc/testsuite/gcc.dg/vect/vect-60.c 2017-11-03 16:06:26.238889073 +0000 @@ -69,7 +69,7 @@ int main (void) } /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */ -/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { vect_no_align || vect_element_align } } } } */ -/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target { vect_element_align } } } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { target { ! vect_element_align } xfail { ! vect_unaligned_possible } } } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target { vect_element_align } xfail { ! vect_unaligned_possible } } } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" { target { { ! vect_element_align } || vect_element_align_preferred } } } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { target { vect_element_align && { ! vect_element_align_preferred } } } } } */ Index: gcc/testsuite/gcc.dg/vect/vect-96.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-96.c 2017-11-03 16:06:08.013090240 +0000 +++ gcc/testsuite/gcc.dg/vect/vect-96.c 2017-11-03 16:06:26.239888760 +0000 @@ -48,6 +48,6 @@ int main (void) For targets that don't support unaligned loads, version for the store. */ /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ -/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target { {! vect_no_align} && vector_alignment_reachable } } } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target { {! vect_no_align} && vector_alignment_reachable } xfail { ! vect_unaligned_possible } } } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { { vect_no_align } || { { ! vector_alignment_reachable} || vect_element_align } } } } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 1 "vect" { target { { vect_no_align && { ! vect_hw_misalign } } || { {! vector_alignment_reachable} && {! vect_element_align} } } } } } */ Index: gcc/testsuite/gcc.dg/vect/vect-peel-1.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-peel-1.c 2017-11-03 16:06:22.563036365 +0000 +++ gcc/testsuite/gcc.dg/vect/vect-peel-1.c 2017-11-03 16:06:26.240888448 +0000 @@ -48,5 +48,5 @@ int main (void) } /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ -/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target { { vect_element_align } && { vect_aligned_arrays } } } } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target { { vect_element_align } && { vect_aligned_arrays } } xfail { ! vect_unaligned_possible } } } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail vect_element_align_preferred } } } */ Index: gcc/testsuite/gcc.dg/vect/vect-27.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-27.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/vect-27.c 2017-11-03 16:06:26.237889385 +0000 @@ -46,5 +46,5 @@ int main (void) /* The initialization induction loop (with aligned access) is also vectorized. */ /* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */ /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_no_align && { ! vect_hw_misalign } } } } } */ -/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { ! vect_unaligned_possible } } } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */ Index: gcc/testsuite/gcc.dg/vect/vect-29.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-29.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/vect-29.c 2017-11-03 16:06:26.237889385 +0000 @@ -51,6 +51,6 @@ int main (void) /* The initialization induction loop (with aligned access) is also vectorized. */ /* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */ -/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { ! vect_unaligned_possible } } } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 1 "vect" {target { vect_no_align && { ! vect_hw_misalign } } } } } */ Index: gcc/testsuite/gcc.dg/vect/vect-44.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-44.c 2017-05-18 07:51:07.308258294 +0100 +++ gcc/testsuite/gcc.dg/vect/vect-44.c 2017-11-03 16:06:26.238889073 +0000 @@ -65,7 +65,7 @@ int main (void) two loads to be aligned). */ /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ -/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" { xfail { ! vect_unaligned_possible } } } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" { xfail { { vect_no_align && { ! vect_hw_misalign } } || {! vector_alignment_reachable} } } } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 3 "vect" { target { vect_no_align && { ! vect_hw_misalign } } } } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 1 "vect" { target { {! vector_alignment_reachable} && {{! vect_no_align} && {! vect_hw_misalign} } } } } } */ Index: gcc/testsuite/gcc.dg/vect/vect-48.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-48.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/vect-48.c 2017-11-03 16:06:26.238889073 +0000 @@ -55,6 +55,6 @@ int main (void) (The store is aligned). */ /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ -/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { ! vect_unaligned_possible } } } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 2 "vect" { target { vect_no_align && { ! vect_hw_misalign } } } } } */ Index: gcc/testsuite/gcc.dg/vect/vect-50.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-50.c 2017-05-18 07:51:07.308258294 +0100 +++ gcc/testsuite/gcc.dg/vect/vect-50.c 2017-11-03 16:06:26.238889073 +0000 @@ -61,8 +61,7 @@ int main (void) align the store will not force the two loads to be aligned). */ /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ -/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */ -/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" { target vect_hw_misalign } } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" { xfail { ! vect_unaligned_possible } } } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" { xfail { { vect_no_align && { ! vect_hw_misalign } } || {! vector_alignment_reachable} } } } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 3 "vect" { target { vect_no_align && { ! vect_hw_misalign } } } } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 1 "vect" { target { {! vector_alignment_reachable} && { {! vect_no_align } && {! vect_hw_misalign } } } } } } */ Index: gcc/testsuite/gcc.dg/vect/vect-52.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-52.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/vect-52.c 2017-11-03 16:06:26.238889073 +0000 @@ -56,6 +56,6 @@ int main (void) (The store is aligned). */ /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ -/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { ! vect_unaligned_possible } } } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 2 "vect" { target { vect_no_align && { ! vect_hw_misalign } } } } } */ Index: gcc/testsuite/gcc.dg/vect/vect-72.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-72.c 2015-12-18 10:17:16.000000000 +0000 +++ gcc/testsuite/gcc.dg/vect/vect-72.c 2017-11-03 16:06:26.238889073 +0000 @@ -48,5 +48,5 @@ int main (void) } /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */ -/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { ! vect_unaligned_possible } } } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */ Index: gcc/testsuite/gcc.dg/vect/vect-75-big-array.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-75-big-array.c 2017-11-03 16:06:03.055282663 +0000 +++ gcc/testsuite/gcc.dg/vect/vect-75-big-array.c 2017-11-03 16:06:26.238889073 +0000 @@ -50,4 +50,4 @@ int main (void) /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target { vect_no_align && { ! vect_hw_misalign } } } } } */ -/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { ! vect_unaligned_possible } } } } */ Index: gcc/testsuite/gcc.dg/vect/vect-75.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-75.c 2017-11-03 16:06:08.013090240 +0000 +++ gcc/testsuite/gcc.dg/vect/vect-75.c 2017-11-03 16:06:26.239888760 +0000 @@ -50,4 +50,4 @@ int main (void) /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target { vect_no_align && { ! vect_hw_misalign } } } } } */ -/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { ! vect_unaligned_possible } } } } */ Index: gcc/testsuite/gcc.dg/vect/vect-77-alignchecks.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-77-alignchecks.c 2017-11-03 16:06:08.013090240 +0000 +++ gcc/testsuite/gcc.dg/vect/vect-77-alignchecks.c 2017-11-03 16:06:26.239888760 +0000 @@ -54,7 +54,7 @@ int main (void) both for the load and the store. */ /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ -/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { ! vect_unaligned_possible } } } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { target { {! vect_no_align} && { unaligned_stack && vector_alignment_reachable } } } } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 1 "vect" { target { { {! unaligned_stack} && { vect_no_align && { ! vect_hw_misalign } } } || {unaligned_stack && { {! vector_alignment_reachable} && {! vect_no_align } } } } } } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 2 "vect" { target { { unaligned_stack && { vector_alignment_reachable && vect_no_align } } || {unaligned_stack && { {! vector_alignment_reachable} && vect_no_align } } } } } } */ Index: gcc/testsuite/gcc.dg/vect/vect-77-global.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-77-global.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/vect-77-global.c 2017-11-03 16:06:26.239888760 +0000 @@ -48,6 +48,6 @@ int main (void) /* Requires versioning for aliasing. */ /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ -/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { ! vect_unaligned_possible } } } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 1 "vect" { target { vect_no_align && { ! vect_hw_misalign } } } } } */ Index: gcc/testsuite/gcc.dg/vect/vect-78-alignchecks.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-78-alignchecks.c 2017-11-03 16:06:08.013090240 +0000 +++ gcc/testsuite/gcc.dg/vect/vect-78-alignchecks.c 2017-11-03 16:06:26.239888760 +0000 @@ -55,7 +55,7 @@ int main (void) both for the load and the store. */ /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ -/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { ! vect_unaligned_possible } } } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { target { {! vect_no_align} && { unaligned_stack && vector_alignment_reachable } } } } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 1 "vect" { target { { {! unaligned_stack} && { vect_no_align && { ! vect_hw_misalign } } } || {unaligned_stack && { {! vector_alignment_reachable} && { ! vect_no_align } } } } } } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 2 "vect" { target { { unaligned_stack && { vector_alignment_reachable && vect_no_align } } || {unaligned_stack && { {! vector_alignment_reachable} && vect_no_align } } } } } } */ Index: gcc/testsuite/gcc.dg/vect/vect-78-global.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-78-global.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/vect-78-global.c 2017-11-03 16:06:26.239888760 +0000 @@ -48,6 +48,6 @@ int main (void) (The store is aligned). */ /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ -/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { ! vect_unaligned_possible } } } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 1 "vect" { target { vect_no_align && { ! vect_hw_misalign } } } } } */ Index: gcc/testsuite/gcc.dg/vect/vect-multitypes-3.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-multitypes-3.c 2017-11-03 16:06:08.014090402 +0000 +++ gcc/testsuite/gcc.dg/vect/vect-multitypes-3.c 2017-11-03 16:06:26.239888760 +0000 @@ -59,5 +59,5 @@ int main (void) /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 3 "vect" { target { vect_no_align && { ! vect_hw_misalign } } } } } */ -/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" {xfail { vect_no_align && { ! vect_hw_misalign } } } } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" { xfail { ! vect_unaligned_possible } } } } */ Index: gcc/testsuite/gcc.dg/vect/vect-multitypes-4.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-multitypes-4.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/vect-multitypes-4.c 2017-11-03 16:06:26.239888760 +0000 @@ -95,6 +95,6 @@ int main (void) /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" { target { vect_element_align} } } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { xfail { vect_no_align || vect_element_align } } } } */ -/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 8 "vect" { xfail { vect_no_align || vect_element_align } } } } */ -/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 4 "vect" { target { vect_element_align } } } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 8 "vect" { target { ! vect_element_align } xfail { ! vect_unaligned_possible } } } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 4 "vect" { target { vect_element_align } xfail { ! vect_unaligned_possible } } } } */ Index: gcc/testsuite/gcc.dg/vect/vect-multitypes-6.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-multitypes-6.c 2017-11-03 16:06:08.014090402 +0000 +++ gcc/testsuite/gcc.dg/vect/vect-multitypes-6.c 2017-11-03 16:06:26.240888448 +0000 @@ -66,5 +66,5 @@ int main (void) /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail { sparc*-*-* && ilp32 } }} } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 6 "vect" { target { vect_no_align && { ! vect_hw_misalign } } } } } */ -/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 6 "vect" {xfail { vect_no_align && { ! vect_hw_misalign } } } } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 6 "vect" { xfail { ! vect_unaligned_possible } } } } */ Index: gcc/testsuite/gcc.dg/vect/vect-peel-4.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-peel-4.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/vect-peel-4.c 2017-11-03 16:06:26.240888448 +0000 @@ -46,5 +46,5 @@ int main (void) } /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */ -/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { ! vect_unaligned_possible } } } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */ Index: gcc/testsuite/gcc.dg/vect/vect-peel-3.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-peel-3.c 2017-11-03 16:06:08.014090402 +0000 +++ gcc/testsuite/gcc.dg/vect/vect-peel-3.c 2017-11-03 16:06:26.240888448 +0000 @@ -61,5 +61,5 @@ int main (void) } /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */ -/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { { vect_no_align && { ! vect_hw_misalign } } || {vect_sizes_32B_16B } } } } } */ -/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { { vect_no_align && { ! vect_hw_misalign } } || {vect_sizes_32B_16B } } } } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { { ! vect_unaligned_possible } || vect_sizes_32B_16B } } } } */ +/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { { ! vect_unaligned_possible } || vect_sizes_32B_16B } } } } */ From patchwork Fri Nov 3 16:21: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: 117944 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp3656415qgn; Fri, 3 Nov 2017 09:21:58 -0700 (PDT) X-Google-Smtp-Source: ABhQp+R/Yi+h3hWig8KJOWkkoky4fKh+QqwzyyqqqJicuLRz20ov32+SWq2hIWoBnLvDJat34/5m X-Received: by 10.84.241.207 with SMTP id t15mr7220776plm.158.1509726118772; Fri, 03 Nov 2017 09:21:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509726118; cv=none; d=google.com; s=arc-20160816; b=XAzH/QNyfXPOQmcMvLWkQbtHF06YzUZBqXw6vYu6MgiU02tsD1M17MqfdSNfTljpWK 5Bxf51HoPZ0LBUBBeqIIbdkf1+cureBLqWMMYr1ykRFBQHcwHqCWUdGPQQO5y7BdssOt 1GftiitxTW5xLguhb0lxqM0ySTcI56vTUmwG3oXoU8Xajqp+2dI9yiONzZwxWnkon5hA d7Skw4aAJlahXKhnFrWcNQGj2IsF6Akbz4Czbql/ffI0z4Oe3NL9gEkxNsRxFUYAWUxq XJtbCJg+3woSKvPL9VRhI1jjOdFE0Q0oMVrVcovQmgVDUJlHJx3wfWBVGiVm0zugr6Gs KiFg== 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=Lq0/l00aUFFPORA/bUGb7ZK72W4SWR2dtYBUapFOHyc=; b=pLcXPy0srCauhMEQHQjdEiCRPJbPTOOw0xRDG4ca1HcBQElumaVDF1aauCLsfotJcT k/h0kJvP+YoNqXdzTYJJJvdUm2HIZGoHWz4c9yxKcHjsCqe/glXO7tQTkyjtxKmVV6d2 1MW3D2F+z+0MYReOaMZYLOWdSFFT3XB3AJd6Qkw8dlkmi2F/A2P4cOCAxhy1OuAY7KFJ kBFJItPCyVmCYhlsVJGVnjmAaeLZHHTGUtG9LH6kCc9n44SuhS+YOfUj6UbYkMyJZUtW HH4WNUhsbjj2jaTFlHWlStKnN1eR6xoeBsXpPHCx+MAVtlCH1aRrtM1nzrQw2z2/b6bw jM9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=gBgDKvUO; spf=pass (google.com: domain of gcc-patches-return-465879-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-465879-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 x67si6712448pfi.166.2017.11.03.09.21.58 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Nov 2017 09:21:58 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-465879-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=gBgDKvUO; spf=pass (google.com: domain of gcc-patches-return-465879-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-465879-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=p4WmjNipxX7H737vfvYch51Uq4LJl zyBjrxRuA4OWphG+60IRrgygOVy0pT+IIEWoSqhoSZkx4l87YNs7/MkFl6OIqE6H g0gxYRFnXHLcPj4rogmpLQaWVAHh46kTVUqQ828n0SvT67PFa2MGVOtK7bpbheel pTJcq9/VymRy+g= 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=3zPW+AiTIV6WTEjaUR2TKJvD+tM=; b=gBg DKvUOyNyeUvpInq7t9jbjHptprPT/GPQav10nKLUJall0+Pp4rMgzS+0gV7jS6j1 h8prAdvOeZkgE+Cse+zRyzL7EPdhX6v0rzj9pDXXC9afFrx6w2U6/2WwGvn2J39y ypqMQhh8N5bBJb+FWfXJHTlMwB+NQFzMpJ9LKEcA= Received: (qmail 44123 invoked by alias); 3 Nov 2017 16:21:46 -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 44113 invoked by uid 89); 3 Nov 2017 16:21:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-15.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_1, 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=commoning, predictive, Executing X-HELO: mail-wm0-f46.google.com Received: from mail-wm0-f46.google.com (HELO mail-wm0-f46.google.com) (74.125.82.46) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 03 Nov 2017 16:21:44 +0000 Received: by mail-wm0-f46.google.com with SMTP id t139so2681438wmt.1 for ; Fri, 03 Nov 2017 09:21: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=Lq0/l00aUFFPORA/bUGb7ZK72W4SWR2dtYBUapFOHyc=; b=jyyYtYqoQGz8j8edod0T60py+jrPjXRFrkW4GrePoJH3DrQBaLRn8X0eiMLAz8WtK6 V0FKTIHB4SQBMCMyowyi0K8YLHl6yN6W5/Z+G3iXe8erLQdeumSisy/Nc6op6wojj31B YDNCWHwRSklVUSvht4zWOvYQweaGjovetXtm4Bjvqnrr/gJCuAo47ffOEQ0Uw+wRuKZE WrI9FvmfeXc5vKXpsRVDao1jyE4yKGA+uM5z5SvGhHCabKnDG3j9UmsUVkyLfr8djIpL jylJaI6v9Sw4eexHJl+EYwbq2pi15vYzMCj7JgNIfu8QMrwrBI2GGuHZxTaSgXMOQ+0g qMdw== X-Gm-Message-State: AJaThX7574b/DAfxF1gbXsvbcsE4z224XbUJdkIFlppXUSjZ6I1TEA9N wjVam9vOpXIT5vNzr40hrGp05rME4rw= X-Received: by 10.28.145.196 with SMTP id t187mr242102wmd.119.1509726102499; Fri, 03 Nov 2017 09:21:42 -0700 (PDT) Received: from localhost (188.29.164.162.threembb.co.uk. [188.29.164.162]) by smtp.gmail.com with ESMTPSA id p200sm2242324wmd.9.2017.11.03.09.21.41 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 Nov 2017 09:21: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: [8/10] Add a vect_variable_length target selector References: <87inerqqyz.fsf@linaro.org> Date: Fri, 03 Nov 2017 16:21:40 +0000 In-Reply-To: <87inerqqyz.fsf@linaro.org> (Richard Sandiford's message of "Fri, 03 Nov 2017 16:14:44 +0000") Message-ID: <87inerpc2z.fsf@linaro.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 This patch adds a target selector for variable-length vectors. Initially it's always false, but the SVE patch provides a case in which it's true. 2017-11-03 Richard Sandiford Alan Hayward David Sherwood gcc/ * doc/sourcebuild.texi (vect_variable_length): Document. gcc/testsuite/ * lib/target-supports.exp (check_effective_target_vect_variable_length): New proc. * gcc.dg/vect/pr60482.c: XFAIL test for no epilog loop if vect_variable_length. * gcc.dg/vect/slp-reduc-6.c: XFAIL two-operation SLP if vect_variable_length. * gcc.dg/vect/vect-alias-check-5.c: XFAIL alias optimization if vect_variable_length. * gfortran.dg/vect/fast-math-mgrid-resid.f: XFAIL predictive commoning optimization if vect_variable_length. Index: gcc/doc/sourcebuild.texi =================================================================== --- gcc/doc/sourcebuild.texi 2017-11-03 16:06:26.237889385 +0000 +++ gcc/doc/sourcebuild.texi 2017-11-03 16:06:52.929591350 +0000 @@ -1486,6 +1486,9 @@ Target prefers vectors to have an alignm alignment, but also allows unaligned vector accesses in some circumstances. +@item vect_variable_length +Target has variable-length vectors. + @item vect_widen_sum_hi_to_si Target supports a vector widening summation of @code{short} operands into @code{int} results, or can promote (unpack) from @code{short} Index: gcc/testsuite/lib/target-supports.exp =================================================================== --- gcc/testsuite/lib/target-supports.exp 2017-11-03 16:06:26.241888136 +0000 +++ gcc/testsuite/lib/target-supports.exp 2017-11-03 16:06:52.930591737 +0000 @@ -6714,6 +6714,12 @@ proc check_effective_target_vect_multipl return [expr { [llength [available_vector_sizes]] > 1 }] } +# Return true if variable-length vectors are supported. + +proc check_effective_target_vect_variable_length { } { + return [expr { [lindex [available_vector_sizes] 0] == 0 }] +} + # Return 1 if the target supports vectors of 64 bits. proc check_effective_target_vect64 { } { Index: gcc/testsuite/gcc.dg/vect/pr60482.c =================================================================== --- gcc/testsuite/gcc.dg/vect/pr60482.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/pr60482.c 2017-11-03 16:06:52.929591350 +0000 @@ -16,4 +16,6 @@ foo (double *x, int n) return p; } -/* { dg-final { scan-tree-dump-not "epilog loop required" "vect" } } */ +/* Until fully-masked loops are supported, we always need an epilog + loop for variable-length vectors. */ +/* { dg-final { scan-tree-dump-not "epilog loop required" "vect" { xfail vect_variable_length } } } */ Index: gcc/testsuite/gcc.dg/vect/slp-reduc-6.c =================================================================== --- gcc/testsuite/gcc.dg/vect/slp-reduc-6.c 2015-06-02 23:53:35.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/slp-reduc-6.c 2017-11-03 16:06:52.929591350 +0000 @@ -44,5 +44,5 @@ int main (void) /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { xfail { vect_no_int_add || { ! { vect_unpack || vect_strided2 } } } } } } */ /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" } } */ -/* { dg-final { scan-tree-dump-times "different interleaving chains in one node" 1 "vect" { target { ! vect_no_int_add } } } } */ +/* { dg-final { scan-tree-dump-times "different interleaving chains in one node" 1 "vect" { target { ! vect_no_int_add } xfail vect_variable_length } } } */ Index: gcc/testsuite/gcc.dg/vect/vect-alias-check-5.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-alias-check-5.c 2017-08-04 11:39:37.910284386 +0100 +++ gcc/testsuite/gcc.dg/vect/vect-alias-check-5.c 2017-11-03 16:06:52.929591350 +0000 @@ -15,5 +15,5 @@ f1 (struct s *a, struct s *b) } /* { dg-final { scan-tree-dump-times "consider run-time aliasing" 1 "vect" } } */ -/* { dg-final { scan-tree-dump-times "improved number of alias checks from 1 to 0" 1 "vect" } } */ +/* { dg-final { scan-tree-dump-times "improved number of alias checks from 1 to 0" 1 "vect" { xfail vect_variable_length } } } */ /* { dg-final { scan-tree-dump-times "LOOP VECTORIZED" 1 "vect" } } */ Index: gcc/testsuite/gfortran.dg/vect/fast-math-mgrid-resid.f =================================================================== --- gcc/testsuite/gfortran.dg/vect/fast-math-mgrid-resid.f 2017-10-04 16:25:39.620051123 +0100 +++ gcc/testsuite/gfortran.dg/vect/fast-math-mgrid-resid.f 2017-11-03 16:06:52.929591350 +0000 @@ -42,5 +42,5 @@ C ! vectorized loop. If vector factor is 2, the vectorized loop can ! be predictive commoned, we check if predictive commoning PHI node ! is created with vector(2) type. -! { dg-final { scan-tree-dump "Executing predictive commoning without unrolling" "pcom" } } -! { dg-final { scan-tree-dump "vectp_u.*__lsm.* = PHI <.*vectp_u.*__lsm" "pcom" } } +! { dg-final { scan-tree-dump "Executing predictive commoning without unrolling" "pcom" { xfail vect_variable_length } } } +! { dg-final { scan-tree-dump "vectp_u.*__lsm.* = PHI <.*vectp_u.*__lsm" "pcom" { xfail vect_variable_length } } } From patchwork Fri Nov 3 16:22:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 117945 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp3657371qgn; Fri, 3 Nov 2017 09:22:59 -0700 (PDT) X-Google-Smtp-Source: ABhQp+Q53lrCeThhsmih2YJhjfkL2zgHGecrOOjwVSLRlWWTL2iNxhfSGmeuIf3Qo9T4Cy4W2coU X-Received: by 10.98.35.194 with SMTP id q63mr8176775pfj.15.1509726179682; Fri, 03 Nov 2017 09:22:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509726179; cv=none; d=google.com; s=arc-20160816; b=pRVLVp3/xs9i16j8oQwOs3Cyysj3Lg1Cjg7yH1psVplu1cZHaHZ7OW7fgpY9MQ00wY Ca3Wc+D8lxnKnhkiZGeYcmqaF/tKXAX/K+Idj+UlGM1N1Ez9OFdDNWzPvcR8501tXKrL PB4kBIpHgzSRjQ306MqCdknOw5/K3sZVa+RS7Fj/SHavNrVa9lonOBs/RwxsuoTnNQkv 0V3uhCXdl5QxsoSdzdzcTEZjML4W6szL2jl6jI0US8VsD18L1SRLT71VedvmArwL6Bt9 r8jRuFfRXELXEtdK3k+zj3aI+FFwGKUjLz7X3Sz1D/UqdTsxXGPIajI4+Rh7DfvJXCmE tlxA== 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=/dP7Z1sp3j7ISkdcobBPKVOqG0cSAFaAKWiBAkHAKIU=; b=lx5rB3JprXYFNSCor1W6SKkwDMx0ivh1ExvolRKf8pggmr6T7YTw6OdQQJZaUsnjrF czXbsO6UKJlvF/pdniFqiV5YbUlpJBoY7n4Y1JxFAXSj0Wbl0w+FSzZzRCkhHygTrQcu m1gHu1infX6nsiyePiL17cSoAC2Ut+mzabwzqHJ5f4OUioNz+xL3ESwDFajCfWnnSUlb RDPs6/vOnNZB/YRreMUuu9zvGkPHijTGFrY2yZ7OfRNhfRgvlrwWzcGla7XXSRmLFBKV pn8yYLJmO1dd+Y3YzGQ9OPFed59P8s/rVpSwoc6fY9oC1VQAdZXHK8hBZTBG1np0pA7s WbEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=YX0m6tTj; spf=pass (google.com: domain of gcc-patches-return-465880-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-465880-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 e4si4758671plt.137.2017.11.03.09.22.59 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Nov 2017 09:22:59 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-465880-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=YX0m6tTj; spf=pass (google.com: domain of gcc-patches-return-465880-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-465880-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=jzkz0kyqky2Y+H4SAlGwo6PX+gItK PWnBAK7NvfDwOFLiU8V0c6FbkiZeoURCUagKAuKK4ooGlR5M9VEo3ILiFzwfXRrY qwOQE3BKRYnlQeEzCHYmpXboN+9BW62+GMXXyrYrwnXwaomKOyKPMcVf05p3Khq2 VWf2pbVcLJ6PlM= 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=PGvVPlQ5bgbbNikPIdQWGsHrfAM=; b=YX0 m6tTjznhqgXUYqSCdMnn/XfcjaibWBKKXrmFFC+058htBYOSO4kaUlHqztDetcff 8b8lj4J7Ws1BPqUU0oy9Pgw1wQMxiHqEdv55Vb/1+bODw9UcDTIHfrvg8RY7WVyE /L5RubGpe4dXDSG/J3ec4N2QdcWS+bxm2Y3ainso= Received: (qmail 45908 invoked by alias); 3 Nov 2017 16:22:43 -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 45893 invoked by uid 89); 3 Nov 2017 16:22:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-10.6 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-wm0-f51.google.com Received: from mail-wm0-f51.google.com (HELO mail-wm0-f51.google.com) (74.125.82.51) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 03 Nov 2017 16:22:39 +0000 Received: by mail-wm0-f51.google.com with SMTP id r196so2598521wmf.2 for ; Fri, 03 Nov 2017 09:22:38 -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=/dP7Z1sp3j7ISkdcobBPKVOqG0cSAFaAKWiBAkHAKIU=; b=OnLNcDjTqTJAwvYoFq6/w2vHuy6L2swsc8aLZ6HeI42Y1xD+snkseQsph3LQYpwu1w ga+OKHCoSCbgCP6gcju2eBGDeZ6divCZoI/dS7+gpOCuEjID5TOrsgy1KapZu2h+N21r oSkosMz4Dw965aQHa6SlsfEoTlINCNBGGpG8wctUwMuc9Uf2xXxgjOFyZPz6ztqRUe4A Lo+BHDKGBRBP4OBjvxlJ3PdUnpF9LBnu2VWXSu0KWP5b0kf3VLV8CrmUqhmCMTg9s0ym qWssrfJeOMQk0gMVcpUFod7Z7tuo51CT1ehxaFte7HqvGFyHIsXwVx0dLTQE883J3ePN oc8A== X-Gm-Message-State: AJaThX6gX2M4t2Qh7p7jkKx6XNG6sZMdHWPbPM6Yo2jBAwTRyiqvxLnk CZcRv3BVxkKfmQdwhhV50aCrpgSW/qI= X-Received: by 10.28.32.216 with SMTP id g207mr249929wmg.138.1509726156498; Fri, 03 Nov 2017 09:22:36 -0700 (PDT) Received: from localhost (188.29.164.162.threembb.co.uk. [188.29.164.162]) by smtp.gmail.com with ESMTPSA id 65sm2661429wrn.27.2017.11.03.09.22.35 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 Nov 2017 09:22:35 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@linaro.org Subject: [9/10] Add a vect_align_stack_vars target selector References: <87inerqqyz.fsf@linaro.org> Date: Fri, 03 Nov 2017 16:22:33 +0000 In-Reply-To: <87inerqqyz.fsf@linaro.org> (Richard Sandiford's message of "Fri, 03 Nov 2017 16:14:44 +0000") Message-ID: <87efpfpc1i.fsf@linaro.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 This patch adds a target selector to say whether it's possible to align a local variable to the target's preferred vector alignment. This can be false for large vectors if the alignment is only a preference and not a hard requirement (and thus if there is no need to support a stack realignment mechanism). 2017-11-03 Richard Sandiford Alan Hayward David Sherwood gcc/ * doc/sourcebuild.texi (vect_align_stack_vars): Document. gcc/testsuite/ * lib/target-supports.exp (check_effective_target_vect_align_stack_vars): New proc. * gcc.dg/vect/vect-23.c: Only expect the array to be aligned if vect_align_stack_vars. * gcc.dg/vect/vect-24.c: Likewise. * gcc.dg/vect/vect-25.c: Likewise. * gcc.dg/vect/vect-26.c: Likewise. * gcc.dg/vect/vect-32-big-array.c: Likewise. * gcc.dg/vect/vect-32.c: Likewise. * gcc.dg/vect/vect-40.c: Likewise. * gcc.dg/vect/vect-42.c: Likewise. * gcc.dg/vect/vect-46.c: Likewise. * gcc.dg/vect/vect-48.c: Likewise. * gcc.dg/vect/vect-52.c: Likewise. * gcc.dg/vect/vect-54.c: Likewise. * gcc.dg/vect/vect-62.c: Likewise. * gcc.dg/vect/vect-67.c: Likewise. * gcc.dg/vect/vect-75-big-array.c: Likewise. * gcc.dg/vect/vect-75.c: Likewise. * gcc.dg/vect/vect-77-alignchecks.c: Likewise. * gcc.dg/vect/vect-78-alignchecks.c: Likewise. * gcc.dg/vect/vect-89-big-array.c: Likewise. * gcc.dg/vect/vect-89.c: Likewise. * gcc.dg/vect/vect-96.c: Likewise. * gcc.dg/vect/vect-multitypes-3.c: Likewise. * gcc.dg/vect/vect-multitypes-6.c: Likewise. Index: gcc/doc/sourcebuild.texi =================================================================== --- gcc/doc/sourcebuild.texi 2017-11-03 16:06:52.929591350 +0000 +++ gcc/doc/sourcebuild.texi 2017-11-03 16:06:56.516976666 +0000 @@ -1373,6 +1373,10 @@ Target supports Fortran @code{real} kind @subsubsection Vector-specific attributes @table @code +@item vect_align_stack_vars +The target's ABI allows stack variables to be aligned to the preferred +vector alignment. + @item vect_condition Target supports vector conditional operations. Index: gcc/testsuite/lib/target-supports.exp =================================================================== --- gcc/testsuite/lib/target-supports.exp 2017-11-03 16:06:52.930591737 +0000 +++ gcc/testsuite/lib/target-supports.exp 2017-11-03 16:06:56.519977825 +0000 @@ -6350,6 +6350,12 @@ proc check_effective_target_vect_element return [check_effective_target_vect_variable_length] } +# Return 1 if we can align stack data to the preferred vector alignment. + +proc check_effective_target_vect_align_stack_vars { } { + return 1 +} + # Return 1 if vector alignment (for types of size 32 bit or less) is reachable, 0 otherwise. proc check_effective_target_vector_alignment_reachable { } { Index: gcc/testsuite/gcc.dg/vect/vect-23.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-23.c 2016-11-22 21:16:10.000000000 +0000 +++ gcc/testsuite/gcc.dg/vect/vect-23.c 2017-11-03 16:06:56.516976666 +0000 @@ -125,4 +125,4 @@ int main (void) } /* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" } } */ -/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail { ! vect_align_stack_vars } } } } */ Index: gcc/testsuite/gcc.dg/vect/vect-24.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-24.c 2017-02-23 19:54:09.000000000 +0000 +++ gcc/testsuite/gcc.dg/vect/vect-24.c 2017-11-03 16:06:56.516976666 +0000 @@ -123,4 +123,4 @@ int main (void) return main1 (); } /* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { xfail { { ! aarch64*-*-* } && { ! arm-*-* } } } } } */ -/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail { ! vect_align_stack_vars } } } } */ Index: gcc/testsuite/gcc.dg/vect/vect-25.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-25.c 2015-06-02 23:53:35.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/vect-25.c 2017-11-03 16:06:56.516976666 +0000 @@ -51,4 +51,4 @@ int main (void) } /* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */ -/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail { ! vect_align_stack_vars } } } } */ Index: gcc/testsuite/gcc.dg/vect/vect-26.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-26.c 2017-11-03 16:06:22.562036677 +0000 +++ gcc/testsuite/gcc.dg/vect/vect-26.c 2017-11-03 16:06:56.516976666 +0000 @@ -36,5 +36,5 @@ int main (void) } /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ -/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */ -/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail vect_element_align_preferred } } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail { ! vect_align_stack_vars } } } } */ +/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { vect_element_align_preferred || { ! vect_align_stack_vars } } } } } */ Index: gcc/testsuite/gcc.dg/vect/vect-32-big-array.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-32-big-array.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/vect-32-big-array.c 2017-11-03 16:06:56.516976666 +0000 @@ -36,4 +36,4 @@ int main (void) } /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ -/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail { ! vect_align_stack_vars } } } } */ Index: gcc/testsuite/gcc.dg/vect/vect-32.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-32.c 2017-11-03 16:06:08.012090077 +0000 +++ gcc/testsuite/gcc.dg/vect/vect-32.c 2017-11-03 16:06:56.516976666 +0000 @@ -40,4 +40,4 @@ int main (void) } /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ -/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail { ! vect_align_stack_vars } } } } */ Index: gcc/testsuite/gcc.dg/vect/vect-40.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-40.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/vect-40.c 2017-11-03 16:06:56.516976666 +0000 @@ -59,4 +59,4 @@ int main (void) } /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect"} } */ -/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail { ! vect_align_stack_vars } } } } */ Index: gcc/testsuite/gcc.dg/vect/vect-42.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-42.c 2017-11-03 16:06:26.237889385 +0000 +++ gcc/testsuite/gcc.dg/vect/vect-42.c 2017-11-03 16:06:56.516976666 +0000 @@ -67,5 +67,5 @@ int main (void) /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 3 "vect" { target { vect_no_align && { ! vect_hw_misalign } } } } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target { { ! vector_alignment_reachable } && { ! vect_element_align } } } } } */ /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 4 "vect" { xfail { vect_no_align || { { ! vector_alignment_reachable } || vect_element_align } } } } } */ -/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" { target vect_element_align xfail { ! vect_unaligned_possible } } } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" { target vect_element_align xfail { ! { vect_unaligned_possible && vect_align_stack_vars } } } } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { vect_no_align || { { ! vector_alignment_reachable } || vect_element_align } } } } } */ Index: gcc/testsuite/gcc.dg/vect/vect-46.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-46.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/vect-46.c 2017-11-03 16:06:56.517977052 +0000 @@ -61,4 +61,4 @@ int main (void) } /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ -/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail { ! vect_align_stack_vars } } } } */ Index: gcc/testsuite/gcc.dg/vect/vect-48.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-48.c 2017-11-03 16:06:26.238889073 +0000 +++ gcc/testsuite/gcc.dg/vect/vect-48.c 2017-11-03 16:06:56.517977052 +0000 @@ -55,6 +55,7 @@ int main (void) (The store is aligned). */ /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ -/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { ! vect_unaligned_possible } } } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" { target { ! vect_align_stack_vars } xfail { ! vect_unaligned_possible } } } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { target vect_align_stack_vars xfail { ! vect_unaligned_possible } } } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 2 "vect" { target { vect_no_align && { ! vect_hw_misalign } } } } } */ Index: gcc/testsuite/gcc.dg/vect/vect-52.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-52.c 2017-11-03 16:06:26.238889073 +0000 +++ gcc/testsuite/gcc.dg/vect/vect-52.c 2017-11-03 16:06:56.517977052 +0000 @@ -56,6 +56,7 @@ int main (void) (The store is aligned). */ /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ -/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { ! vect_unaligned_possible } } } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" { target { ! vect_align_stack_vars } xfail { ! vect_unaligned_possible } } } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { target vect_align_stack_vars xfail { ! vect_unaligned_possible } } } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 2 "vect" { target { vect_no_align && { ! vect_hw_misalign } } } } } */ Index: gcc/testsuite/gcc.dg/vect/vect-54.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-54.c 2017-11-03 16:06:22.562036677 +0000 +++ gcc/testsuite/gcc.dg/vect/vect-54.c 2017-11-03 16:06:56.517977052 +0000 @@ -60,5 +60,5 @@ int main (void) } /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ -/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail { ! vect_align_stack_vars } } } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail vect_element_align_preferred } } } */ Index: gcc/testsuite/gcc.dg/vect/vect-62.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-62.c 2015-11-11 15:40:09.000000000 +0000 +++ gcc/testsuite/gcc.dg/vect/vect-62.c 2017-11-03 16:06:56.517977052 +0000 @@ -65,4 +65,4 @@ int main (void) } /* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */ -/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail { ! vect_align_stack_vars } } } } */ Index: gcc/testsuite/gcc.dg/vect/vect-67.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-67.c 2017-11-03 16:06:08.013090240 +0000 +++ gcc/testsuite/gcc.dg/vect/vect-67.c 2017-11-03 16:06:56.517977052 +0000 @@ -49,4 +49,4 @@ int main (void) } /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ -/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail { ! vect_align_stack_vars } } } } */ Index: gcc/testsuite/gcc.dg/vect/vect-75-big-array.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-75-big-array.c 2017-11-03 16:06:26.238889073 +0000 +++ gcc/testsuite/gcc.dg/vect/vect-75-big-array.c 2017-11-03 16:06:56.517977052 +0000 @@ -50,4 +50,5 @@ int main (void) /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target { vect_no_align && { ! vect_hw_misalign } } } } } */ -/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { ! vect_unaligned_possible } } } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { target { ! vect_align_stack_vars } xfail { ! vect_unaligned_possible } } } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target vect_align_stack_vars xfail { ! vect_unaligned_possible } } } } */ Index: gcc/testsuite/gcc.dg/vect/vect-75.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-75.c 2017-11-03 16:06:26.239888760 +0000 +++ gcc/testsuite/gcc.dg/vect/vect-75.c 2017-11-03 16:06:56.517977052 +0000 @@ -50,4 +50,5 @@ int main (void) /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target { vect_no_align && { ! vect_hw_misalign } } } } } */ -/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { ! vect_unaligned_possible } } } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { target { ! vect_align_stack_vars } xfail { ! vect_unaligned_possible } } } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target vect_align_stack_vars xfail { ! vect_unaligned_possible } } } } */ Index: gcc/testsuite/gcc.dg/vect/vect-77-alignchecks.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-77-alignchecks.c 2017-11-03 16:06:26.239888760 +0000 +++ gcc/testsuite/gcc.dg/vect/vect-77-alignchecks.c 2017-11-03 16:06:56.518977438 +0000 @@ -54,7 +54,8 @@ int main (void) both for the load and the store. */ /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ -/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { ! vect_unaligned_possible } } } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { target { ! vect_align_stack_vars } xfail { ! vect_unaligned_possible } } } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target vect_align_stack_vars xfail { ! vect_unaligned_possible } } } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { target { {! vect_no_align} && { unaligned_stack && vector_alignment_reachable } } } } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 1 "vect" { target { { {! unaligned_stack} && { vect_no_align && { ! vect_hw_misalign } } } || {unaligned_stack && { {! vector_alignment_reachable} && {! vect_no_align } } } } } } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 2 "vect" { target { { unaligned_stack && { vector_alignment_reachable && vect_no_align } } || {unaligned_stack && { {! vector_alignment_reachable} && vect_no_align } } } } } } */ Index: gcc/testsuite/gcc.dg/vect/vect-78-alignchecks.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-78-alignchecks.c 2017-11-03 16:06:26.239888760 +0000 +++ gcc/testsuite/gcc.dg/vect/vect-78-alignchecks.c 2017-11-03 16:06:56.518977438 +0000 @@ -55,7 +55,8 @@ int main (void) both for the load and the store. */ /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ -/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { ! vect_unaligned_possible } } } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target vect_align_stack_vars xfail { ! vect_unaligned_possible } } } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { target { ! vect_align_stack_vars } xfail { ! vect_unaligned_possible } } } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { target { {! vect_no_align} && { unaligned_stack && vector_alignment_reachable } } } } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 1 "vect" { target { { {! unaligned_stack} && { vect_no_align && { ! vect_hw_misalign } } } || {unaligned_stack && { {! vector_alignment_reachable} && { ! vect_no_align } } } } } } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 2 "vect" { target { { unaligned_stack && { vector_alignment_reachable && vect_no_align } } || {unaligned_stack && { {! vector_alignment_reachable} && vect_no_align } } } } } } */ Index: gcc/testsuite/gcc.dg/vect/vect-89-big-array.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-89-big-array.c 2017-11-03 16:06:22.562036677 +0000 +++ gcc/testsuite/gcc.dg/vect/vect-89-big-array.c 2017-11-03 16:06:56.518977438 +0000 @@ -45,5 +45,5 @@ int main (void) } /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ -/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */ -/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail vect_element_align_preferred } } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail { ! vect_align_stack_vars } } } } */ +/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { vect_element_align_preferred || { ! vect_align_stack_vars } } } } } */ Index: gcc/testsuite/gcc.dg/vect/vect-89.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-89.c 2017-11-03 16:06:22.562036677 +0000 +++ gcc/testsuite/gcc.dg/vect/vect-89.c 2017-11-03 16:06:56.518977438 +0000 @@ -49,5 +49,5 @@ int main (void) } /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ -/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */ -/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail vect_element_align_preferred } } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail { ! vect_align_stack_vars } } } } */ +/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { vect_element_align_preferred || { ! vect_align_stack_vars } } } } } */ Index: gcc/testsuite/gcc.dg/vect/vect-96.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-96.c 2017-11-03 16:06:26.239888760 +0000 +++ gcc/testsuite/gcc.dg/vect/vect-96.c 2017-11-03 16:06:56.518977438 +0000 @@ -48,6 +48,7 @@ int main (void) For targets that don't support unaligned loads, version for the store. */ /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ -/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target { {! vect_no_align} && vector_alignment_reachable } xfail { ! vect_unaligned_possible } } } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { target { { {! vect_no_align} && vector_alignment_reachable } && { ! vect_align_stack_vars } } xfail { ! vect_unaligned_possible } } } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target { { {! vect_no_align} && vector_alignment_reachable } && vect_align_stack_vars } xfail { ! vect_unaligned_possible } } } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { { vect_no_align } || { { ! vector_alignment_reachable} || vect_element_align } } } } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 1 "vect" { target { { vect_no_align && { ! vect_hw_misalign } } || { {! vector_alignment_reachable} && {! vect_element_align} } } } } } */ Index: gcc/testsuite/gcc.dg/vect/vect-multitypes-3.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-multitypes-3.c 2017-11-03 16:06:26.239888760 +0000 +++ gcc/testsuite/gcc.dg/vect/vect-multitypes-3.c 2017-11-03 16:06:56.518977438 +0000 @@ -59,5 +59,5 @@ int main (void) /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 3 "vect" { target { vect_no_align && { ! vect_hw_misalign } } } } } */ -/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" { xfail { ! vect_unaligned_possible } } } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" { xfail { ! { vect_unaligned_possible && vect_align_stack_vars } } } } } */ Index: gcc/testsuite/gcc.dg/vect/vect-multitypes-6.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-multitypes-6.c 2017-11-03 16:06:26.240888448 +0000 +++ gcc/testsuite/gcc.dg/vect/vect-multitypes-6.c 2017-11-03 16:06:56.518977438 +0000 @@ -66,5 +66,5 @@ int main (void) /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail { sparc*-*-* && ilp32 } }} } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 6 "vect" { target { vect_no_align && { ! vect_hw_misalign } } } } } */ -/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 6 "vect" { xfail { ! vect_unaligned_possible } } } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 6 "vect" { xfail { ! { vect_unaligned_possible && vect_align_stack_vars } } } } } */ From patchwork Fri Nov 3 16:23:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 117946 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp3658058qgn; Fri, 3 Nov 2017 09:23:44 -0700 (PDT) X-Google-Smtp-Source: ABhQp+RGpUTW3ogo6VG98P72fA71nDa8Szz+aEAJhmTGZsofvuhp+KF3G1A1iUIRNowUvQftIqaq X-Received: by 10.99.7.133 with SMTP id 127mr7574519pgh.147.1509726224232; Fri, 03 Nov 2017 09:23:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509726224; cv=none; d=google.com; s=arc-20160816; b=cdibjctVOKNtYkXYZUTe3eX6wDh6EcXlTPnQ+swb9PeDi1QFyoXq8nQbeoN50iGVN/ PHFpqelwc/LBVsmMzPwTyRybaAKVJ67dPQpHDWRrYu2cTlCZkMZfEVyTmlSMbwpVg47S t9I/wZQ8RSTpbXCWvkobmUpaGsC3GpuskMfOwYewoaA/sIufRhPOVULodO4gjPRS0jKC AhUz00ONmOGv5kEtSgWyb8cwDNhOWKNsCHPI0YEDKtdj70jhPVezqf5lHNguAEG6wHpF TaeKnR2zohpnC8HOvEBiyLJIdMLAcI07M+tcgOldmBiEvg5Ym1+pn1nAp96cP5GLdSRs JARA== 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=zeFfnIrnBcipmtZpQ6Ec7qlQLNcigXwAQMiDHjQ4FWk=; b=b6nYseNuN+dglB62IhaPlSCNDO/HoZuhfA4Vj2i5yxOz9HkAS8KCHIrWDK4K+4LQ4u xBFhkFzfwgjncrDiyWLy8x88g7tvaRYSLVJ2Kc/d3IMs5Vk7GnEg9ApKtmiZtCgvPnwn LUZtLYv/XB12miDyMCURyvmnqGGi8TdPx83H6FokVEe9yduUljomqwv6xNlh8Fx1urHb HtzaV3rF9MmL9hLcGGZujLa8+jF1Nebts7q7yxpY8MEaPPr7ngfRT7mvEaxzfsfQ3No4 IUDG+o8JqJy1CqdgPdP6f4lJn8el5kC4ppb5OTJAEMdmVFuqkCiVaAMX6QX64RiA2Yrp GJIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=TuxPX/OM; spf=pass (google.com: domain of gcc-patches-return-465881-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-465881-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 p73si6741950pfi.83.2017.11.03.09.23.43 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Nov 2017 09:23:44 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-465881-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=TuxPX/OM; spf=pass (google.com: domain of gcc-patches-return-465881-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-465881-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=nK92/XiwSUstq2q056azrZcdTSb9x 34mm3J3oQXbMS6eZl7ZgupsJOX876k0Gy76utDczYGDqi+I0ZKTTPXQ87Oo6fNh6 1F51eQlFfZHeiNW07c6JnoE6+5nthHJ5DSTGKeoE+Szl5DT7pwU/5U+JYll2Sr/p G4OvOnHI7AcY0s= 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=TKOUrbht+ZeiCKiqzOm/8OKqwKk=; b=Tux PX/OMePLoqOOVDuS69mE7NvKBg2Xu5KU460WRtqlkk4qhJRrS8WSNItGBL56ywtG dHzZ9kK41VTwijdok0hlmp/fxTtMB/JM/kenSq8JNNRwycB5G+xlCmioO73J99cM Fu/j3x17/lHfIT8XrwNFJOfAINzPo6dk0uYhSBJA= Received: (qmail 47908 invoked by alias); 3 Nov 2017 16:23:31 -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 47899 invoked by uid 89); 3 Nov 2017 16:23:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-10.6 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=aligns X-HELO: mail-wr0-f177.google.com Received: from mail-wr0-f177.google.com (HELO mail-wr0-f177.google.com) (209.85.128.177) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 03 Nov 2017 16:23:29 +0000 Received: by mail-wr0-f177.google.com with SMTP id z55so2994262wrz.1 for ; Fri, 03 Nov 2017 09:23:29 -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=zeFfnIrnBcipmtZpQ6Ec7qlQLNcigXwAQMiDHjQ4FWk=; b=VZMXrr2w4zCfYXiZ+GZg8WvUn4p1Cl+5qm+lp5Kkar/ZWFrbkUNKqYS5kTUwXoJ+cH 1GlmCOVKLv3C0h+tT8csSlHmapGvOzLxAhPK+36HB/oruWbsL8cpUd34nNSrDcWRbkqP gXn8jQYIDkSOTd4lynJq4JVGRfa/uTZJBOHfOYJG4k5KMAZe6uRHDuM7dpxtr/jZjN6U DmX2zLjtLVySwTAY0k+N512ZQ3x0reT5zmGyrR3+56fM4aekN/Ehhn9glr7k8CqHuhs9 ogixA7iix30u9xOq+Tsxcoa10UZycepRU3buK4kssT/Of+pY35WxENi9tZfj3mEVrzOC sUzg== X-Gm-Message-State: AJaThX4l2hj5pw7OIcRJC2z/NuEHFDaGlDF/AW5gYNfljH0oAnVLRjK4 TrEYC1zRhk65YhG4IufqKiQdM1cV8O0= X-Received: by 10.223.188.13 with SMTP id s13mr1699668wrg.39.1509726207507; Fri, 03 Nov 2017 09:23:27 -0700 (PDT) Received: from localhost (188.29.164.162.threembb.co.uk. [188.29.164.162]) by smtp.gmail.com with ESMTPSA id p200sm2246143wmd.9.2017.11.03.09.23.26 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 Nov 2017 09:23:26 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@linaro.org Subject: [10/10] Add a vect_masked_store target selector References: <87inerqqyz.fsf@linaro.org> Date: Fri, 03 Nov 2017 16:23:24 +0000 In-Reply-To: <87inerqqyz.fsf@linaro.org> (Richard Sandiford's message of "Fri, 03 Nov 2017 16:14:44 +0000") Message-ID: <878tfnpc03.fsf@linaro.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 This patch adds a target selector that says whether the target supports IFN_MASK_STORE. 2017-11-03 Richard Sandiford Alan Hayward David Sherwood gcc/ * doc/sourcebuild.texi (vect_masked_store): Document. gcc/testsuite/ * lib/target-supports.exp (check_effective_target_vect_masked_store): New proc. * gcc.dg/vect/vect-cselim-1.c (foo): Mention that the second loop is vectorizable with masked stores. Update scan-tree-dump-times accordingly. Index: gcc/doc/sourcebuild.texi =================================================================== --- gcc/doc/sourcebuild.texi 2017-11-03 16:06:56.516976666 +0000 +++ gcc/doc/sourcebuild.texi 2017-11-03 16:07:00.028331940 +0000 @@ -1403,6 +1403,9 @@ Target supports hardware vectors of @cod @item vect_long_long Target supports hardware vectors of @code{long long}. +@item vect_masked_store +Target supports vector masked stores. + @item vect_aligned_arrays Target aligns arrays to vector alignment boundary. Index: gcc/testsuite/lib/target-supports.exp =================================================================== --- gcc/testsuite/lib/target-supports.exp 2017-11-03 16:06:56.519977825 +0000 +++ gcc/testsuite/lib/target-supports.exp 2017-11-03 16:07:00.029332326 +0000 @@ -6433,6 +6433,12 @@ proc check_effective_target_vect_load_la return $et_vect_load_lanes } +# Return 1 if the target supports vector masked stores. + +proc check_effective_target_vect_masked_store { } { + return 0 +} + # Return 1 if the target supports vector conditional operations, 0 otherwise. proc check_effective_target_vect_condition { } { Index: gcc/testsuite/gcc.dg/vect/vect-cselim-1.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-cselim-1.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/vect-cselim-1.c 2017-11-03 16:07:00.028331940 +0000 @@ -38,7 +38,7 @@ foo () } } - /* Not vectorizable. */ + /* Only vectorizable with masked stores. */ for (i = 0; i < N; i++) { c = in1[i].b; @@ -82,4 +82,5 @@ main (void) return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail { { vect_no_align && { ! vect_hw_misalign } } || { ! vect_strided2 } } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { ! vect_masked_store } xfail { { vect_no_align && { ! vect_hw_misalign } } || { ! vect_strided2 } } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { target { vect_masked_store } } } } */