From patchwork Mon Feb 27 11:20:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajit Agarwal X-Patchwork-Id: 65676 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 72D883858412 for ; Mon, 27 Feb 2023 11:21:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 72D883858412 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677496866; bh=opMEEob6UraXQqrmQO6QLWtTKt1rjzAuyOAtFTB7EnY=; h=Date:To:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=J/CNdT5ks7bU8g1jha2LGyF9Q+pDP0Jm+GWV9jHw+Pet7/AacXhkRmQiFcpQkm6aG rMESPUtWEiPkcrYf+ePZ1oL1V4P33ajs/XKccqh0JJkCZTKCSmOTxs81NK16jr2tdq /ctm61HC6mXyVGqVA14qlKyKTHjC2yBRrTVZVt78= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 9A2563858D32 for ; Mon, 27 Feb 2023 11:20:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9A2563858D32 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 31RA1LqW008970; Mon, 27 Feb 2023 11:20:38 GMT Received: from ppma02dal.us.ibm.com (a.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.10]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3p0td5hwn4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 27 Feb 2023 11:20:37 +0000 Received: from pps.filterd (ppma02dal.us.ibm.com [127.0.0.1]) by ppma02dal.us.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 31RA8Dg8016023; Mon, 27 Feb 2023 11:20:37 GMT Received: from smtprelay05.wdc07v.mail.ibm.com ([9.208.129.117]) by ppma02dal.us.ibm.com (PPS) with ESMTPS id 3nybdkdjsp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 27 Feb 2023 11:20:37 +0000 Received: from smtpav01.dal12v.mail.ibm.com (smtpav01.dal12v.mail.ibm.com [10.241.53.100]) by smtprelay05.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 31RBKXuX11141660 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 27 Feb 2023 11:20:34 GMT Received: from smtpav01.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DAB7858065; Mon, 27 Feb 2023 11:20:33 +0000 (GMT) Received: from smtpav01.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1D5AB58059; Mon, 27 Feb 2023 11:20:32 +0000 (GMT) Received: from [9.203.102.189] (unknown [9.203.102.189]) by smtpav01.dal12v.mail.ibm.com (Postfix) with ESMTP; Mon, 27 Feb 2023 11:20:31 +0000 (GMT) Message-ID: <9cd11c5f-373e-bb76-233e-6574f5d53173@linux.ibm.com> Date: Mon, 27 Feb 2023 16:50:30 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Content-Language: en-US To: gcc-patches Cc: Segher Boessenkool , bergner@linux.ibm.com Subject: [PATCH] rs6000: Inline lrint and lrintf X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: fAHM16EV5puG-1gkxWf3VLQxVCL4HzTc X-Proofpoint-GUID: fAHM16EV5puG-1gkxWf3VLQxVCL4HzTc X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.170.22 definitions=2023-02-26_22,2023-02-27_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 spamscore=0 malwarescore=0 mlxscore=0 phishscore=0 adultscore=0 mlxlogscore=999 impostorscore=0 bulkscore=0 lowpriorityscore=0 suspectscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2302270086 X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Ajit Agarwal via Gcc-patches From: Ajit Agarwal Reply-To: Ajit Agarwal Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" Hello All: Here is the patch for Inline lrint and lrintf. Currently glibc don't use __builtin_lrint as they inline lrint with fctid/fctiw instruction. With the below changes such inlines are not required and lrint builtin can be used. Bootstrapped and regtested on powerpc64-linux-gnu. rs6000: Inline lrint,lrintf For hard-float powerpc, GCC should support inline code generation for the lrint or lrintf built-in functions, subject only to -fno-math-errno (the condition -fno-math-errno is already checked in builtins.c:expand_builtin_int_roundingfn_2, so the back end's lrint insn patterns do not need to check that condition). TARGET_FPRND has nothing to do with fctid and fctiw. Remove the TARGET_FPRND from lrintdi2 pattern. 2023-02-27 Ajit Kumar Agarwal gcc/ChangeLog: * config/rs6000/rs6000.md (lrintdi2): Remove TARGET_FPRND condition from pattern. --- gcc/config/rs6000/rs6000.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index 81bffb04ceb..65c851e11fb 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.md @@ -6654,7 +6654,7 @@ (define_insn "lrintdi2" [(set (match_operand:DI 0 "gpc_reg_operand" "=d") (unspec:DI [(match_operand:SFDF 1 "gpc_reg_operand" "")] UNSPEC_FCTID))] - "TARGET_HARD_FLOAT && TARGET_FPRND" + "TARGET_HARD_FLOAT" "fctid %0,%1" [(set_attr "type" "fp")])