From patchwork Fri May 26 15:32:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Munroe X-Patchwork-Id: 767436 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 3wZ9Bm5KGSz9s82 for ; Sat, 27 May 2017 01:33:19 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="TwdHm83Z"; 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 :subject:from:reply-to:to:cc:content-type:date:mime-version :content-transfer-encoding:message-id; q=dns; s=default; b=TRrz2 BFHBj/e+M+xAvmKy7SFpK4+y9MJnnGWiiSebXb8EkgBRtSUKrRuSkz/qAMTNydUg lvDEtyPbLOmd4Wi+ruilFLFqH4xbmz5dsoVuj7lDr+LT24f0hnn0YQV0K9nrNWHO vDlUIHFJlodxR8rZGxfChqAsL0Oy9BLVdVMmpg= 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 :subject:from:reply-to:to:cc:content-type:date:mime-version :content-transfer-encoding:message-id; s=default; bh=ZI8/krXozpu buVQFBJ5iW/1G44g=; b=TwdHm83ZJZTG5lVyhwDR4oLEXVxS6EKJwj0XInm/arO LfwwApvzlrGfXBtqP2DgyESRZwq9ggoQFEulzakapgLUz2Nc/ZBuCykdu08u+lSZ pcnog1voTTiUHNwGdvfFmt+h2hqAnaTa7iUViVn9O10XQE/w700oKwqdnR57mbBo = Received: (qmail 94904 invoked by alias); 26 May 2017 15:33:06 -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 93420 invoked by uid 89); 26 May 2017 15:33:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-10.8 required=5.0 tests=BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy= 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; Fri, 26 May 2017 15:33:04 +0000 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v4QFO2pJ055200 for ; Fri, 26 May 2017 11:33:06 -0400 Received: from e38.co.us.ibm.com (e38.co.us.ibm.com [32.97.110.159]) by mx0a-001b2d01.pphosted.com with ESMTP id 2apa6sy7qc-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 26 May 2017 11:33:06 -0400 Received: from localhost by e38.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 26 May 2017 09:33:05 -0600 Received: from b03cxnp08026.gho.boulder.ibm.com (9.17.130.18) by e38.co.us.ibm.com (192.168.1.138) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 26 May 2017 09:33:01 -0600 Received: from b03ledav003.gho.boulder.ibm.com (b03ledav003.gho.boulder.ibm.com [9.17.130.234]) by b03cxnp08026.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v4QFX04Z10617320; Fri, 26 May 2017 08:33:00 -0700 Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8D81C6A041; Fri, 26 May 2017 09:33:00 -0600 (MDT) Received: from [9.10.86.71] (unknown [9.10.86.71]) by b03ledav003.gho.boulder.ibm.com (Postfix) with ESMTP id 591286A048; Fri, 26 May 2017 09:33:00 -0600 (MDT) Subject: [PATCH rs6000] Addition fixes to BMI intrinsic tests, 2nd edition From: Steven Munroe Reply-To: munroesj@linux.vnet.ibm.com To: gcc-patches Cc: Segher Boessenkool , David Edelsohn Date: Fri, 26 May 2017 10:32:54 -0500 Mime-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 17052615-0028-0000-0000-000007AC7CAE X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00007121; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000212; SDB=6.00865886; UDB=6.00430044; IPR=6.00645747; BA=6.00005375; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00015596; XFM=3.00000015; UTC=2017-05-26 15:33:03 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17052615-0029-0000-0000-000035EE2FA2 Message-Id: <1495812774.31269.6.camel@oc7878010663> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-05-26_10:, , 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-1703280000 definitions=main-1705260279 Bill Seurer pointed out that building the BMI tests on a power8 but with gcc built --with-cpu=power6 fails with link errors. The intrinsics _pdep_u64/32 and _pext_u64/32 are guarded with #ifdef _ARCH_PWR7 as the implementation uses bpermd and popcntd instructions introduced with power7 (PowerISA-2.06). But if the GCC is built --with-cpu=power6, the compiler is capable of supporting -mcpu=power7 but will not generate bpermd/popcntd by default. Then if some code them uses say _pext_u64 with -mcpu=power6 the intrinsic is not not supported (needs power7) and so is not defined. The { dg-require-effective-target powerpc_vsx_ok } is not sufficient for the { dg-do run } and need to be changed to vsx_hw. Also we need add -mcpu=power7 to dg-options to insure the compiler will generated the bpermd/popcntd instructions. This is sufficient for all the bmi/bmi2 tests to skip/pass for power6 and later. [gcc/testsuite] 2017-05-26 Steven Munroe * gcc.target/powerpc/bmi2-pdep32-1.c []: Add -mcpu=power7 to dg-options. Change dg-require-effective-target powerpc_vsx_ok to vsx_hw. * gcc.target/powerpc/bmi2-pdep64-1.c: Likewise. * gcc.target/powerpc/bmi2-pext32-1.c: Likewise. * gcc.target/powerpc/bmi2-pext64-1.c: Likewise. * gcc.target/powerpc/bmi2-pext64-1a.c: Add -mcpu=power7 to dg-options. Index: gcc/testsuite/gcc.target/powerpc/bmi2-pdep32-1.c =================================================================== --- gcc/testsuite/gcc.target/powerpc/bmi2-pdep32-1.c (revision 248468) +++ gcc/testsuite/gcc.target/powerpc/bmi2-pdep32-1.c (working copy) @@ -1,7 +1,7 @@ /* { dg-do run } */ -/* { dg-options "-O3" } */ +/* { dg-options "-O3 -mcpu=power7" } */ /* { dg-require-effective-target lp64 } */ -/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-require-effective-target vsx_hw } */ #define NO_WARN_X86_INTRINSICS 1 #include Index: gcc/testsuite/gcc.target/powerpc/bmi2-pdep64-1.c =================================================================== --- gcc/testsuite/gcc.target/powerpc/bmi2-pdep64-1.c (revision 248468) +++ gcc/testsuite/gcc.target/powerpc/bmi2-pdep64-1.c (working copy) @@ -1,7 +1,7 @@ /* { dg-do run } */ -/* { dg-options "-O3" } */ +/* { dg-options "-O3 -mcpu=power7" } */ /* { dg-require-effective-target lp64 } */ -/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-require-effective-target vsx_hw } */ #define NO_WARN_X86_INTRINSICS 1 #include Index: gcc/testsuite/gcc.target/powerpc/bmi2-pext32-1.c =================================================================== --- gcc/testsuite/gcc.target/powerpc/bmi2-pext32-1.c (revision 248468) +++ gcc/testsuite/gcc.target/powerpc/bmi2-pext32-1.c (working copy) @@ -1,7 +1,7 @@ /* { dg-do run } */ -/* { dg-options "-O3" } */ +/* { dg-options "-O3 -mcpu=power7" } */ /* { dg-require-effective-target lp64 } */ -/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-require-effective-target vsx_hw } */ #define NO_WARN_X86_INTRINSICS 1 #include Index: gcc/testsuite/gcc.target/powerpc/bmi2-pext64-1.c =================================================================== --- gcc/testsuite/gcc.target/powerpc/bmi2-pext64-1.c (revision 248468) +++ gcc/testsuite/gcc.target/powerpc/bmi2-pext64-1.c (working copy) @@ -1,7 +1,7 @@ /* { dg-do run } */ -/* { dg-options "-O3" } */ +/* { dg-options "-O3 -mcpu=power7" } */ /* { dg-require-effective-target lp64 } */ -/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-require-effective-target vsx_hw } */ #define NO_WARN_X86_INTRINSICS 1 #include Index: gcc/testsuite/gcc.target/powerpc/bmi2-pext64-1a.c =================================================================== --- gcc/testsuite/gcc.target/powerpc/bmi2-pext64-1a.c (revision 248468) +++ gcc/testsuite/gcc.target/powerpc/bmi2-pext64-1a.c (working copy) @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O3" } */ +/* { dg-options "-O3 -mcpu=power7" } */ /* { dg-require-effective-target lp64 } */ /* { dg-require-effective-target powerpc_vsx_ok } */