This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: PATCH: New test for breakage from real.c rewrite on i386-unknown-freebsd
- From: Loren James Rittle <rittle at latour dot rsch dot comm dot mot dot com>
- To: libstdc++ at gcc dot gnu dot org
- Cc: rth at redhat dot com
- Date: Thu, 19 Sep 2002 03:40:52 -0500 (CDT)
- Subject: Re: PATCH: New test for breakage from real.c rewrite on i386-unknown-freebsd
> These values are only correct for 64-bit double, not 80-bit long double.
> The compiler is completely unprepared for you to do
> #define __glibcpp_long_double_bits __glibcpp_double_bits
> without doing
> #define LONG_DOUBLE_TYPE_SIZE 64
Well, I will not protest your statement but it is odd that it used to
"work"; I guess we just got lucky with the old real.c code configuration.
OK, based on reading the new documentation (sorry I didn't fish a bit
more before posting my observations), a new correct way to get this C ABI:
`long double' using "64-bit double precision" IEEE mode
(confirmed by close reading of system headers and other
sources) with 96-bit size and alignments (but only god knows why)
would be something like this:
1. Create and document a new macro ala INTEL_EXTENDED_IEEE_FORMAT.
2. Use it in port's config file:
#define LONG_DOUBLE_TYPE_SIZE 96
#undef INTEL_EXTENDED_IEEE_FORMAT
#define FREEBSD_I386_LONG_DOUBLE_FORMAT
3. Add a default section to defaults.h so that modern macro usage works out.
4. Handle it in format_for_size() case IEEE_FLOAT_FORMAT, case 96
(Under the untested assumption that padding is placed at the end...)
case 96:
if (FREEBSD_I386_LONG_DOUBLE_FORMAT)
return &ieee_double;
else if (!INTEL_EXTENDED_IEEE_FORMAT)
return &ieee_extended_motorola;
else
return &ieee_extended_intel_96;
Regards,
Loren