This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Making double precision constants work with -fsingle-precision-constant


On Wed, Dec 07, 2005 at 12:34:22PM -0800, Richard Henderson wrote:
> On Wed, Dec 07, 2005 at 02:25:08PM -0500, Carlos O'Donell wrote:
> > 	* gcc/c-cppbuiltin.c (builtin_define_float_constants): Add
> > 	fp_cast parameter, pass to builtin_define_with_hex_fp_value.
> > 	(builtin_define_with_hex_fp_value): Use fp_cast when building macro.
> > 	(c_cpp_builtins): If flag_single_precision_constant then set fp_cast
> > 	to "((double)%sL)" otherwise "%s".
> 
> This part looks ok, as far as it goes.

Ok.

> > 	* libstdc++-v3/include/std/std_limits.h
> > 	[__DBL_DENORM_MIN__] (struct numeric_limits): Set denorm_present.
> > 	[!__DBL_DENORM_MIN__] (struct numeric_limits): Set denorm_absent.
> 
> This part is wrong.  __DBL_DENORM_MIN__ will be defined, but 
> evaluate to zero, if denormals are not supported.

Would it be useful to define __DBL_HAS_DENORM__, it is already a
property of the format (gcc/gcc/real.h)?

> Personally I think this option is very deeply flawed, for the
> reasons shown by this patch.  And thus it should simply be
> removed instead of hacked around in this way.

It makes poorly written code run faster. If that isn't a compelling
argument for keeping the flag then I don't know what is... :)

c.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]