From patchwork Wed May 16 15:53:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Carl Love X-Patchwork-Id: 914720 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-477774-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=us.ibm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="Dh7NvoYb"; 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 40mJrQ3VqGz9s2R for ; Thu, 17 May 2018 01:53:41 +1000 (AEST) 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:to:cc:date:mime-version:message-id:content-type :content-transfer-encoding; q=dns; s=default; b=uuA6gOT/tBvv3JRq V54GYwYDxB3t0p0KkDTHDNL4G76gZQRckIUSzt0b9GxXvqiRLx8/gllbUXtwbzGg 2OdEL09G/xqN2UbwAqWyQnq+mL3jMErfucEhGdAHm/JblZg9zPEzR4lhIddqyyR/ HT2AD8im4Vz6sXohyrJWBU39OUo= 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:to:cc:date:mime-version:message-id:content-type :content-transfer-encoding; s=default; bh=NG/XaYqW66Ev7z6imrsomB rGy2o=; b=Dh7NvoYbsZOoKNlcrApIXtu4pjUcbFfcNr5wBQzf8c1L0yyZtjk3UR NHuOJa41C6yar6eKBDfbj3ESxiV1DY7WhicKViDIAVos/tnyWsMs3IspsAjig+WY 5MjuATRtxrsflaSAmf7AKNZJl4RvHluz9Jv4mxC5YXUe7Nbs0tH4I= Received: (qmail 9579 invoked by alias); 16 May 2018 15:53:33 -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 9555 invoked by uid 89); 16 May 2018 15:53:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-27.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=2.06, love X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0a-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.156.1) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 16 May 2018 15:53:31 +0000 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w4GFnbrt117587 for ; Wed, 16 May 2018 11:53:30 -0400 Received: from e16.ny.us.ibm.com (e16.ny.us.ibm.com [129.33.205.206]) by mx0a-001b2d01.pphosted.com with ESMTP id 2j0qg98hfg-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 16 May 2018 11:53:29 -0400 Received: from localhost by e16.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 16 May 2018 11:53:27 -0400 Received: from b01cxnp22033.gho.pok.ibm.com (9.57.198.23) by e16.ny.us.ibm.com (146.89.104.203) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 16 May 2018 11:53:26 -0400 Received: from b01ledav001.gho.pok.ibm.com (b01ledav001.gho.pok.ibm.com [9.57.199.106]) by b01cxnp22033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w4GFrPwa45613056; Wed, 16 May 2018 15:53:25 GMT Received: from b01ledav001.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C67B32805E; Wed, 16 May 2018 11:53:19 -0400 (EDT) Received: from b01ledav001.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3A68728059; Wed, 16 May 2018 11:53:19 -0400 (EDT) Received: from oc3304648336.ibm.com (unknown [9.70.82.186]) by b01ledav001.gho.pok.ibm.com (Postfix) with ESMTP; Wed, 16 May 2018 11:53:19 -0400 (EDT) Subject: [PATCH, rs6000] Fixes for builtin_prefetch for AIX compatability. From: Carl Love To: Segher Boessenkool , gcc-patches@gcc.gnu.org, David Edelsohn Cc: Bill Schmidt , cel@us.ibm.com Date: Wed, 16 May 2018 08:53:24 -0700 Mime-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 18051615-0024-0000-0000-00000359E033 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009035; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000260; SDB=6.01033190; UDB=6.00528267; IPR=6.00812322; MB=3.00021147; MTD=3.00000008; XFM=3.00000015; UTC=2018-05-16 15:53:27 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18051615-0025-0000-0000-00004808FE51 Message-Id: <1526486004.8281.19.camel@us.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-05-16_08:, , 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=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1805160159 X-IsSubscribed: yes GCC Maintainers: The previous patch to map dcbtstt, dcbtt to n2=0 for __builtin_prefetch builtin caused issues on AIX. The issue is AIX does not support the dcbtstt and dcbtt extended mnemonics. Unfortunately, the AIX assembler also does not support the three operand form of dcbt and dcbtst on Power 7.   This patch fixes up the support for dcbtstt and dcbtt to make it compatible with Linux and AIX. The new support now starts with Power 8 rather then Power 7 on both systems for simplicity. The patch has been tested on   powerpc64le-unknown-linux-gnu (Power 8 LE) AIX 7.2.0.0 Power 8 Please let me know if the fix is acceptable for trunk. Thanks. Carl Love ----------------------------------------------------------------------------- gcc/ChangeLog: 2018-05-16 Carl Love * config/rs6000/rs6000.md (prefetch): Generate ISA 2.06 instructions dcbt and dcbtstt with TH=16 if operands[2] is 0 and Power 8 or newer. --- gcc/config/rs6000/rs6000.md | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index 8536c89..19b4465 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.md @@ -13233,22 +13233,27 @@ (match_operand:SI 2 "const_int_operand" "n"))] "" { - /* dcbtstt, dcbtt and TM=0b10000 support starts with ISA 2.06. */ - int inst_select = INTVAL (operands[2]) || !TARGET_POPCNTD; + + + /* dcbtstt, dcbtt and TH=0b10000 support starts with ISA 2.06 (Power7). + AIX does not support the dcbtstt and dcbtt extended mnemonics. + The AIX assembler does not support the three operand form of dcbt + and dcbtst on Power 7 (-mpwr7). */ + int inst_select = INTVAL (operands[2]) || !TARGET_DIRECT_MOVE; if (REG_P (operands[0])) { if (INTVAL (operands[1]) == 0) - return inst_select ? "dcbt 0,%0" : "dcbtt 0,%0"; + return inst_select ? "dcbt 0,%0" : "dcbt 0,%0,16"; else - return inst_select ? "dcbtst 0,%0" : "dcbtstt 0,%0"; + return inst_select ? "dcbtst 0,%0" : "dcbtst 0,%0,16"; } else { if (INTVAL (operands[1]) == 0) - return inst_select ? "dcbt %a0" : "dcbtt %a0"; + return inst_select ? "dcbt %a0" : "dcbt %a0,16"; else - return inst_select ? "dcbtst %a0" : "dcbtstt %a0"; + return inst_select ? "dcbtst %a0" : "dcbtst %a0,16"; } } [(set_attr "type" "load")])