xref: /netbsd-src/external/gpl3/gdb.old/dist/gdb/target-float.h (revision 6881a4007f077b54e5f51159c52b9b25f57deb0d)
17f2ac410Schristos /* Floating point definitions for GDB.
27f2ac410Schristos 
3*6881a400Schristos    Copyright (C) 1986-2023 Free Software Foundation, Inc.
47f2ac410Schristos 
57f2ac410Schristos    This file is part of GDB.
67f2ac410Schristos 
77f2ac410Schristos    This program is free software; you can redistribute it and/or modify
87f2ac410Schristos    it under the terms of the GNU General Public License as published by
97f2ac410Schristos    the Free Software Foundation; either version 3 of the License, or
107f2ac410Schristos    (at your option) any later version.
117f2ac410Schristos 
127f2ac410Schristos    This program is distributed in the hope that it will be useful,
137f2ac410Schristos    but WITHOUT ANY WARRANTY; without even the implied warranty of
147f2ac410Schristos    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
157f2ac410Schristos    GNU General Public License for more details.
167f2ac410Schristos 
177f2ac410Schristos    You should have received a copy of the GNU General Public License
187f2ac410Schristos    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
197f2ac410Schristos 
207f2ac410Schristos #ifndef TARGET_FLOAT_H
217f2ac410Schristos #define TARGET_FLOAT_H
227f2ac410Schristos 
237f2ac410Schristos #include "expression.h"
247f2ac410Schristos 
257f2ac410Schristos extern bool target_float_is_valid (const gdb_byte *addr,
267f2ac410Schristos 				   const struct type *type);
277f2ac410Schristos extern bool target_float_is_zero (const gdb_byte *addr,
287f2ac410Schristos 				  const struct type *type);
297f2ac410Schristos 
307f2ac410Schristos extern std::string target_float_to_string (const gdb_byte *addr,
317f2ac410Schristos 					   const struct type *type,
327f2ac410Schristos 					   const char *format = nullptr);
337f2ac410Schristos extern bool target_float_from_string (gdb_byte *addr,
347f2ac410Schristos 				      const struct type *type,
357f2ac410Schristos 				      const std::string &string);
367f2ac410Schristos 
377f2ac410Schristos extern LONGEST target_float_to_longest (const gdb_byte *addr,
387f2ac410Schristos 					const struct type *type);
397f2ac410Schristos extern void target_float_from_longest (gdb_byte *addr,
407f2ac410Schristos 				       const struct type *type,
417f2ac410Schristos 				       LONGEST val);
427f2ac410Schristos extern void target_float_from_ulongest (gdb_byte *addr,
437f2ac410Schristos 					const struct type *type,
447f2ac410Schristos 					ULONGEST val);
457f2ac410Schristos extern double target_float_to_host_double (const gdb_byte *addr,
467f2ac410Schristos 					   const struct type *type);
477f2ac410Schristos extern void target_float_from_host_double (gdb_byte *addr,
487f2ac410Schristos 					   const struct type *type,
497f2ac410Schristos 					   double val);
507f2ac410Schristos extern void target_float_convert (const gdb_byte *from,
517f2ac410Schristos 				  const struct type *from_type,
527f2ac410Schristos 				  gdb_byte *to, const struct type *to_type);
537f2ac410Schristos 
547f2ac410Schristos extern void target_float_binop (enum exp_opcode opcode,
557f2ac410Schristos 				const gdb_byte *x, const struct type *type_x,
567f2ac410Schristos 				const gdb_byte *y, const struct type *type_y,
577f2ac410Schristos 				gdb_byte *res, const struct type *type_res);
587f2ac410Schristos extern int target_float_compare (const gdb_byte *x, const struct type *type_x,
597f2ac410Schristos 				 const gdb_byte *y, const struct type *type_y);
607f2ac410Schristos 
617f2ac410Schristos #endif /* TARGET_FLOAT_H */
62