From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailout05.t-online.de (mailout05.t-online.de [194.25.134.82]) by sourceware.org (Postfix) with ESMTPS id 0E3C1395447A; Mon, 3 Jun 2024 03:16:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0E3C1395447A Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=t-online.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=t-online.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 0E3C1395447A Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=194.25.134.82 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1717384607; cv=none; b=kyUM7d2NoTkpWLvXXHXQQP2jNsquHe713Csq/36IGgpaLe6gRa8SneHtY31WQUEHbHyX7LDzIJCGIX9sxTdUeWdY/aaF5ksLiHD47+Rs4xQ8QW5f6X4+5HgwIch6qonBXpW+56Q6LCJ72xD3G4hbdeSncfg2xM+xlv8fotn+Pu4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1717384607; c=relaxed/simple; bh=suLoXgRp0sAzwKILK+qPUEiNzQg1TjCA41bpBM/IWbY=; h=Message-ID:Subject:From:To:Date:MIME-Version; b=H6yf1BFlKyu96nc5vaPjsiALDNGBmNGapYsdGLFCiJdB7FKL8m19raEjDMmj0g69hPVopvhePWxjmc0ZeP71PIJmWfUWUrBTf2GkyeltG4wCGkCGQXDDqp9mNgviJWtJMWKTztD2GYGBqC8oghiDi2YTCuzjcwMQ+ZlYHfFM7KU= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from fwd88.aul.t-online.de (fwd88.aul.t-online.de [10.223.144.114]) by mailout05.t-online.de (Postfix) with SMTP id C00B79A9A; Mon, 3 Jun 2024 05:16:43 +0200 (CEST) Received: from localhost.localdomain ([115.165.108.210]) by fwd88.t-online.de with (TLSv1.3:TLS_AES_256_GCM_SHA384 encrypted) esmtp id 1sDyBd-2Ct3Tc0; Mon, 3 Jun 2024 05:16:42 +0200 Message-ID: <5e9013c163f0e076fafe366bc391d17995044fd5.camel@t-online.de> Subject: Re: [PATCH 45/52] sh: New hook implementation sh_c_mode_for_floating_type From: Oleg Endo To: Kewen Lin , gcc-patches@gcc.gnu.org Cc: aoliva@gcc.gnu.org, olegendo@gcc.gnu.org Date: Mon, 03 Jun 2024 12:16:38 +0900 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.50.4 (3.50.4-1.fc39) MIME-Version: 1.0 X-TOI-EXPURGATEID: 150726::1717384602-E63EB3AB-BD6BB046/0/0 CLEAN NORMAL X-TOI-MSGID: 6596c9f1-3792-45dc-8f85-ad7c9ffd035a X-Spam-Status: No, score=-10.0 required=5.0 tests=BAYES_00,FREEMAIL_FROM,GIT_PATCH_0,KAM_DMARC_STATUS,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,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 List-Id: Hi! On Sun, 2024-06-02 at 22:01 -0500, Kewen Lin wrote: > This is to remove macro LONG_DOUBLE_TYPE_SIZE define in > sh port, and add new port specific hook implementation > sh_c_mode_for_floating_type. >=20 The SH parts look OK to me. Best regards, Oleg Endo > gcc/ChangeLog: >=20 > * config/sh/sh.cc (sh_c_mode_for_floating_type): New function. > (TARGET_C_MODE_FOR_FLOATING_TYPE): New macro. > * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Remove. > --- > gcc/config/sh/sh.cc | 18 ++++++++++++++++++ > gcc/config/sh/sh.h | 10 ---------- > 2 files changed, 18 insertions(+), 10 deletions(-) >=20 > diff --git a/gcc/config/sh/sh.cc b/gcc/config/sh/sh.cc > index ef3c2e6791d..bc017420381 100644 > --- a/gcc/config/sh/sh.cc > +++ b/gcc/config/sh/sh.cc > @@ -328,6 +328,7 @@ static unsigned int sh_hard_regno_nregs (unsigned int= , machine_mode); > static bool sh_hard_regno_mode_ok (unsigned int, machine_mode); > static bool sh_modes_tieable_p (machine_mode, machine_mode); > static bool sh_can_change_mode_class (machine_mode, machine_mode, reg_cl= ass_t); > +static machine_mode sh_c_mode_for_floating_type (enum tree_index); > =0C > TARGET_GNU_ATTRIBUTES (sh_attribute_table, > { > @@ -664,6 +665,9 @@ TARGET_GNU_ATTRIBUTES (sh_attribute_table, > #undef TARGET_HAVE_SPECULATION_SAFE_VALUE > #define TARGET_HAVE_SPECULATION_SAFE_VALUE speculation_safe_value_not_ne= eded > =20 > +#undef TARGET_C_MODE_FOR_FLOATING_TYPE > +#define TARGET_C_MODE_FOR_FLOATING_TYPE sh_c_mode_for_floating_type > + > struct gcc_target targetm =3D TARGET_INITIALIZER; > =0C > =20 > @@ -10674,6 +10678,20 @@ sh_can_change_mode_class (machine_mode from, mac= hine_mode to, > return true; > } > =20 > +/* Implement TARGET_C_MODE_FOR_FLOATING_TYPE. Return SFmode or DFmode > + for TI_DOUBLE_TYPE which is for double type, go with the default one > + for the others. */ > + > +static machine_mode > +sh_c_mode_for_floating_type (enum tree_index ti) > +{ > + /* Since the SH2e has only `float' support, it is desirable to make al= l > + floating point types equivalent to `float'. */ > + if (ti =3D=3D TI_DOUBLE_TYPE) > + return TARGET_FPU_SINGLE_ONLY ? SFmode : DFmode; > + return default_mode_for_floating_type (ti); > +} > + > /* Return true if registers in machine mode MODE will likely be > allocated to registers in small register classes. */ > bool > diff --git a/gcc/config/sh/sh.h b/gcc/config/sh/sh.h > index 7d3a3f08338..53cad85d122 100644 > --- a/gcc/config/sh/sh.h > +++ b/gcc/config/sh/sh.h > @@ -425,9 +425,6 @@ extern const sh_atomic_model& selected_atomic_model (= void); > /* Width in bits of a `long long'. */ > #define LONG_LONG_TYPE_SIZE 64 > =20 > -/* Width in bits of a `long double'. */ > -#define LONG_DOUBLE_TYPE_SIZE 64 > - > /* Width of a word, in units (bytes). */ > #define UNITS_PER_WORD (4) > #define MIN_UNITS_PER_WORD 4 > @@ -1433,13 +1430,6 @@ extern bool current_function_interrupt; > Do not define this if the table should contain absolute addresses. *= / > #define CASE_VECTOR_PC_RELATIVE 1 > =20 > -/* Define it here, so that it doesn't get bumped to 64-bits on SHmedia. = */ > -#define FLOAT_TYPE_SIZE 32 > - > -/* Since the SH2e has only `float' support, it is desirable to make all > - floating point types equivalent to `float'. */ > -#define DOUBLE_TYPE_SIZE (TARGET_FPU_SINGLE_ONLY ? 32 : 64) > - > /* 'char' is signed by default. */ > #define DEFAULT_SIGNED_CHAR 1 > =20 > --=20 > 2.43.0 >=20