From patchwork Mon Nov 6 17:41:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Bergner X-Patchwork-Id: 834863 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-466052-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="dy+YzkjB"; dkim-atps=neutral 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 3yW0HX4dwrz9s7f for ; Tue, 7 Nov 2017 04:41:58 +1100 (AEDT) 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=QfDvf vPOenhu8yh8cfUjeksza6jwaHBXYQmbRkpJOTeFNZOrCN9fSJcMrAfDOjKXJ5Ymb z6eaQXXGHAWjO0ozRiQQKa0z5zIcjb0GqWHTJAalQMW60gZtZz/d6cssL5/wZyAR DkGriVMCmUj0Uy2+Den95gGqBMu7X0nOP4sJA0= 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=b15TJXg3W4y 1wdpMG/j1MtqA0ok=; b=dy+YzkjBokSctsldql6G94fiDNKpFgJR+I8lx7nT3yE AKuKzBD27b9ZeHmxCfl5mzFVENKUK/AKrfYK/aF57F9Y6hRVcenD/+nVJo2fD35V zGsnaAmwt5jbMxQ4ljsm+bLr5jFUDKAQD0BwIERUophXvZH7uE+4/5dfMVWaxIcM = Received: (qmail 40277 invoked by alias); 6 Nov 2017 17:41:49 -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 40267 invoked by uid 89); 6 Nov 2017 17:41:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=Block 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; Mon, 06 Nov 2017 17:41:48 +0000 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id vA6HdTX3071795 for ; Mon, 6 Nov 2017 12:41:42 -0500 Received: from e14.ny.us.ibm.com (e14.ny.us.ibm.com [129.33.205.204]) by mx0b-001b2d01.pphosted.com with ESMTP id 2e2txe5edj-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 06 Nov 2017 12:41:42 -0500 Received: from localhost by e14.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 6 Nov 2017 12:41:42 -0500 Received: from b01cxnp23033.gho.pok.ibm.com (9.57.198.28) by e14.ny.us.ibm.com (146.89.104.201) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 6 Nov 2017 12:41:40 -0500 Received: from b01ledav001.gho.pok.ibm.com (b01ledav001.gho.pok.ibm.com [9.57.199.106]) by b01cxnp23033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id vA6HfewQ58327284; Mon, 6 Nov 2017 17:41:40 GMT Received: from b01ledav001.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8326F28048; Mon, 6 Nov 2017 12:41:32 -0500 (EST) Received: from otta.local (unknown [9.85.202.94]) by b01ledav001.gho.pok.ibm.com (Postfix) with ESMTP id 2FB432803A; Mon, 6 Nov 2017 12:41:32 -0500 (EST) To: GCC Patches Cc: Segher Boessenkool , Tulio Magno Quites Machado Filho From: Peter Bergner Subject: [PATCH, rs6000] Add support to __builtin_cpu_supports() for new HWCAP2 bit Date: Mon, 6 Nov 2017 11:41:39 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 17110617-0052-0000-0000-0000027D875C X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008021; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000239; SDB=6.00942037; UDB=6.00475161; IPR=6.00722325; BA=6.00005674; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00017882; XFM=3.00000015; UTC=2017-11-06 17:41:41 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17110617-0053-0000-0000-0000528B5134 Message-Id: <903b4414-f737-4da0-ba20-d7c5745c5166@vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-11-06_06:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1711060240 X-IsSubscribed: yes There is a new HWCAP2 bit added to the AUXV here: http://patchwork.ozlabs.org/patch/824764/ This patch adds __builtin_cpu_supports() support for it. This passed bootstrap and regtesting with no regressions? Ok for trunk? Ok to back port to the open releases too once testing to complete there? Peter gcc/ * config/rs6000/ppc-auxv.h (PPC_FEATURE2_HTM_NO_SUSPEND): New define. * config/rs6000/rs6000.c (cpu_supports_info): Use it. gcc/testsuite/ * gcc.target/powerpc/cpu-builtin-1.c (htm-no-suspend): Add test. Index: gcc/config/rs6000/ppc-auxv.h =================================================================== --- gcc/config/rs6000/ppc-auxv.h (revision 254453) +++ gcc/config/rs6000/ppc-auxv.h (working copy) @@ -91,6 +91,7 @@ #define PPC_FEATURE2_HAS_IEEE128 0x00400000 #define PPC_FEATURE2_DARN 0x00200000 #define PPC_FEATURE2_SCV 0x00100000 +#define PPC_FEATURE2_HTM_NO_SUSPEND 0x00080000 /* Thread Control Block (TCB) offsets of the AT_PLATFORM, AT_HWCAP and Index: gcc/config/rs6000/rs6000.c =================================================================== --- gcc/config/rs6000/rs6000.c (revision 254453) +++ gcc/config/rs6000/rs6000.c (working copy) @@ -387,6 +387,7 @@ static const struct { "ebb", PPC_FEATURE2_HAS_EBB, 1 }, { "htm", PPC_FEATURE2_HAS_HTM, 1 }, { "htm-nosc", PPC_FEATURE2_HTM_NOSC, 1 }, + { "htm-no-suspend", PPC_FEATURE2_HTM_NO_SUSPEND, 1 }, { "isel", PPC_FEATURE2_HAS_ISEL, 1 }, { "tar", PPC_FEATURE2_HAS_TAR, 1 }, { "vcrypto", PPC_FEATURE2_HAS_VEC_CRYPTO, 1 }, Index: gcc/testsuite/gcc.target/powerpc/cpu-builtin-1.c =================================================================== --- gcc/testsuite/gcc.target/powerpc/cpu-builtin-1.c (revision 254453) +++ gcc/testsuite/gcc.target/powerpc/cpu-builtin-1.c (working copy) @@ -73,6 +73,7 @@ use_cpu_supports_builtins (unsigned int p[37] = __builtin_cpu_supports ("vsx"); p[38] = __builtin_cpu_supports ("darn"); p[39] = __builtin_cpu_supports ("scv"); + p[40] = __builtin_cpu_supports ("htm-no-suspend"); #else p[0] = 0; #endif