From patchwork Thu Mar 15 15:00:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Carl Love X-Patchwork-Id: 886276 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-474783-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="Hn0bTJyU"; 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 402BcK6jVGz9sVK for ; Fri, 16 Mar 2018 02:01:04 +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 :subject:from:to:cc:date:content-type:mime-version :content-transfer-encoding:message-id; q=dns; s=default; b=UZr3q iaCiu6LyoNnFNSn84PsfSFeIhQBb8AahjvjiWDSJw7UoB8CBAjFMuz4wM50ThwZ/ s6T10kEPLCu96MaCb6BqWMtCIAiO55C9/V92Iz70HeTv2DBK/ay53GhNJOwje88u Mumy6mloRZJb+77L6yeToHs22i80hqcUc7J6dI= 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:content-type:mime-version :content-transfer-encoding:message-id; s=default; bh=ADClomZxFrc mEoM6oM4EZxnYS24=; b=Hn0bTJyUuxdbMpmu4bsX56orSSYOxAAFkJCkTZi2WIJ pm5Fh/JgZfkWZJvQwyXtZjGUAB8fFssOD1oA6rpjPojYIuPK2PpyG7D6nokzxutg 9l2hkWH7Nd1aYpFLd+prS2xOj81p88xz7a2z/UEvglJV41abPV2IJg34FXcyc0UE = Received: (qmail 38278 invoked by alias); 15 Mar 2018 15:00:57 -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 38247 invoked by uid 89); 15 Mar 2018 15:00:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-27.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT, RCVD_IN_DNSWL_LOW, SPF_PASS, TIME_LIMIT_EXCEEDED autolearn=unavailable version=3.3.2 spammy= 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; Thu, 15 Mar 2018 15:00:36 +0000 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w2FF07vO033506 for ; Thu, 15 Mar 2018 11:00:33 -0400 Received: from e37.co.us.ibm.com (e37.co.us.ibm.com [32.97.110.158]) by mx0a-001b2d01.pphosted.com with ESMTP id 2gqrygfe72-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Thu, 15 Mar 2018 11:00:29 -0400 Received: from localhost by e37.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 15 Mar 2018 09:00:27 -0600 Received: from b03cxnp08028.gho.boulder.ibm.com (9.17.130.20) by e37.co.us.ibm.com (192.168.1.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 15 Mar 2018 09:00:25 -0600 Received: from b03ledav002.gho.boulder.ibm.com (b03ledav002.gho.boulder.ibm.com [9.17.130.233]) by b03cxnp08028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w2FF0LcA57999418; Thu, 15 Mar 2018 08:00:21 -0700 Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B2965136040; Thu, 15 Mar 2018 09:00:21 -0600 (MDT) Received: from oc3304648336.ibm.com (unknown [9.70.82.121]) by b03ledav002.gho.boulder.ibm.com (Postfix) with ESMTP id 6748B136048; Thu, 15 Mar 2018 09:00:21 -0600 (MDT) Subject: [PATCH,rs6000] PR 844422 Fix FCTID, FCTIW with -mcpu=power7 From: Carl Love To: Segher Boessenkool , gcc-patches@gcc.gnu.org, David Edelsohn Cc: Bill Schmidt , cel@us.ibm.com Date: Thu, 15 Mar 2018 08:00:20 -0700 Mime-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 18031515-0024-0000-0000-00001815613E X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008679; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000254; SDB=6.01003436; UDB=6.00510670; IPR=6.00782762; MB=3.00020051; MTD=3.00000008; XFM=3.00000015; UTC=2018-03-15 15:00:26 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18031515-0025-0000-0000-00004F1D8D3B Message-Id: <1521126020.7699.16.camel@us.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-03-15_07:, , 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-1803150166 X-IsSubscribed: yes GCC Maintainers: The following patch fixes an ICE when compiling the test case   gcc -mcpu=power7 builtin-fctid-fctiw-runnable.c The GCC compiler now gives a message      "error: builtin function ‘__builtin_fctiw’ requires the ‘-mpower8- vector’ option"  and exits without generating an internal error. The patch has been tested by compiling by hand as given above.  The regression testing has also been done on   powerpc64-unknown-linux-gnu (Power 8 BE)   powerpc64le-unknown-linux-gnu (Power 8 LE)   powerpc64le-unknown-linux-gnu (Power 9 LE) with no regressions. Let me know if the patch looks OK or not. Thanks.                Carl Love ------------------------------------------------------------- gcc/ChangeLog: 2018-03-15 Carl Love PR target/84422 * config/rs6000/rs6000-builtin.def: Change macro expansion for FCTID, FCTIW to BU_P8V_MISC_1. --- gcc/config/rs6000/rs6000-builtin.def | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/gcc/config/rs6000/rs6000-builtin.def b/gcc/config/rs6000/rs6000-builtin.def index 783ecff..9925364 100644 --- a/gcc/config/rs6000/rs6000-builtin.def +++ b/gcc/config/rs6000/rs6000-builtin.def @@ -658,6 +658,14 @@ /* Miscellaneous builtins for instructions added in ISA 2.07. These instructions do require the ISA 2.07 vector support, but they aren't vector instructions. */ +#define BU_P8V_MISC_1(ENUM, NAME, ATTR, ICODE) \ + RS6000_BUILTIN_1 (MISC_BUILTIN_ ## ENUM, /* ENUM */ \ + "__builtin_" NAME, /* NAME */ \ + RS6000_BTM_P8_VECTOR, /* MASK */ \ + (RS6000_BTC_ ## ATTR /* ATTR */ \ + | RS6000_BTC_UNARY), \ + CODE_FOR_ ## ICODE) /* ICODE */ + #define BU_P8V_MISC_3(ENUM, NAME, ATTR, ICODE) \ RS6000_BUILTIN_3 (MISC_BUILTIN_ ## ENUM, /* ENUM */ \ "__builtin_" NAME, /* NAME */ \ @@ -1881,8 +1889,8 @@ BU_VSX_OVERLOAD_X (XST, "xst") BU_VSX_OVERLOAD_X (XST_BE, "xst_be") /* 1 argument builtins pre ISA 2.04. */ -BU_FP_MISC_1 (FCTID, "fctid", CONST, lrintdfdi2) -BU_FP_MISC_1 (FCTIW, "fctiw", CONST, lrintsfsi2) +BU_P8V_MISC_1 (FCTID, "fctid", CONST, lrintdfdi2) +BU_P8V_MISC_1 (FCTIW, "fctiw", CONST, lrintsfsi2) /* 2 argument CMPB instructions added in ISA 2.05. */ BU_P6_2 (CMPB_32, "cmpb_32", CONST, cmpbsi3)