dfp.h 2.3 KB

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