From patchwork Thu Jul 24 15:40:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marat Zakirov X-Patchwork-Id: 373450 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 617DF1400A3 for ; Fri, 25 Jul 2014 01:41:00 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; q=dns; s=default; b=fC8vWq2yXZWMj6Ckl pPNdd/hJxkqhf2kg9cRQz7aqN7zlaHy5clj5//2qGXtrYB37hi9XTugnnXxEDsMm vcy+rsMOWzIv3JYGqqT8PwrW4aHnq5OQJsq4WeWfioB5SguXIw632aWjw9U079gE DLxOKNun3GVPUuzTifA1OCLcP8= 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 :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; s=default; bh=tvpFChqLkCt9hUc4+Ok9Dom kfIU=; b=AAZqWuPEFjoLbk+GG3SLBWPPR48b+l6RW+m3mkkmm4WPFfVkLfJBdLc dn6tOTig4lcfZoqDR1ZAG41jrwwqqcXQWShLnrFP8MvhLTZV3mEjeEdakZwH9ns1 OHvwddfMopyaAxVOVy0nkX8cGIKQ+f8fA3Mx/qCPq3hpAq+JGCuw= Received: (qmail 9714 invoked by alias); 24 Jul 2014 15:40:53 -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 9701 invoked by uid 89); 24 Jul 2014 15:40:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 X-HELO: mailout4.w1.samsung.com Received: from mailout4.w1.samsung.com (HELO mailout4.w1.samsung.com) (210.118.77.14) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (DES-CBC3-SHA encrypted) ESMTPS; Thu, 24 Jul 2014 15:40:46 +0000 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N98006OQ3JK6I60@mailout4.w1.samsung.com> for gcc-patches@gcc.gnu.org; Thu, 24 Jul 2014 16:40:32 +0100 (BST) Received: from eusync3.samsung.com ( [203.254.199.213]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id CE.99.27902.9F821D35; Thu, 24 Jul 2014 16:40:41 +0100 (BST) Received: from [106.109.129.103] by eusync3.samsung.com (Oracle Communications Messaging Server 7u4-23.01(7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0N98003NE3JSU630@eusync3.samsung.com>; Thu, 24 Jul 2014 16:40:41 +0100 (BST) Message-id: <53D128F8.9090004@samsung.com> Date: Thu, 24 Jul 2014 19:40:40 +0400 From: Marat Zakirov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-version: 1.0 To: "gcc-patches@gcc.gnu.org" Cc: Ramana Radhakrishnan , Cong Hou , Richard Biener , Yury Gribov Subject: [PATCHv3] Fix vector tests on ARM platforms with disabled unaligned accesses References: <53CFC558.3020202@samsung.com> <53D0FBA1.9080607@samsung.com> In-reply-to: <53D0FBA1.9080607@samsung.com> Content-type: multipart/mixed; boundary=------------080504090500000005000808 On 07/24/2014 04:27 PM, Marat Zakirov wrote: > > On 07/23/2014 06:23 PM, Marat Zakirov wrote: >> Hi there! >> >> I made a patch which fixes regressions on ARM platforms with disabled >> unaligned accesses. The problem is that 'arm_vect_no_misalign' >> predicate do not check 'unaligned_access' global variable to >> determine whether unaligned access to vector are allowed. This leads >> to spurious vect.exp test fails when GCC is configured >> --with-specs=%{!munaligned-access:-mno-unaligned-access}. >> >> Attached patch fixes ARM predicate and several tests to correctly >> handle the issue. >> >> The following targets were reg. tested for multiple targets (ARM, >> Thumb-1, Thumb-2, x86, x86_64) with and without >> -mno-unaligned-access. Analysis showed patch affects only vect.exp >> tests so only vect.exp was tested. >> >> For x86, x86_64, ARM without -mno-unaligned-access, Thumb-2 without >> -mno-unaligned-access and Thumb-1 no regressions occured. For >> ARM/Thumb2 with -mno-unaligned-access patch fixed most of failures >> but triggered some problems (see attached log) for current vect.exp >> tests: >> 1) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61887 >> 2) Some XPASS'es due to unexpected loop versioning (e.g. >> gcc.dg/vect/pr33804.c). >> 3) After predicate fix some passing tests which require unaligned >> vector support become NA (this was expected). >> > Here is new version of patch and regression log. On the current trunk > results are slightly different due to patches for Richard Biener (no > UNRESOLVED fails) but some PASS->XPASS regressions still remain (see > attachment): > > PASS->XPASS: gcc.dg/vect/if-cvt-stores-vect-ifcvt-18.c > scan-tree-dump-times vect "vectorized 1 loops" 1 > PASS->XPASS: gcc.dg/vect/pr33804.c -flto -ffat-lto-objects > scan-tree-dump-times vect "vectorized 1 loops" 1 > etc. > > These XPASS'es are due to code versioning: current GCC creates 2 > versions of loop: aligned and misaligned. It's look like they are > slightly out of date at lest for ARM. > On 07/24/2014 06:50 PM, Ramana Radhakrishnan wrote: > This is redundant. > >> - || (defined(__ARMEL__) \ >> + || (defined(__ARM_FEATURE_UNALIGNED) \ >> + && defined(__ARMEL__) \ >> && (!defined(__thumb__) || defined(__thumb2__))) > As is this line. > > I think you can restrict the check to defined(__ARM_FEATURE_UNALIGNED) > && defined(__ARMEL__) > > __ARM_FEATURE_UNALIGNED should tell you whether unaligned access is > allowed or not, therefore you should no longer require any specific > "architectural" checks. > > >> #error FOO >> #endif >> > I'm not sure about the original intent of the tests right now. > > Ramana > Thank you Ramana! --Marat gcc/testsuite/ChangeLog: 2014-07-23 Marat Zakirov * gcc.dg/vect/vect-109.c: Skip predicate added. * gcc.dg/vect/vect-93.c: Test check fixed. * gcc.dg/vect/bb-slp-10.c: Likewise. * lib/target-supports.exp (check_effective_target_arm_vect_no_misalign): Check unaligned feature. diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-10.c b/gcc/testsuite/gcc.dg/vect/bb-slp-10.c index a1850ed..0090a4b 100644 --- a/gcc/testsuite/gcc.dg/vect/bb-slp-10.c +++ b/gcc/testsuite/gcc.dg/vect/bb-slp-10.c @@ -49,7 +49,7 @@ int main (void) return 0; } -/* { dg-final { scan-tree-dump-times "unsupported alignment in basic block." 1 "slp2" { xfail vect_element_align } } } */ +/* { dg-final { scan-tree-dump "unsupported alignment in basic block." 1 "slp2" { xfail vect_element_align } } } */ /* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp2" { target vect_element_align } } } */ /* { dg-final { cleanup-tree-dump "slp2" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-109.c b/gcc/testsuite/gcc.dg/vect/vect-109.c index 854c970..c671175 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-109.c +++ b/gcc/testsuite/gcc.dg/vect/vect-109.c @@ -1,3 +1,4 @@ +/* { dg-skip-if "" { vect_no_align } } */ /* { dg-require-effective-target vect_int } */ #include diff --git a/gcc/testsuite/gcc.dg/vect/vect-93.c b/gcc/testsuite/gcc.dg/vect/vect-93.c index 65403eb..1065a6e 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-93.c +++ b/gcc/testsuite/gcc.dg/vect/vect-93.c @@ -79,7 +79,7 @@ int main (void) /* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { target vect_no_align } } } */ /* in main: */ -/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { target vect_no_align } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_no_align } } } */ /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { vect_no_align } } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index db65ebe..35076d2 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -2293,8 +2293,8 @@ proc check_effective_target_arm_little_endian { } { proc check_effective_target_arm_vect_no_misalign { } { return [check_no_compiler_messages arm_vect_no_misalign assembly { #if !defined(__arm__) \ - || (defined(__ARMEL__) \ - && (!defined(__thumb__) || defined(__thumb2__))) + || (defined(__ARM_FEATURE_UNALIGNED) \ + && defined(__ARMEL__)) #error FOO #endif }]