From patchwork Mon Jun 3 03:00:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kewen.Lin" X-Patchwork-Id: 1942641 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=cGagT07Y; 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 4VszQ606G0z20PW for ; Mon, 3 Jun 2024 13:15:58 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 114563954C57 for ; Mon, 3 Jun 2024 03:15:56 +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 1B8113948A40 for ; Mon, 3 Jun 2024 03:03:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1B8113948A40 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 1B8113948A40 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=1717383801; cv=none; b=KgjE7sstHk5X0ocVl5HzYJFkwjuhmXMFPvTKsKXM2TEOWwzHX1ILWyr8gKBmSMQ0HR3nr1Bjg8xu0YHCuGokL0To/7wBwwXhCpQJRCPRtf/VjTWE6GSpeWYxkg91vTM/0VC/ObJ/WaJ+8PVhU8mRJ8qoJQNznHFAu3tfCVGQCrM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1717383801; c=relaxed/simple; bh=gF3Rw+U5613MJ1GPeFzsOzcMDplqm1Ssjto4Dv19sqY=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=oI86qY4Ymcqxjh638BDjIAAuX76gTIxygrByL40OPuv9iZ6XuMGE0wAZEdaAZ0lQFGEGp+EtDjP/VuDejwcZvuU19GYWESgRW9tMC93TONkFP/RL3FoYBKkgCqeEEwfLdookumDCX2tNOHyPxbCfwgRu/1phHWIReY/SOW3nSQg= 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 4532Pm7B017622; Mon, 3 Jun 2024 03:01:56 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=2NLp4/eho9sBD5Y9iJCmUa6rau9uvWgz8fqiotVD6SQ=; b=cGagT07YKfUIZgZcw0sK1rU+gRr+UUYlgqHUenZ1O0RAHyaQ/MjRBWA1mfYrKkTj58nz 1CpoPaNAE7el8m2PxvwziomWho1CCVm2dWrvlku9wNf2Pxf4pK2BLxHooep4GpXi/Gh1 oDmKyK9WAWxkkhXR375AJDg4ETSpsKfirhP/UJ3tBV6o3efbH9vLJxM2Vf50LekmmjZG usHSoJMeLtKDDymrkJT493FhR1g5+dl+IjqtHLHEmo8nrzazYKiDMBKijrMQloPcsteA 9/3zE2ZGVhTlLC2DbSPsMXxMQ7tVCjdBDTzLsl9w5DswnBnUP2oWiP/lAdVR1SWrXA4o +g== Received: from ppma11.dal12v.mail.ibm.com (db.9e.1632.ip4.static.sl-reverse.com [50.22.158.219]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yh4ug825e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 03 Jun 2024 03:01:56 +0000 Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1]) by ppma11.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 4530NLWI026550; Mon, 3 Jun 2024 03:01:55 GMT Received: from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 3yggp2mxru-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 03 Jun 2024 03:01:55 +0000 Received: from smtpav02.fra02v.mail.ibm.com (smtpav02.fra02v.mail.ibm.com [10.20.54.101]) by smtprelay02.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 45331olL43385340 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 3 Jun 2024 03:01:52 GMT Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 02F5B20063; Mon, 3 Jun 2024 03:01:50 +0000 (GMT) Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5243620040; Mon, 3 Jun 2024 03:01:49 +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:01:49 +0000 (GMT) From: Kewen Lin To: gcc-patches@gcc.gnu.org Cc: linkw@linux.ibm.com, ian@airs.com Subject: [PATCH 04/52] go: Replace uses of {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE Date: Sun, 2 Jun 2024 22:00:54 -0500 Message-ID: <657e010ec8d3bb5d42adc765dbf384a60a3569f4.1717134752.git.linkw@linux.ibm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: 9j3-11dnKUDsYRN0p-b11I8ffZPZRUhz X-Proofpoint-GUID: 9j3-11dnKUDsYRN0p-b11I8ffZPZRUhz X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 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=1011 mlxlogscore=506 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, KAM_SHORT, 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 Joseph pointed out "floating types should have their mode, not a poorly defined precision value" in the discussion[1], as he and Richi suggested, the existing macros {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE will be replaced with a hook mode_for_floating_type. To be prepared for that, this patch is to replace use of {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE in go with TYPE_PRECISION of {float,{,long_}double}_type_node. [1] https://gcc.gnu.org/pipermail/gcc-patches/2024-May/651209.html gcc/go/ChangeLog: * go-gcc.cc (Gcc_backend::float_type): Use TYPE_PRECISION of {float,double,long_double}_type_node to replace {FLOAT,DOUBLE,LONG_DOUBLE}_TYPE_SIZE. (Gcc_backend::complex_type): Likewise. --- gcc/go/go-gcc.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gcc/go/go-gcc.cc b/gcc/go/go-gcc.cc index bc9732c3db3..6aa751f9f30 100644 --- a/gcc/go/go-gcc.cc +++ b/gcc/go/go-gcc.cc @@ -993,11 +993,11 @@ Btype* Gcc_backend::float_type(int bits) { tree type; - if (bits == FLOAT_TYPE_SIZE) + if (bits == TYPE_PRECISION (float_type_node)) type = float_type_node; - else if (bits == DOUBLE_TYPE_SIZE) + else if (bits == TYPE_PRECISION (double_type_node)) type = double_type_node; - else if (bits == LONG_DOUBLE_TYPE_SIZE) + else if (bits == TYPE_PRECISION (long_double_type_node)) type = long_double_type_node; else { @@ -1014,11 +1014,11 @@ Btype* Gcc_backend::complex_type(int bits) { tree type; - if (bits == FLOAT_TYPE_SIZE * 2) + if (bits == TYPE_PRECISION (float_type_node) * 2) type = complex_float_type_node; - else if (bits == DOUBLE_TYPE_SIZE * 2) + else if (bits == TYPE_PRECISION (double_type_node) * 2) type = complex_double_type_node; - else if (bits == LONG_DOUBLE_TYPE_SIZE * 2) + else if (bits == TYPE_PRECISION (long_double_type_node) * 2) type = complex_long_double_type_node; else {