From patchwork Mon Jun 3 03:01:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kewen.Lin" X-Patchwork-Id: 1942606 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=GfwFYTME; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VszCv6mC5z20Pb for ; Mon, 3 Jun 2024 13:07:07 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 277E13949F34 for ; Mon, 3 Jun 2024 03:07:06 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id CE46B3948A5A for ; Mon, 3 Jun 2024 03:02:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CE46B3948A5A Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linux.ibm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org CE46B3948A5A Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=148.163.158.5 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1717383750; cv=none; b=K/RxphAxZNj2ujEdCEe63+3AbcbLKi+LJ8YCX3NC3nSdy703jhtWHlWjMTjunsvbVmIGffnefWLmdsr2Pkf//d4+Ff0y/8nAgoFyUmgV+mdc7hPYk2nTf9oGD4axMrrfVqJdvdSNnAAWcPh3aDkxnLVqz7nebB8iPH1s8tSdyck= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1717383750; c=relaxed/simple; bh=ZB5TkFFLCe2kWnPkYQ8JJyPfouSlLZS2+ik1VmrstBw=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=evxkCO9mF0m3gMarUIjet/CQRgonJ/KXGPQQZPZg8K0S/luj5H4lZ2lnQgcuCIO8QZWB3TDBp2wqx1M+g1O0DHNhjSQuHO5SjXSSfPgrQibIVe91Kger9r0O28w54911WpUDoxHAApenWFlihD66CpcYbK0RsbxcBSwDc8APGQk= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0356516.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 4532td0w026032; Mon, 3 Jun 2024 03:02:28 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc : content-transfer-encoding : date : from : in-reply-to : message-id : mime-version : references : subject : to; s=pp1; bh=Zw/RO3vUF2+w8XVWD+Wg6nce79+Xv+FrR84zF/GDf6k=; b=GfwFYTME0mWs4K4qB3VQceVmiTkizwiTJm2E2Z5AygM6pfsaCk8+43Z+sj/FqlYRegi6 TQA+1dqWoKc6AnwlxOYaDHbMM26lZ5Hd9a6hmNKMM+S47Q0+O8g79xN/7LaZKhzpTdYR harVTf5fHKNbl/DJK1F/Yk8ei0PdiBqPGB6lYCafdMkqi2B3wG/GkNIYL46y+hE4QNsX lVsnbr7KjwVMPyMtAf+kB7a+rG28sf2eV1GO992NeNsLANHSTkK4UYUd2t0LfdOywxLZ f2x1qOj9akIdTKj/4Ofr5ONjaSiAC+2zOuB+YRoiSlfARs8cmi77bP3v61SFP73FEPUr GQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yh4ug826t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 03 Jun 2024 03:02:27 +0000 Received: from m0356516.ppops.net (m0356516.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 45332QMB005104; Mon, 3 Jun 2024 03:02:27 GMT Received: from ppma12.dal12v.mail.ibm.com (dc.9e.1632.ip4.static.sl-reverse.com [50.22.158.220]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yh4ug826r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 03 Jun 2024 03:02:26 +0000 Received: from pps.filterd (ppma12.dal12v.mail.ibm.com [127.0.0.1]) by ppma12.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 4530rOed000790; Mon, 3 Jun 2024 03:02:26 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 3ygdytnpn9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 03 Jun 2024 03:02:26 +0000 Received: from smtpav02.fra02v.mail.ibm.com (smtpav02.fra02v.mail.ibm.com [10.20.54.101]) by smtprelay03.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 45332MrA57344348 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 3 Jun 2024 03:02:24 GMT Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 847E720043; Mon, 3 Jun 2024 03:02:22 +0000 (GMT) Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B49FC20040; Mon, 3 Jun 2024 03:02:21 +0000 (GMT) Received: from trout.aus.stglabs.ibm.com (unknown [9.40.194.100]) by smtpav02.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 3 Jun 2024 03:02:21 +0000 (GMT) From: Kewen Lin To: gcc-patches@gcc.gnu.org Cc: linkw@linux.ibm.com, dje.gcc@gmail.com, segher@kernel.crashing.org Subject: [PATCH 35/52] rs6000: New hook implementation rs6000_c_mode_for_floating_type Date: Sun, 2 Jun 2024 22:01:25 -0500 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: jU2W8SPbrkv-pBPvjd-7hpNag31Feh12 X-Proofpoint-GUID: J0iVhqCVN2qMObMx9cddGeX39OA5X2cV X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.650,FMLib:17.12.28.16 definitions=2024-06-02_15,2024-05-30_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 spamscore=0 bulkscore=0 lowpriorityscore=0 impostorscore=0 priorityscore=1501 phishscore=0 clxscore=1015 mlxlogscore=971 malwarescore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2406030025 X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org This is to remove macros {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE defines in rs6000 port, and add new port specific hook implementation rs6000_c_mode_for_floating_type. gcc/ChangeLog: * config/rs6000/rs6000.cc (TARGET_C_MODE_FOR_FLOATING_TYPE): New macro. (rs6000_c_mode_for_floating_type): New function. * config/rs6000/rs6000.h (FLOAT_TYPE_SIZE): Remove. (DOUBLE_TYPE_SIZE): Likewise. (LONG_DOUBLE_TYPE_SIZE): Likewise. --- gcc/config/rs6000/rs6000.cc | 16 ++++++++++++++++ gcc/config/rs6000/rs6000.h | 14 -------------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc index e4dc629ddcc..d2fbbaddda7 100644 --- a/gcc/config/rs6000/rs6000.cc +++ b/gcc/config/rs6000/rs6000.cc @@ -1707,6 +1707,9 @@ static const scoped_attribute_specs *const rs6000_attribute_table[] = #undef TARGET_C_MODE_FOR_SUFFIX #define TARGET_C_MODE_FOR_SUFFIX rs6000_c_mode_for_suffix +#undef TARGET_C_MODE_FOR_FLOATING_TYPE +#define TARGET_C_MODE_FOR_FLOATING_TYPE rs6000_c_mode_for_floating_type + #undef TARGET_INVALID_BINARY_OP #define TARGET_INVALID_BINARY_OP rs6000_invalid_binary_op @@ -24365,6 +24368,19 @@ rs6000_c_mode_for_suffix (char suffix) return VOIDmode; } +/* Implement TARGET_C_MODE_FOR_FLOATING_TYPE. Return TFmode for + TI_LONG_DOUBLE_TYPE which is for long double type, go with the default + one for the others. */ + +static machine_mode +rs6000_c_mode_for_floating_type (enum tree_index ti) +{ + if (ti == TI_LONG_DOUBLE_TYPE) + return rs6000_long_double_type_size == FLOAT_PRECISION_TFmode ? TFmode + : DFmode; + return default_mode_for_floating_type (ti); +} + /* Target hook for invalid_arg_for_unprototyped_fn. */ static const char * invalid_arg_for_unprototyped_fn (const_tree typelist, const_tree funcdecl, const_tree val) diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h index 2cde2e329b0..9211f91740a 100644 --- a/gcc/config/rs6000/rs6000.h +++ b/gcc/config/rs6000/rs6000.h @@ -693,20 +693,6 @@ extern unsigned char rs6000_recip_bits[]; words. */ #define LONG_LONG_TYPE_SIZE 64 -/* A C expression for the size in bits of the type `float' on the - target machine. If you don't define this, the default is one - word. */ -#define FLOAT_TYPE_SIZE 32 - -/* A C expression for the size in bits of the type `double' on the - target machine. If you don't define this, the default is two - words. */ -#define DOUBLE_TYPE_SIZE 64 - -/* A C expression for the size in bits of the type `long double' on the target - machine. If you don't define this, the default is two words. */ -#define LONG_DOUBLE_TYPE_SIZE rs6000_long_double_type_size - /* Work around rs6000_long_double_type_size dependency in ada/targtyps.cc. */ #define WIDEST_HARDWARE_FP_SIZE 64