aboutsummaryrefslogtreecommitdiff
path: root/gdb/doublest.h
diff options
context:
space:
mode:
authorUlrich Weigand <ulrich.weigand@de.ibm.com>2017-11-06 16:04:03 +0100
committerUlrich Weigand <ulrich.weigand@de.ibm.com>2017-11-06 16:04:03 +0100
commit1cfb73dbb7503d1cfb088c14d1125a5030a1f386 (patch)
treea3446d08987ce758763ba739f3b8cb09d0f260db /gdb/doublest.h
parentb07e9c466ed24af614090ac42d6730a291608f69 (diff)
downloadgdb-1cfb73dbb7503d1cfb088c14d1125a5030a1f386.zip
gdb-1cfb73dbb7503d1cfb088c14d1125a5030a1f386.tar.gz
gdb-1cfb73dbb7503d1cfb088c14d1125a5030a1f386.tar.bz2
Target FP: Merge doublest.c and dfp.c into target-float.c
Now that all target FP operations are performed via target-float.c, this file remains the sole caller of functions in doublest.c and dfp.c. Therefore, this patch merges the latter files into the former and makes all their function static there. gdb/ChangeLog: 2017-11-06 Ulrich Weigand <uweigand@de.ibm.com> * Makefile.in (SFILES): Remove doublest.c and dfp.c. (HFILES_NO_SRCDIR): Remove doublest.h and dfp.h. (COMMON_OBS): Remove doublest.o and dfp.o. Do not build target-float.c (instead of doublest.c) with -Wformat-nonliteral. * doublest.c: Remove file. * doublest.h: Remove file. * dfp.c: Remove file. * dfp.h: Remove file. * target-float.c: Do not include "doublest.h" and "dfp.h". (DOUBLEST): Move here from doublest.h. (enum float_kind): Likewise. (FLOATFORMAT_CHAR_BIT): Likewise. (FLOATFORMAT_LARGEST_BYTES): Likewise. (floatformat_totalsize_bytes): Move here from doublest.c. Make static. (floatformat_precision): Likewise. (floatformat_normalize_byteorder, get_field, put_field): Likewise. (floatformat_is_negative, floatformat_classify, floatformat_mantissa): Likewise. (host_float_format, host_double_format, host_long_double_format): Likewise. (floatformat_to_string, floatformat_from_string): Likewise. (floatformat_to_doublest): Likewise. Also, inline the original convert_floatformat_to_doublest. (floatformat_from_doublest): Likewise. Also, inline the original convert_floatformat_from_doublest. Include "dpd/decimal128.h", "dpd/decimal64.h", and "dpd/decimal32.h". (MAX_DECIMAL_STRING): Move here from dfp.c. (match_endianness): Likewise. (set_decnumber_context, decimal_check_errors): Likewise. (decimal_from_number, decimal_to_number): Likewise. (decimal_to_string, decimal_from_string): Likewise. Make static. (decimal_from_longest, decimal_from_ulongest): Likewise. (decimal_to_longest): Likewise. (decimal_binop, decimal_is_zero, decimal_compare): Likewise. (decimal_convert): Likewise.
Diffstat (limited to 'gdb/doublest.h')
-rw-r--r--gdb/doublest.h79
1 files changed, 0 insertions, 79 deletions
diff --git a/gdb/doublest.h b/gdb/doublest.h
deleted file mode 100644
index fe3f897..0000000
--- a/gdb/doublest.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/* Floating point definitions for GDB.
-
- Copyright (C) 1986-2017 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
-
-#ifndef DOUBLEST_H
-#define DOUBLEST_H
-
-struct floatformat;
-
-/* Use `long double' if the host compiler supports it. (Note that this is not
- necessarily any longer than `double'. On SunOS/gcc, it's the same as
- double.) This is necessary because GDB internally converts all floating
- point values to the widest type supported by the host.
-
- There are problems however, when the target `long double' is longer than the
- host's `long double'. In general, we'll probably reduce the precision of
- any such values and print a warning. */
-
-#if (defined HAVE_LONG_DOUBLE && defined PRINTF_HAS_LONG_DOUBLE \
- && defined SCANF_HAS_LONG_DOUBLE)
-typedef long double DOUBLEST;
-#else
-typedef double DOUBLEST;
-/* If we can't scan or print long double, we don't want to use it
- anywhere. */
-# undef HAVE_LONG_DOUBLE
-# undef PRINTF_HAS_LONG_DOUBLE
-# undef SCANF_HAS_LONG_DOUBLE
-#endif
-
-/* Different kinds of floatformat numbers recognized by
- floatformat_classify. To avoid portability issues, we use local
- values instead of the C99 macros (FP_NAN et cetera). */
-enum float_kind {
- float_nan,
- float_infinite,
- float_zero,
- float_normal,
- float_subnormal
-};
-
-extern void floatformat_to_doublest (const struct floatformat *,
- const void *in, DOUBLEST *out);
-extern void floatformat_from_doublest (const struct floatformat *,
- const DOUBLEST *in, void *out);
-
-extern int floatformat_is_negative (const struct floatformat *,
- const bfd_byte *);
-extern enum float_kind floatformat_classify (const struct floatformat *,
- const bfd_byte *);
-extern const char *floatformat_mantissa (const struct floatformat *,
- const bfd_byte *);
-
-extern std::string floatformat_to_string (const struct floatformat *fmt,
- const gdb_byte *in,
- const char *format = nullptr);
-extern bool floatformat_from_string (const struct floatformat *fmt,
- gdb_byte *out, const std::string &in);
-
-/* Return the floatformat's total size in host bytes. */
-
-extern size_t floatformat_totalsize_bytes (const struct floatformat *fmt);
-
-#endif