aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-cppbuiltin.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2004-03-04 10:23:23 +0000
committerAlan Modra <amodra@gcc.gnu.org>2004-03-04 20:53:23 +1030
commitddc6856430bcef3e68563b08cc513f794a5cb57e (patch)
tree2a5b34507a773fc68de86a6f3a19dec1a8df7b3e /gcc/c-cppbuiltin.c
parentca87076c9bfac0090fcc26c06dd1c24dc5e72bc9 (diff)
downloadgcc-ddc6856430bcef3e68563b08cc513f794a5cb57e.zip
gcc-ddc6856430bcef3e68563b08cc513f794a5cb57e.tar.gz
gcc-ddc6856430bcef3e68563b08cc513f794a5cb57e.tar.bz2
real.c (encode_ibm_extended): Don't bother rounding low double.
* real.c (encode_ibm_extended): Don't bother rounding low double. * c-cppbuiltin.c (builtin_define_float_constants): Tweak MAX when fmt->pnan < fmt->p. From-SVN: r78900
Diffstat (limited to 'gcc/c-cppbuiltin.c')
-rw-r--r--gcc/c-cppbuiltin.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/c-cppbuiltin.c b/gcc/c-cppbuiltin.c
index 4e671d6..8573b8c 100644
--- a/gcc/c-cppbuiltin.c
+++ b/gcc/c-cppbuiltin.c
@@ -193,6 +193,16 @@ builtin_define_float_constants (const char *name_prefix, const char *fp_suffix,
if (i < n)
*p++ = "08ce"[n - i];
sprintf (p, "p%d", fmt->emax * fmt->log2_b);
+ if (fmt->pnan < fmt->p)
+ {
+ /* This is an IBM extended double format made up of two IEEE
+ doubles. The value of the long double is the sum of the
+ values of the two parts. The most significant part is
+ required to be the value of the long double rounded to the
+ nearest double. Rounding means we need a slightly smaller
+ value for LDBL_MAX. */
+ buf[4 + fmt->pnan / 4] = "7bde"[fmt->pnan % 4];
+ }
}
sprintf (name, "__%s_MAX__", name_prefix);
builtin_define_with_hex_fp_value (name, type, decimal_dig, buf, fp_suffix);