This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Eliminate MODE_HAS_... macros
- From: Richard Guenther <rguenther at suse dot de>
- To: Ulrich Weigand <uweigand at de dot ibm dot com>
- Cc: gcc-patches at gcc dot gnu dot org, trevor_smigiel at playstation dot sony dot com, andrew_pinski at playstation dot sony dot com
- Date: Tue, 12 Aug 2008 11:14:09 +0200 (CEST)
- Subject: Re: [PATCH] Eliminate MODE_HAS_... macros
- References: <200808111629.m7BGTa7M005024@d12av02.megacenter.de.ibm.com>
On Mon, 11 Aug 2008, Ulrich Weigand wrote:
> Richard Guenther wrote:
>
> > Yes, it would make sense to change
> > REAL_MODE_FORMAT_COMPOSITE_P to either take a struct real_format
> > or to a different name like REAL_MODE_COMPOSITE_P. I also still
> > think that if you pass a mode it makes sense to handle non-scalar
> > modes as well, likewise for checking purposes (we'd just index into
> > real_format_for_mode randomly otherwise) we should check if the
> > passed mode is a float mode - and if we do, we can simply be
> > generous and handle non-float modes appropriately.
>
> OK, here's a version of the patch with those changes. Would this
> be OK (once testing has completed)?
Yes, thanks.
Richard.
> Bye,
> Ulrich
>
> ChangeLog:
>
> * real.h (struct real_format): New member has_sign_dependent_rounding.
> * real.c (ieee_single_format, mips_single_format, motorola_single_format,
> spu_single_format, ieee_double_format, mips_double_format,
> motorola_double_format, ieee_extended_motorola_format,
> ieee_extended_intel_96_format, ieee_extended_intel_128_format,
> ieee_extended_intel_96_round_53_format, ibm_extended_format,
> mips_extended_format, ieee_quad_format, mips_quad_format,
> vax_f_format, vax_d_format, vax_g_format): Initialize it.
> * config/pdp11/pdp11.c (pdp11_f_format, pdp11_d_format): Likewise.
>
> * defaults.h (MODE_HAS_NANS, MODE_HAS_INFINITIES,
> MODE_HAS_SIGNED_ZEROS, MODE_HAS_SIGN_DEPENDENT_ROUNDING): Remove.
> * config/spu/spu.h (MODE_HAS_NANS, MODE_HAS_INFINITIES,
> MODE_HAS_SIGN_DEPENDENT_ROUNDING): Remove.
> (ROUND_TOWARDS_ZERO): Likewise.
>
> * real.h (REAL_MODE_FORMAT): Protect MODE against macro expansion.
> (FLOAT_MODE_FORMAT): New macro.
> (REAL_MODE_FORMAT_COMPOSITE_P): Remove, replace by ...
> (MODE_COMPOSITE_P): ... this new macro.
> (MODE_HAS_NANS, MODE_HAS_INFINITIES, MODE_HAS_SIGNED_ZEROS,
> MODE_HAS_SIGN_DEPENDENT_ROUNDING): Likewise.
> * machmode.h (GET_MODE_INNER): Cast result to enum machine_mode.
>
> * flags.h: Include "real.h".
>
> * fold-const.c (const_binop): Use MODE_COMPOSITE_P instead of
> REAL_MODE_FORMAT_COMPOSITE_P.
> * simplify-rtx.c (simplify_const_binary_operation): Likewise.
>
> * doc/tm.texi (Storage Layout): Remove documentation of
> MODE_HAS_NANS, MODE_HAS_INFINITIES, MODE_HAS_SIGNED_ZEROS,
> MODE_HAS_SIGN_DEPENDENT_ROUNDING. Update documentation of
> ROUND_TOWARDS_ZERO and LARGEST_EXPONENT_IS_NORMAL to clarify
> they only apply to libgcc2.a.