Message ID | a392840c9b75418658342ff7f3d430c79e7a7655.1717134752.git.linkw@linux.ibm.com |
---|---|
State | New |
Headers | show |
Series | Replace {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE with new hook | expand |
Hi, Gentle ping: https://gcc.gnu.org/pipermail/gcc-patches/2024-June/653374.html BR, Kewen on 2024/6/3 11:01, Kewen Lin wrote: > 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
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