1*e4b17023SJohn Marino /* Decimal floating point support functions for GNU compiler. 2*e4b17023SJohn Marino Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc. 3*e4b17023SJohn Marino 4*e4b17023SJohn Marino This file is part of GCC. 5*e4b17023SJohn Marino 6*e4b17023SJohn Marino GCC is free software; you can redistribute it and/or modify it under 7*e4b17023SJohn Marino the terms of the GNU General Public License as published by the Free 8*e4b17023SJohn Marino Software Foundation; either version 3, or (at your option) any later 9*e4b17023SJohn Marino version. 10*e4b17023SJohn Marino 11*e4b17023SJohn Marino GCC is distributed in the hope that it will be useful, but WITHOUT ANY 12*e4b17023SJohn Marino WARRANTY; without even the implied warranty of MERCHANTABILITY or 13*e4b17023SJohn Marino FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14*e4b17023SJohn Marino for more details. 15*e4b17023SJohn Marino 16*e4b17023SJohn Marino You should have received a copy of the GNU General Public License 17*e4b17023SJohn Marino along with GCC; see the file COPYING3. If not see 18*e4b17023SJohn Marino <http://www.gnu.org/licenses/>. */ 19*e4b17023SJohn Marino 20*e4b17023SJohn Marino #ifndef GCC_DFP_H 21*e4b17023SJohn Marino #define GCC_DFP_H 22*e4b17023SJohn Marino 23*e4b17023SJohn Marino /* Encode REAL_VALUE_TYPEs into 32/64/128-bit IEEE 754 encoded values. */ 24*e4b17023SJohn Marino void encode_decimal32 (const struct real_format *fmt, long *, const REAL_VALUE_TYPE *); 25*e4b17023SJohn Marino void encode_decimal64 (const struct real_format *fmt, long *, const REAL_VALUE_TYPE *); 26*e4b17023SJohn Marino void decode_decimal128 (const struct real_format *, REAL_VALUE_TYPE *, const long *); 27*e4b17023SJohn Marino 28*e4b17023SJohn Marino /* Decode 32/64/128-bit IEEE 754 encoded values into REAL_VALUE_TYPEs. */ 29*e4b17023SJohn Marino void decode_decimal32 (const struct real_format *, REAL_VALUE_TYPE *, const long *); 30*e4b17023SJohn Marino void decode_decimal64 (const struct real_format *, REAL_VALUE_TYPE *, const long *); 31*e4b17023SJohn Marino void encode_decimal128 (const struct real_format *fmt, long *, const REAL_VALUE_TYPE *); 32*e4b17023SJohn Marino 33*e4b17023SJohn Marino /* Arithmetic and conversion functions. */ 34*e4b17023SJohn Marino int decimal_do_compare (const REAL_VALUE_TYPE *, const REAL_VALUE_TYPE *, int); 35*e4b17023SJohn Marino void decimal_real_from_string (REAL_VALUE_TYPE *, const char *); 36*e4b17023SJohn Marino void decimal_round_for_format (const struct real_format *, REAL_VALUE_TYPE *); 37*e4b17023SJohn Marino void decimal_real_convert (REAL_VALUE_TYPE *, enum machine_mode, const REAL_VALUE_TYPE *); 38*e4b17023SJohn Marino void decimal_real_to_decimal (char *, const REAL_VALUE_TYPE *, size_t, size_t, int); 39*e4b17023SJohn Marino void decimal_do_fix_trunc (REAL_VALUE_TYPE *, const REAL_VALUE_TYPE *); 40*e4b17023SJohn Marino void decimal_real_maxval (REAL_VALUE_TYPE *, int, enum machine_mode); 41*e4b17023SJohn Marino void decimal_real_to_integer2 (HOST_WIDE_INT *, HOST_WIDE_INT *, const REAL_VALUE_TYPE *); 42*e4b17023SJohn Marino HOST_WIDE_INT decimal_real_to_integer (const REAL_VALUE_TYPE *); 43*e4b17023SJohn Marino 44*e4b17023SJohn Marino #ifdef TREE_CODE 45*e4b17023SJohn Marino bool decimal_real_arithmetic (REAL_VALUE_TYPE *, enum tree_code, const REAL_VALUE_TYPE *, 46*e4b17023SJohn Marino const REAL_VALUE_TYPE *); 47*e4b17023SJohn Marino #endif 48*e4b17023SJohn Marino 49*e4b17023SJohn Marino #endif /* GCC_DFP_H */ 50