target-float.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /* Floating point definitions for GDB.
  2. Copyright (C) 1986-2022 Free Software Foundation, Inc.
  3. This file is part of GDB.
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 3 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program. If not, see <http://www.gnu.org/licenses/>. */
  14. #ifndef TARGET_FLOAT_H
  15. #define TARGET_FLOAT_H
  16. #include "expression.h"
  17. extern bool target_float_is_valid (const gdb_byte *addr,
  18. const struct type *type);
  19. extern bool target_float_is_zero (const gdb_byte *addr,
  20. const struct type *type);
  21. extern std::string target_float_to_string (const gdb_byte *addr,
  22. const struct type *type,
  23. const char *format = nullptr);
  24. extern bool target_float_from_string (gdb_byte *addr,
  25. const struct type *type,
  26. const std::string &string);
  27. extern LONGEST target_float_to_longest (const gdb_byte *addr,
  28. const struct type *type);
  29. extern void target_float_from_longest (gdb_byte *addr,
  30. const struct type *type,
  31. LONGEST val);
  32. extern void target_float_from_ulongest (gdb_byte *addr,
  33. const struct type *type,
  34. ULONGEST val);
  35. extern double target_float_to_host_double (const gdb_byte *addr,
  36. const struct type *type);
  37. extern void target_float_from_host_double (gdb_byte *addr,
  38. const struct type *type,
  39. double val);
  40. extern void target_float_convert (const gdb_byte *from,
  41. const struct type *from_type,
  42. gdb_byte *to, const struct type *to_type);
  43. extern void target_float_binop (enum exp_opcode opcode,
  44. const gdb_byte *x, const struct type *type_x,
  45. const gdb_byte *y, const struct type *type_y,
  46. gdb_byte *res, const struct type *type_res);
  47. extern int target_float_compare (const gdb_byte *x, const struct type *type_x,
  48. const gdb_byte *y, const struct type *type_y);
  49. #endif /* TARGET_FLOAT_H */