+# if REAL_WIDTH == 2
+# define CONST_DOUBLE_FORMAT "ww"
+# else
+# if REAL_WIDTH == 3
+# define CONST_DOUBLE_FORMAT "www"
+# else
+# if REAL_WIDTH == 4
+# define CONST_DOUBLE_FORMAT "wwww"
+# else
+# if REAL_WIDTH == 5
+# define CONST_DOUBLE_FORMAT "wwwww"
+# else
+# if REAL_WIDTH == 6
+# define CONST_DOUBLE_FORMAT "wwwwww"
+# else
+ #error "REAL_WIDTH > 6 not supported"
+# endif
+# endif
+# endif
+# endif
+# endif
+#endif
+
+
+/* Describes the properties of the specific target format in use. */
+struct real_format
+{
+ /* Move to and from the target bytes. */
+ void (*encode) (const struct real_format *, long *,
+ const REAL_VALUE_TYPE *);
+ void (*decode) (const struct real_format *, REAL_VALUE_TYPE *,
+ const long *);
+
+ /* The radix of the exponent and digits of the significand. */
+ int b;
+
+ /* Size of the significand in digits of radix B. */
+ int p;
+
+ /* Size of the significant of a NaN, in digits of radix B. */
+ int pnan;
+
+ /* The minimum negative integer, x, such that b**(x-1) is normalized. */
+ int emin;
+
+ /* The maximum integer, x, such that b**(x-1) is representable. */
+ int emax;
+
+ /* The bit position of the sign bit, for determining whether a value
+ is positive/negative, or -1 for a complex encoding. */
+ int signbit_ro;
+
+ /* The bit position of the sign bit, for changing the sign of a number,
+ or -1 for a complex encoding. */
+ int signbit_rw;
+
+ /* Properties of the format. */
+ bool has_nans;
+ bool has_inf;
+ bool has_denorm;
+ bool has_signed_zero;
+ bool qnan_msb_set;
+ bool canonical_nan_lsbs_set;
+};
+
+
+/* The target format used for each floating point mode.
+ Float modes are followed by decimal float modes, with entries for
+ float modes indexed by (MODE - first float mode), and entries for
+ decimal float modes indexed by (MODE - first decimal float mode) +
+ the number of float modes. */
+extern const struct real_format *
+ real_format_for_mode[MAX_MODE_FLOAT - MIN_MODE_FLOAT + 1
+ + MAX_MODE_DECIMAL_FLOAT - MIN_MODE_DECIMAL_FLOAT + 1];
+
+#define REAL_MODE_FORMAT(MODE) \
+ (real_format_for_mode[DECIMAL_FLOAT_MODE_P (MODE) \
+ ? ((MODE - MIN_MODE_DECIMAL_FLOAT) \
+ + (MAX_MODE_FLOAT - MIN_MODE_FLOAT + 1)) \
+ : (MODE - MIN_MODE_FLOAT)])
+
+/* The following macro determines whether the floating point format is
+ composite, i.e. may contain non-consecutive mantissa bits, in which
+ case compile-time FP overflow may not model run-time overflow. */
+#define REAL_MODE_FORMAT_COMPOSITE_P(MODE) \
+ ((REAL_MODE_FORMAT(MODE))->pnan < (REAL_MODE_FORMAT (MODE))->p)
+
+/* Declare functions in real.c. */
+
+/* Binary or unary arithmetic on tree_code. */
+extern bool real_arithmetic (REAL_VALUE_TYPE *, int, const REAL_VALUE_TYPE *,
+ const REAL_VALUE_TYPE *);
+
+/* Compare reals by tree_code. */
+extern bool real_compare (int, const REAL_VALUE_TYPE *, const REAL_VALUE_TYPE *);
+
+/* Determine whether a floating-point value X is infinite. */
+extern bool real_isinf (const REAL_VALUE_TYPE *);
+
+/* Determine whether a floating-point value X is a NaN. */
+extern bool real_isnan (const REAL_VALUE_TYPE *);
+
+/* Determine whether a floating-point value X is finite. */
+extern bool real_isfinite (const REAL_VALUE_TYPE *);
+
+/* Determine whether a floating-point value X is negative. */
+extern bool real_isneg (const REAL_VALUE_TYPE *);
+
+/* Determine whether a floating-point value X is minus zero. */
+extern bool real_isnegzero (const REAL_VALUE_TYPE *);
+
+/* Compare two floating-point objects for bitwise identity. */
+extern bool real_identical (const REAL_VALUE_TYPE *, const REAL_VALUE_TYPE *);
+
+/* Extend or truncate to a new mode. */
+extern void real_convert (REAL_VALUE_TYPE *, enum machine_mode,
+ const REAL_VALUE_TYPE *);
+
+/* Return true if truncating to NEW is exact. */
+extern bool exact_real_truncate (enum machine_mode, const REAL_VALUE_TYPE *);
+
+/* Render R as a decimal floating point constant. */
+extern void real_to_decimal (char *, const REAL_VALUE_TYPE *, size_t,
+ size_t, int);
+
+/* Render R as a hexadecimal floating point constant. */
+extern void real_to_hexadecimal (char *, const REAL_VALUE_TYPE *,
+ size_t, size_t, int);
+
+/* Render R as an integer. */
+extern HOST_WIDE_INT real_to_integer (const REAL_VALUE_TYPE *);
+extern void real_to_integer2 (HOST_WIDE_INT *, HOST_WIDE_INT *,
+ const REAL_VALUE_TYPE *);
+
+/* Initialize R from a decimal or hexadecimal string. Return -1 if
+ the value underflows, +1 if overflows, and 0 otherwise. */
+extern int real_from_string (REAL_VALUE_TYPE *, const char *);
+/* Wrapper to allow different internal representation for decimal floats. */
+extern void real_from_string3 (REAL_VALUE_TYPE *, const char *, enum machine_mode);
+
+/* Initialize R from an integer pair HIGH/LOW. */
+extern void real_from_integer (REAL_VALUE_TYPE *, enum machine_mode,
+ unsigned HOST_WIDE_INT, HOST_WIDE_INT, int);
+
+extern long real_to_target_fmt (long *, const REAL_VALUE_TYPE *,
+ const struct real_format *);
+extern long real_to_target (long *, const REAL_VALUE_TYPE *, enum machine_mode);
+
+extern void real_from_target_fmt (REAL_VALUE_TYPE *, const long *,
+ const struct real_format *);
+extern void real_from_target (REAL_VALUE_TYPE *, const long *,
+ enum machine_mode);
+
+extern void real_inf (REAL_VALUE_TYPE *);
+
+extern bool real_nan (REAL_VALUE_TYPE *, const char *, int, enum machine_mode);
+
+extern void real_maxval (REAL_VALUE_TYPE *, int, enum machine_mode);
+
+extern void real_2expN (REAL_VALUE_TYPE *, int, enum machine_mode);