From patchwork Thu Jan 26 21:14:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Schmidt X-Patchwork-Id: 720376 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 3v8ZRx50tjz9sxN for ; Fri, 27 Jan 2017 08:14:35 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="eLyMeOgi"; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to:cc :from:subject:date:mime-version:content-type :content-transfer-encoding:message-id; q=dns; s=default; b=sbRtV 1MFYJKlkNA17eTnDKXlnGOPQdOKLlyqkdcBlDRANgwlnpqCrx/HTkZOMETen0MUO APZyXmbppxDJ2p7Tt5TyjSfceRGNzS9wTpaSv1lyoZTEDiFptRFjr+Hi06ZNT4+0 yc18YEVq5uoVq4IxKRDEMuA/lYmK/1yVvKVt24= 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:to:cc :from:subject:date:mime-version:content-type :content-transfer-encoding:message-id; s=default; bh=lWpCgF9+a8J MB/NYKBwOuzRPtMo=; b=eLyMeOgif4Ui73i3UMEl2UClxNPeRBHOZOlXQu9byGM drIxKulAgGvr/A2AfPGqTjhIcErkaJCODq+A0bO0ifHo61RQ5C9lNRPVZDtkcdp9 VBPwx2ddX7FBGEgBlA0UeGr49e3EvoZM71y8J/jeyCBGIQ9JjnxY2ILq9BuSSmmg = Received: (qmail 90761 invoked by alias); 26 Jan 2017 21:14:25 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 89619 invoked by uid 89); 26 Jan 2017 21:14:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=Hx-languages-length:2378 X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0b-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.158.5) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 26 Jan 2017 21:14:14 +0000 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v0QL8fcc046488 for ; Thu, 26 Jan 2017 16:14:13 -0500 Received: from e17.ny.us.ibm.com (e17.ny.us.ibm.com [129.33.205.207]) by mx0b-001b2d01.pphosted.com with ESMTP id 287naqfw4y-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 26 Jan 2017 16:14:12 -0500 Received: from localhost by e17.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 26 Jan 2017 16:14:12 -0500 Received: from d01dlp02.pok.ibm.com (9.56.250.167) by e17.ny.us.ibm.com (146.89.104.204) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 26 Jan 2017 16:14:10 -0500 Received: from b01cxnp22034.gho.pok.ibm.com (b01cxnp22034.gho.pok.ibm.com [9.57.198.24]) by d01dlp02.pok.ibm.com (Postfix) with ESMTP id C5D5B6E803C; Thu, 26 Jan 2017 16:13:41 -0500 (EST) Received: from b01ledav03.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp22034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v0QLE94b41746676; Thu, 26 Jan 2017 21:14:09 GMT Received: from b01ledav03.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 711A7B204D; Thu, 26 Jan 2017 16:14:09 -0500 (EST) Received: from bigmac.rchland.ibm.com (unknown [9.10.86.122]) by b01ledav03.gho.pok.ibm.com (Postfix) with ESMTP id 3967EB205A; Thu, 26 Jan 2017 16:14:09 -0500 (EST) To: GCC Patches Cc: Segher Boessenkool , David Edelsohn From: Bill Schmidt Subject: [PATCH, rs6000, testsuite] Fix PR65484 Date: Thu, 26 Jan 2017 15:14:47 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17012621-0040-0000-0000-000002782B46 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00006503; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000200; SDB=6.00813128; UDB=6.00396632; IPR=6.00590543; BA=6.00005091; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00014062; XFM=3.00000011; UTC=2017-01-26 21:14:11 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17012621-0041-0000-0000-0000066B2C9F Message-Id: <908e586f-650e-ecae-af55-6b75b2cc782a@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-01-26_13:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1701260201 X-IsSubscribed: yes Hi, https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65484 identifies an issue whether g++.dg/vect/pr36648.cc fails on older POWER hardware. This is due to a decision made in November 2010 to include the flag -mno-allow-movmisalign in check_vect_support_and_set_flags, which governs the vectorizer tests in that directory. This flag sometimes inhibits vectorization when to vectorize the code requires that misaligned loads and stores be used. This flag is not added to the command line for POWER8 hardware and later. pr36648.cc is an example of the kind of vectorization that requires misaligned memory accesses, so it is vectorized on POWER8 and later hardware, but not on POWER7 or earlier with the default testsuite flags. This patch modifies the dg-final checks in pr36648.cc to be consistent with this behavior. I've added commentary to explain what might otherwise seem to be a somewhat arcane choice of tests. Tested on trunk and GCC 6 for POWER8 LE and POWER7 BE systems. Is this ok for trunk? Thanks, Bill 2017-01-26 Bill Schmidt PR target/65484 * g++.dg/vect/pr36648.cc: Modify to reflect that the loop is not vectorized on POWER unless hardware misaligned loads are available. Index: gcc/testsuite/g++.dg/vect/pr36648.cc =================================================================== --- gcc/testsuite/g++.dg/vect/pr36648.cc (revision 244811) +++ gcc/testsuite/g++.dg/vect/pr36648.cc (working copy) @@ -19,7 +19,12 @@ Foo foo; int main() { } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { ! vect_no_align } } } } */ -/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target { ! vect_no_align } } } } */ +/* On older powerpc hardware (POWER7 and earlier), the default flag + -mno-allow-movmisalign prevents vectorization. On POWER8 and later, + when vect_hw_misalign is true, vectorization occurs. For other + targets, ! vect_no_align is a sufficient test. */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { { { ! vect_no_align } && { ! powerpc*-*-* } } || { powerpc*-*-* && vect_hw_misalign } } } } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target { { { ! vect_no_align } && { ! powerpc*-*-* } } || { powerpc*-*-* && vect_hw_misalign } } } } } */ +