aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-cppbuiltin.c
diff options
context:
space:
mode:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>2007-07-18 17:30:38 +0000
committerKaveh Ghazi <ghazi@gcc.gnu.org>2007-07-18 17:30:38 +0000
commit7faa1bbb5d0206cc83f20c1145f612f7754fdcf3 (patch)
treeeb2db58c64bbaba8f0181d8d24ef99a386911de5 /gcc/c-cppbuiltin.c
parentb5d32c25372d1e0604bbd8471d735e46215dbe03 (diff)
downloadgcc-7faa1bbb5d0206cc83f20c1145f612f7754fdcf3.zip
gcc-7faa1bbb5d0206cc83f20c1145f612f7754fdcf3.tar.gz
gcc-7faa1bbb5d0206cc83f20c1145f612f7754fdcf3.tar.bz2
re PR target/30652 (SSE expansion is missing for isinf() and other fpclassify functions)
PR target/30652 PR middle-end/20558 * builtins.c (expand_builtin_interclass_mathfn): Provide a generic fallback for isinf. * c-cppbuiltin.c (builtin_define_float_constants): Move FP max calculation code ... * real.c (get_max_float): ... to here. * real.h (get_max_float): New. testsuite: * gcc.dg/pr28796-1.c: Add more cases. * gcc.dg/pr28796-2.c: Likewise. From-SVN: r126724
Diffstat (limited to 'gcc/c-cppbuiltin.c')
-rw-r--r--gcc/c-cppbuiltin.c27
1 files changed, 2 insertions, 25 deletions
diff --git a/gcc/c-cppbuiltin.c b/gcc/c-cppbuiltin.c
index 19bb47c..653c5e4 100644
--- a/gcc/c-cppbuiltin.c
+++ b/gcc/c-cppbuiltin.c
@@ -200,31 +200,8 @@ builtin_define_float_constants (const char *name_prefix,
/* Since, for the supported formats, B is always a power of 2, we
construct the following numbers directly as a hexadecimal
constants. */
-
- /* The maximum representable finite floating-point number,
- (1 - b**-p) * b**emax */
- {
- int i, n;
- char *p;
-
- strcpy (buf, "0x0.");
- n = fmt->p;
- for (i = 0, p = buf + 4; i + 3 < n; i += 4)
- *p++ = 'f';
- if (i < n)
- *p++ = "08ce"[n - i];
- sprintf (p, "p%d", fmt->emax);
- 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];
- }
- }
+ get_max_float (fmt, buf, sizeof (buf));
+
sprintf (name, "__%s_MAX__", name_prefix);
builtin_define_with_hex_fp_value (name, type, decimal_dig, buf, fp_suffix, fp_cast);