From patchwork Mon Jun 3 03:01:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kewen.Lin" X-Patchwork-Id: 1942630 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=idr8fP4A; 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 4VszKb4JjKz20Q1 for ; Mon, 3 Jun 2024 13:12:03 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D23743954400 for ; Mon, 3 Jun 2024 03:12:01 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id B03403948A53 for ; Mon, 3 Jun 2024 03:02:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B03403948A53 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 B03403948A53 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=148.163.156.1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1717383758; cv=none; b=GSR6KDLP46v2aRXj+37i/NP81d7bwAFb1mb4YOJBpZLux+2jXTuInuaGhMWNmg+rYXx71e13ycNsbxncSBho22V5CgHvf+D0vs0hDdm6m/ABYHzBvXRIDGMMrC+DVBpxzc5bLknM7rOIptvwIvZzlF44LsfgUA5ADgQVPpPvTAY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1717383758; c=relaxed/simple; bh=JGjYMWvLkgSqxMUlnvvV2rHAMKhPHKcNdgyx1+HsV7k=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=HUo+eofiILb3ujK6fjvtS3Y2pwC0aKN2x240SHt9BiEvS+myev15e4YkDvgajy4CY0aCHh04EdSDczjzOe0SGkPs/wsnHT7PXkzFLdsZrfHrkY80Jx5xpR0T0WPQ36dsMJRSEUgJt5qf0/xguCvmOmVk4E967u9ESshdo0i2ppI= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0353727.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 4532x82m029621 for ; Mon, 3 Jun 2024 03:02:33 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=49k0+TRlSikKirsxQ6BYwg3Hbq+OTaMzmh8dwh7+w5Y=; b=idr8fP4AVcRRZzWHJ3DXXSb1kU02BsXuoCBuB5qlevIMtab474zrliV4IXrtBbjR2Tnm p4ldb54I+IsUW+7eVqqq9bpwnY4ViQ2qOL5MZI8mLj7q9MZsaXQqfcy1DYdydBL6GSzK x+xoYwvrArS8l3KwN8QFsBfWhXHuVzOkrWKOeKRcSvSEvqzf4VrJfvlhQD8VNMklkF1Z rpwkabZwQp+6dxPeMT0omtfsqjm31GjU05gBouGtCw76xlYwjNS9Yr94odqN+h4ng2qe g+1vnaA+3j2SYCc5hUo2sfTPY4ropjYjxoZ8/P5ND3fEllpBzKd+9ZsPwqeQ9/hUo1I8 7g== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yh5gf809r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 03 Jun 2024 03:02:33 +0000 Received: from m0353727.ppops.net (m0353727.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 45332WKv004358 for ; Mon, 3 Jun 2024 03:02:32 GMT Received: from ppma13.dal12v.mail.ibm.com (dd.9e.1632.ip4.static.sl-reverse.com [50.22.158.221]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yh5gf809p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 03 Jun 2024 03:02:32 +0000 Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 452NfJ4D022851; Mon, 3 Jun 2024 03:02:31 GMT Received: from smtprelay05.fra02v.mail.ibm.com ([9.218.2.225]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 3ygg6kw444-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 03 Jun 2024 03:02:31 +0000 Received: from smtpav02.fra02v.mail.ibm.com (smtpav02.fra02v.mail.ibm.com [10.20.54.101]) by smtprelay05.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 45332Si142205578 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 3 Jun 2024 03:02:30 GMT Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E9C6B2004E; Mon, 3 Jun 2024 03:02:27 +0000 (GMT) Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2656120040; Mon, 3 Jun 2024 03:02:27 +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:26 +0000 (GMT) From: Kewen Lin To: gcc-patches@gcc.gnu.org Cc: linkw@linux.ibm.com, jeffreyalaw@gmail.com, richard.guenther@gmail.com Subject: [PATCH 40/52] ia64: New hook implementation ia64_c_mode_for_floating_type Date: Sun, 2 Jun 2024 22:01:30 -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: 2EJBNWse47baIFo086RDbcLmk3l0bK4n X-Proofpoint-GUID: Me4zzX26EBcBNP0ByVKtwPc6uSWolmTz 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 impostorscore=0 lowpriorityscore=0 malwarescore=0 phishscore=0 clxscore=1015 priorityscore=1501 mlxlogscore=999 mlxscore=0 spamscore=0 suspectscore=0 adultscore=0 bulkscore=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 ia64 port, and add new port specific hook implementation ia64_c_mode_for_floating_type. gcc/ChangeLog: * config/ia64/ia64.cc (ia64_c_mode_for_floating_type): New function. (TARGET_C_MODE_FOR_FLOATING_TYPE): New macro. * config/ia64/ia64.h (FLOAT_TYPE_SIZE): Remove. (DOUBLE_TYPE_SIZE): Likewise. (LONG_DOUBLE_TYPE_SIZE): Likewise. --- gcc/config/ia64/ia64.cc | 18 ++++++++++++++++++ gcc/config/ia64/ia64.h | 12 ------------ 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/gcc/config/ia64/ia64.cc b/gcc/config/ia64/ia64.cc index ac3d56073ac..cd6ed895211 100644 --- a/gcc/config/ia64/ia64.cc +++ b/gcc/config/ia64/ia64.cc @@ -321,6 +321,7 @@ static const char *ia64_invalid_conversion (const_tree, const_tree); static const char *ia64_invalid_unary_op (int, const_tree); static const char *ia64_invalid_binary_op (int, const_tree, const_tree); static machine_mode ia64_c_mode_for_suffix (char); +static machine_mode ia64_c_mode_for_floating_type (enum tree_index); static void ia64_trampoline_init (rtx, tree, rtx); static void ia64_override_options_after_change (void); static bool ia64_member_type_forces_blk (const_tree, machine_mode); @@ -637,6 +638,9 @@ static const scoped_attribute_specs *const ia64_attribute_table[] = #undef TARGET_C_MODE_FOR_SUFFIX #define TARGET_C_MODE_FOR_SUFFIX ia64_c_mode_for_suffix +#undef TARGET_C_MODE_FOR_FLOATING_TYPE +#define TARGET_C_MODE_FOR_FLOATING_TYPE ia64_c_mode_for_floating_type + #undef TARGET_CAN_ELIMINATE #define TARGET_CAN_ELIMINATE ia64_can_eliminate @@ -11329,6 +11333,20 @@ ia64_c_mode_for_suffix (char suffix) return VOIDmode; } +/* Implement TARGET_C_MODE_FOR_FLOATING_TYPE. Return DFmode, XFmode + or TFmode for TI_LONG_DOUBLE_TYPE which is for long double type, + go with the default one for the others. */ + +static machine_mode +ia64_c_mode_for_floating_type (enum tree_index ti) +{ + /* long double is XFmode normally, and TFmode for HPUX. It should be + TFmode for VMS as well but we only support up to DFmode now. */ + if (ti == TI_LONG_DOUBLE_TYPE) + return TARGET_HPUX ? TFmode : (TARGET_ABI_OPEN_VMS ? DFmode : XFmode); + return default_mode_for_floating_type (ti); +} + static GTY(()) rtx ia64_dconst_0_5_rtx; rtx diff --git a/gcc/config/ia64/ia64.h b/gcc/config/ia64/ia64.h index b7f9d654f90..763b1c3ed48 100644 --- a/gcc/config/ia64/ia64.h +++ b/gcc/config/ia64/ia64.h @@ -236,18 +236,6 @@ while (0) #define LONG_LONG_TYPE_SIZE 64 -#define FLOAT_TYPE_SIZE 32 - -#define DOUBLE_TYPE_SIZE 64 - -/* long double is XFmode normally, and TFmode for HPUX. It should be - TFmode for VMS as well but we only support up to DFmode now. */ -#define LONG_DOUBLE_TYPE_SIZE \ - (TARGET_HPUX ? 128 \ - : TARGET_ABI_OPEN_VMS ? 64 \ - : 80) - - #define DEFAULT_SIGNED_CHAR 1 /* A C expression for a string describing the name of the data type to use for