1169689Skan/* Decimal floating point support functions for GNU compiler.
2169689Skan   Copyright (C) 2005, 2006 Free Software Foundation, Inc.
3169689Skan
4169689SkanThis file is part of GCC.
5169689Skan
6169689SkanGCC is free software; you can redistribute it and/or modify it under
7169689Skanthe terms of the GNU General Public License as published by the Free
8169689SkanSoftware Foundation; either version 2, or (at your option) any later
9169689Skanversion.
10169689Skan
11169689SkanGCC is distributed in the hope that it will be useful, but WITHOUT ANY
12169689SkanWARRANTY; without even the implied warranty of MERCHANTABILITY or
13169689SkanFITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14169689Skanfor more details.
15169689Skan
16169689SkanYou should have received a copy of the GNU General Public License
17169689Skanalong with GCC; see the file COPYING.  If not, write to the Free
18169689SkanSoftware Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
19169689Skan02110-1301, USA.  */
20169689Skan
21169689Skan#ifndef GCC_DFP_H
22169689Skan#define GCC_DFP_H
23169689Skan
24169689Skan/* Encode REAL_VALUE_TYPEs into 32/64/128-bit IEEE 754R encoded values.  */
25169689Skanvoid encode_decimal32  (const struct real_format *fmt, long *, const REAL_VALUE_TYPE *);
26169689Skanvoid encode_decimal64  (const struct real_format *fmt, long *, const REAL_VALUE_TYPE *);
27169689Skanvoid decode_decimal128 (const struct real_format *, REAL_VALUE_TYPE *, const long *);
28169689Skan
29169689Skan/* Decode 32/64/128-bit IEEE 754R encoded values into REAL_VALUE_TYPEs.  */
30169689Skanvoid decode_decimal32  (const struct real_format *, REAL_VALUE_TYPE *, const long *);
31169689Skanvoid decode_decimal64  (const struct real_format *, REAL_VALUE_TYPE *, const long *);
32169689Skanvoid encode_decimal128 (const struct real_format *fmt, long *, const REAL_VALUE_TYPE *);
33169689Skan
34169689Skan/* Arithmetic and conversion functions.  */
35169689Skanint  decimal_do_compare (const REAL_VALUE_TYPE *, const REAL_VALUE_TYPE *, int);
36169689Skanvoid decimal_real_from_string (REAL_VALUE_TYPE *, const char *);
37169689Skanvoid decimal_round_for_format (const struct real_format *, REAL_VALUE_TYPE *);
38169689Skanvoid decimal_real_convert (REAL_VALUE_TYPE *, enum machine_mode, const REAL_VALUE_TYPE *);
39169689Skanvoid decimal_real_to_decimal (char *, const REAL_VALUE_TYPE *, size_t, size_t, int);
40169689Skanvoid decimal_do_fix_trunc (REAL_VALUE_TYPE *, const REAL_VALUE_TYPE *);
41169689Skanbool decimal_real_arithmetic (REAL_VALUE_TYPE *, enum tree_code, const REAL_VALUE_TYPE *,
42169689Skan			      const REAL_VALUE_TYPE *);
43169689Skanvoid decimal_real_maxval (REAL_VALUE_TYPE *, int, enum machine_mode);
44169689Skanvoid decimal_real_to_integer2 (HOST_WIDE_INT *, HOST_WIDE_INT *, const REAL_VALUE_TYPE *);
45169689SkanHOST_WIDE_INT decimal_real_to_integer (const REAL_VALUE_TYPE *);
46169689Skan
47169689Skan#endif /* GCC_DFP_H */
48