dfp.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /* Decimal floating point support functions for GNU compiler.
  2. Copyright (C) 2005-2019 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 *, const real_format *,
  30. const REAL_VALUE_TYPE *);
  31. void decimal_real_to_decimal (char *, const REAL_VALUE_TYPE *, size_t, size_t, int);
  32. void decimal_do_fix_trunc (REAL_VALUE_TYPE *, const REAL_VALUE_TYPE *);
  33. void decimal_real_maxval (REAL_VALUE_TYPE *, int, machine_mode);
  34. wide_int decimal_real_to_integer (const REAL_VALUE_TYPE *, bool *, int);
  35. HOST_WIDE_INT decimal_real_to_integer (const REAL_VALUE_TYPE *);
  36. #ifdef TREE_CODE
  37. bool decimal_real_arithmetic (REAL_VALUE_TYPE *, enum tree_code, const REAL_VALUE_TYPE *,
  38. const REAL_VALUE_TYPE *);
  39. #endif
  40. #endif /* GCC_DFP_H */