From patchwork Mon Jun 3 03:00:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kewen.Lin" X-Patchwork-Id: 1942594 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=mOrQq+5B; 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 4Vsz8p2P1dz20PW for ; Mon, 3 Jun 2024 13:04:26 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8296E3948815 for ; Mon, 3 Jun 2024 03:04:24 +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 45DEE394847D for ; Mon, 3 Jun 2024 03:01:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 45DEE394847D 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 45DEE394847D 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=1717383722; cv=none; b=JZdXGpT3btWHyftiht7KnSxT9M5aSMOF7dBAW3XkWIVdYopwdlfylqIAQaKbazXaUBeh1sounlMi/rkfHPPwTstYPND5uvYKVxoZCDaZfnpvTyvGH4OjVbZ5VxHYsHkKHcTCEXjUSpj0JkH4kyKKmjzqvPAmHdKPCALTjkuAlkg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1717383722; c=relaxed/simple; bh=KCjfdhk5DM81HLxoriwiI59nVqOeSkiQWX21opsxo0Q=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=Y1vkgMy72U0EU7TjblmOQsq8EGImLv5M0sB6YUTjEPJmZEJF8IGLdiMVwNceylvnBI+E3KyfjBW3ItDAE8eudr9uEEIHAc+dgJ/Z3ExWnMp+Wy8QLglWMKxnqhw29+LrR0mIo6J/rP+fGd7UQfN4yyfALmtYxQHz933OOXT6Xu0= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0360072.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 4532qZlh008795 for ; Mon, 3 Jun 2024 03:01:58 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=AFdQC458CkDEE5Pda6Gfanxo5EyxaHcFnzn+d06nUVs=; b=mOrQq+5BDug9bt1aJe8ijhpkJJ5jJv/SLzMU7e3gGVhA04UnWE7MyPLl4+j6oOsLhY4V KxCvlMFyvs+gXMdVyzwY3YSOmYhUmERpgd5fG1KLfhJyTP6I3VDPFgbVoG4jMjTn3MnB 7UNu2o0odczUgwC/IoOjtclfv/ZtCvSNWWTt69Y9mLuq6H82US2niflIsz4yH92b67Np wMtjyP/hjt4HiLWfymu3yVJrcf55QjYOS//65XHwLq993XU52+uAgPUkD9Kz6Bml3m5t k7WMovipBqZ2E3Asa79Aej+W8svW91HjnF10sgPUeHHHNDw0SzFeEBRUx79xKNIC+y94 pQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yh5e8g0ma-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 03 Jun 2024 03:01:58 +0000 Received: from m0360072.ppops.net (m0360072.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 45331wPa023143 for ; Mon, 3 Jun 2024 03:01:58 GMT 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 3yh5e8g0m6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 03 Jun 2024 03:01:58 +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 4530cD4J026509; Mon, 3 Jun 2024 03:01:57 GMT Received: from smtprelay04.fra02v.mail.ibm.com ([9.218.2.228]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 3yggp2mxs3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 03 Jun 2024 03:01:57 +0000 Received: from smtpav02.fra02v.mail.ibm.com (smtpav02.fra02v.mail.ibm.com [10.20.54.101]) by smtprelay04.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 45331q2x24445502 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 3 Jun 2024 03:01:54 GMT Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id F25612004E; Mon, 3 Jun 2024 03:01:51 +0000 (GMT) Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4D9F420043; Mon, 3 Jun 2024 03:01:51 +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:51 +0000 (GMT) From: Kewen Lin To: gcc-patches@gcc.gnu.org Cc: linkw@linux.ibm.com, gaiusmod2@gmail.com Subject: [PATCH 06/52] m2: Replace uses of {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE Date: Sun, 2 Jun 2024 22:00:56 -0500 Message-ID: <1a669daea19f586636a7aba0dce9dd1627ce3459.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-GUID: -iFwQ-JY6N8VyyS5cUo5XtkvuOvFzBrc X-Proofpoint-ORIG-GUID: xaDog8LpmqIGNLaX3-dMCavoK-umQcJl 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 clxscore=1015 spamscore=0 lowpriorityscore=0 malwarescore=0 impostorscore=0 phishscore=0 suspectscore=0 adultscore=0 bulkscore=0 mlxscore=0 mlxlogscore=456 priorityscore=1501 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 m2 with TYPE_PRECISION of {float,{,long_}double}_type_node. [1] https://gcc.gnu.org/pipermail/gcc-patches/2024-May/651209.html gcc/m2/ChangeLog: * gm2-gcc/m2type.cc (build_m2_short_real_node): Use TYPE_PRECISION of float_type_node to replace FLOAT_TYPE_SIZE. (build_m2_real_node): Use TYPE_PRECISION of double_type_node to replace DOUBLE_TYPE_SIZE. (build_m2_long_real_node): Use TYPE_PRECISION of long_double_type_node to replace LONG_DOUBLE_TYPE_SIZE. --- gcc/m2/gm2-gcc/m2type.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gcc/m2/gm2-gcc/m2type.cc b/gcc/m2/gm2-gcc/m2type.cc index 571923c08ef..d52cbdf0b99 100644 --- a/gcc/m2/gm2-gcc/m2type.cc +++ b/gcc/m2/gm2-gcc/m2type.cc @@ -1420,7 +1420,7 @@ build_m2_short_real_node (void) /* Define `REAL'. */ c = make_node (REAL_TYPE); - TYPE_PRECISION (c) = FLOAT_TYPE_SIZE; + TYPE_PRECISION (c) = TYPE_PRECISION (float_type_node); layout_type (c); return c; } @@ -1433,7 +1433,7 @@ build_m2_real_node (void) /* Define `REAL'. */ c = make_node (REAL_TYPE); - TYPE_PRECISION (c) = DOUBLE_TYPE_SIZE; + TYPE_PRECISION (c) = TYPE_PRECISION (double_type_node); layout_type (c); return c; } @@ -1447,7 +1447,7 @@ build_m2_long_real_node (void) if (M2Options_GetIBMLongDouble ()) { longreal = make_node (REAL_TYPE); - TYPE_PRECISION (longreal) = LONG_DOUBLE_TYPE_SIZE; + TYPE_PRECISION (longreal) = TYPE_PRECISION (long_double_type_node); } else if (M2Options_GetIEEELongDouble ()) longreal = float128_type_node;