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