From patchwork Mon Jun 3 03:01:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kewen.Lin" X-Patchwork-Id: 1942633 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=eV6Xzf42; 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 4VszLb5Synz20Q1 for ; Mon, 3 Jun 2024 13:12:55 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 035EC3954447 for ; Mon, 3 Jun 2024 03:12:54 +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 BA61B39484B2; Mon, 3 Jun 2024 03:02:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BA61B39484B2 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 BA61B39484B2 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=1717383752; cv=none; b=ETPPiIEJ868X1sLYymawN4fw1rXipoC9CXOsGnAHFueBRuKh98U/9FMlEaOgXdUP8qT8NhFgmERlxYMlhVR2yrQAY0gUvi+7y5fZ6IH94zlqK+k7+KeTHXoUUt5vZDRoLmgH7Z/ObQ3sM9n9VJVWIobYXkK2Mx+a1k9jtwgGvY0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1717383752; c=relaxed/simple; bh=z/5L9m+rbwu7giR3zOfLGWZ5RVeZGf5ZCW/ZYiCUXmk=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=oVZehva1rzeOrJvSKoUu3HuU2qHRoHOv6k+pRR9cR0nOZAk5bZvqFOC3FMpDAbReg+ZLR///24lI2ZVW3bcg+rumIC+hEwykULDa+wUH1AI3whPtt7lPGKKXPsgsc2/lKrgRtUuuyO/EokYMgK+utgQbZqvlVPxE6/TFqNoMV1E= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0353722.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 4532SpKa022595; 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=3vkDLxzhYZgnIJ0ruCxsyyFpkax8UXsWJDd68a6Bevw=; b=eV6Xzf42/OMgo1ERdea41/k5vd64n5KBCd+pSvsq4ji0HU5/TSJnNrvlboryRUiIcd7S 1mayLsEBxz4r/gRSULBrlErt6BJteP0EZbkMhsjeB7xeQSxdbcXQTlwmlOB18Y7+qVbs UddbwWgz5g9tfBHS49EHkvhvHt5WCoW4L1sQi9WuiAni8OLxmn5ZjCtJvyc3xb0ZjUEN 4pglE2jmoeoRvYgIg1wO/XDq3D2dlZi7UHoZmdF4/4PjdVUsgJ+djqV7NCwZCpR+5Iul 9ryx5VRZQhTAAFQ3FrS7KjIHOGKUchjXSnJO0KbuIW0Z8wO4OlUGQZvEW1Egbxbum0xh nQ== 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 3yh52d81ut-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 03 Jun 2024 03:02:28 +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 452NkKC0022794; Mon, 3 Jun 2024 03:02:27 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 3ygg6kw43g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 03 Jun 2024 03:02:27 +0000 Received: from smtpav02.fra02v.mail.ibm.com (smtpav02.fra02v.mail.ibm.com [10.20.54.101]) by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 45332N7S29557476 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 3 Jun 2024 03:02:26 GMT Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CFE262004B; Mon, 3 Jun 2024 03:02:23 +0000 (GMT) Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C25A920040; Mon, 3 Jun 2024 03:02:22 +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:22 +0000 (GMT) From: Kewen Lin To: gcc-patches@gcc.gnu.org Cc: linkw@linux.ibm.com, richard.earnshaw@arm.com, richard.sandiford@arm.com, marcus.shawcroft@arm.com, ktkachov@gcc.gnu.org Subject: [PATCH 36/52] aarch64: New hook implementation aarch64_c_mode_for_floating_type Date: Sun, 2 Jun 2024 22:01:26 -0500 Message-ID: <04ffc80353d58e7af4af30592bfaccdb44498276.1717134752.git.linkw@linux.ibm.com> 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: QKWHvXYemALQ0vSSD0JDJqPEl5PtUecs X-Proofpoint-GUID: QKWHvXYemALQ0vSSD0JDJqPEl5PtUecs 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 priorityscore=1501 malwarescore=0 spamscore=0 clxscore=1011 phishscore=0 adultscore=0 mlxlogscore=999 bulkscore=0 impostorscore=0 mlxscore=0 suspectscore=0 lowpriorityscore=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 aarch64 port, and add new port specific hook implementation aarch64_c_mode_for_floating_type. gcc/ChangeLog: * config/aarch64/aarch64.cc (aarch64_c_mode_for_floating_type): New function. (TARGET_C_MODE_FOR_FLOATING_TYPE): New macro. * config/aarch64/aarch64.h (FLOAT_TYPE_SIZE): Remove. (DOUBLE_TYPE_SIZE): Likewise. (LONG_DOUBLE_TYPE_SIZE): Likewise. --- gcc/config/aarch64/aarch64.cc | 15 +++++++++++++++ gcc/config/aarch64/aarch64.h | 6 ------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc index ee12d8897a8..1c1c278fd69 100644 --- a/gcc/config/aarch64/aarch64.cc +++ b/gcc/config/aarch64/aarch64.cc @@ -28427,6 +28427,18 @@ aarch64_bitint_type_info (int n, struct bitint_info *info) return true; } +/* 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 +aarch64_c_mode_for_floating_type (enum tree_index ti) +{ + if (ti == TI_LONG_DOUBLE_TYPE) + return TFmode; + return default_mode_for_floating_type (ti); +} + /* Implement TARGET_SCHED_CAN_SPECULATE_INSN. Return true if INSN can be scheduled for speculative execution. Reject the long-running division and square-root instructions. */ @@ -30554,6 +30566,9 @@ aarch64_run_selftests (void) #undef TARGET_C_BITINT_TYPE_INFO #define TARGET_C_BITINT_TYPE_INFO aarch64_bitint_type_info +#undef TARGET_C_MODE_FOR_FLOATING_TYPE +#define TARGET_C_MODE_FOR_FLOATING_TYPE aarch64_c_mode_for_floating_type + #undef TARGET_EXPAND_BUILTIN #define TARGET_EXPAND_BUILTIN aarch64_expand_builtin diff --git a/gcc/config/aarch64/aarch64.h b/gcc/config/aarch64/aarch64.h index bbf11faaf4b..2064c23f961 100644 --- a/gcc/config/aarch64/aarch64.h +++ b/gcc/config/aarch64/aarch64.h @@ -96,12 +96,6 @@ #define LONG_LONG_TYPE_SIZE 64 -#define FLOAT_TYPE_SIZE 32 - -#define DOUBLE_TYPE_SIZE 64 - -#define LONG_DOUBLE_TYPE_SIZE 128 - /* This value is the amount of bytes a caller is allowed to drop the stack before probing has to be done for stack clash protection. */ #define STACK_CLASH_CALLER_GUARD 1024