GDB (xrefs)
|
#include "defs.h"
#include "gdbtypes.h"
#include "floatformat.h"
#include "target-float.h"
#include "gdbarch.h"
#include <cmath>
#include <limits>
#include <mpfr.h>
#include "dpd/decimal128.h"
#include "dpd/decimal64.h"
#include "dpd/decimal32.h"
Go to the source code of this file.
Classes | |
class | target_float_ops |
class | host_float_ops< T > |
struct | printf_length_modifier< T > |
struct | printf_length_modifier< long double > |
struct | scanf_length_modifier< T > |
struct | scanf_length_modifier< double > |
struct | scanf_length_modifier< long double > |
class | mpfr_float_ops |
class | mpfr_float_ops::gdb_mpfr |
class | decimal_float_ops |
Macros | |
#define | FLOATFORMAT_CHAR_BIT 8 |
#define | FLOATFORMAT_LARGEST_BYTES 16 |
#define | MPFR_USE_INTMAX_T |
#define | MAX_DECIMAL_STRING 43 |
#define | OPPOSITE_BYTE_ORDER BFD_ENDIAN_BIG |
Enumerations | |
enum | float_kind { float_nan , float_infinite , float_zero , float_normal , float_subnormal } |
enum | target_float_ops_kind { host_float = 0 , host_double , host_long_double , binary , decimal } |
Functions | |
static size_t | floatformat_totalsize_bytes (const struct floatformat *fmt) |
static int | floatformat_precision (const struct floatformat *fmt) |
static enum floatformat_byteorders | floatformat_normalize_byteorder (const struct floatformat *fmt, const void *from, void *to) |
static unsigned long | get_field (const bfd_byte *data, enum floatformat_byteorders order, unsigned int total_len, unsigned int start, unsigned int len) |
static void | put_field (unsigned char *data, enum floatformat_byteorders order, unsigned int total_len, unsigned int start, unsigned int len, unsigned long stuff_to_put) |
static int | floatformat_is_negative (const struct floatformat *fmt, const bfd_byte *uval) |
static enum float_kind | floatformat_classify (const struct floatformat *fmt, const bfd_byte *uval) |
static const char * | floatformat_mantissa (const struct floatformat *fmt, const bfd_byte *val) |
static std::string | floatformat_printf_format (const struct floatformat *fmt, const char *format, char length) |
static void | match_endianness (const gdb_byte *from, const struct type *type, gdb_byte *to) |
static void | set_decnumber_context (decContext *ctx, const struct type *type) |
static void | decimal_check_errors (decContext *ctx) |
static void | decimal_from_number (const decNumber *from, gdb_byte *to, const struct type *type) |
static void | decimal_to_number (const gdb_byte *addr, const struct type *type, decNumber *to) |
static bool | decimal_is_zero (const gdb_byte *addr, const struct type *type) |
static bool | target_float_same_category_p (const struct type *type1, const struct type *type2) |
static bool | target_float_same_format_p (const struct type *type1, const struct type *type2) |
static int | target_float_format_length (const struct type *type) |
static enum target_float_ops_kind | get_target_float_ops_kind (const struct type *type) |
static const target_float_ops * | get_target_float_ops (enum target_float_ops_kind kind) |
static const target_float_ops * | get_target_float_ops (const struct type *type) |
static const target_float_ops * | get_target_float_ops (const struct type *type1, const struct type *type2) |
bool | target_float_is_valid (const gdb_byte *addr, const struct type *type) |
bool | target_float_is_zero (const gdb_byte *addr, const struct type *type) |
std::string | target_float_to_string (const gdb_byte *addr, const struct type *type, const char *format) |
bool | target_float_from_string (gdb_byte *addr, const struct type *type, const std::string &string) |
LONGEST | target_float_to_longest (const gdb_byte *addr, const struct type *type) |
void | target_float_from_longest (gdb_byte *addr, const struct type *type, LONGEST val) |
void | target_float_from_ulongest (gdb_byte *addr, const struct type *type, ULONGEST val) |
double | target_float_to_host_double (const gdb_byte *addr, const struct type *type) |
void | target_float_from_host_double (gdb_byte *addr, const struct type *type, double val) |
void | target_float_convert (const gdb_byte *from, const struct type *from_type, gdb_byte *to, const struct type *to_type) |
void | target_float_binop (enum exp_opcode opcode, const gdb_byte *x, const struct type *type_x, const gdb_byte *y, const struct type *type_y, gdb_byte *res, const struct type *type_res) |
int | target_float_compare (const gdb_byte *x, const struct type *type_x, const gdb_byte *y, const struct type *type_y) |
Variables | |
static const struct floatformat * | host_float_format = GDB_HOST_FLOAT_FORMAT |
static const struct floatformat * | host_double_format = GDB_HOST_DOUBLE_FORMAT |
static const struct floatformat * | host_long_double_format = GDB_HOST_LONG_DOUBLE_FORMAT |
#define FLOATFORMAT_CHAR_BIT 8 |
Definition at line 83 of file target-float.c.
Referenced by floatformat_classify(), floatformat_is_negative(), floatformat_mantissa(), floatformat_normalize_byteorder(), floatformat_totalsize_bytes(), mpfr_float_ops::from_target(), host_float_ops< T >::from_target(), get_field(), put_field(), mpfr_float_ops::to_target(), and host_float_ops< T >::to_target().
#define FLOATFORMAT_LARGEST_BYTES 16 |
Definition at line 87 of file target-float.c.
Referenced by floatformat_classify(), floatformat_is_negative(), floatformat_mantissa(), mpfr_float_ops::from_target(), host_float_ops< T >::from_target(), mpfr_float_ops::to_target(), and host_float_ops< T >::to_target().
#define MAX_DECIMAL_STRING 43 |
Definition at line 1733 of file target-float.c.
Referenced by decimal_float_ops::to_string().
#define MPFR_USE_INTMAX_T |
Definition at line 1159 of file target-float.c.
#define OPPOSITE_BYTE_ORDER BFD_ENDIAN_BIG |
enum float_kind |
Enumerator | |
---|---|
float_nan | |
float_infinite | |
float_zero | |
float_normal | |
float_subnormal |
Definition at line 72 of file target-float.c.
Enumerator | |
---|---|
host_float | |
host_double | |
host_long_double | |
binary | |
decimal |
Definition at line 2187 of file target-float.c.
|
static |
Definition at line 1787 of file target-float.c.
Referenced by decimal_float_ops::binop(), decimal_float_ops::compare(), and decimal_float_ops::from_string().
|
static |
Definition at line 1806 of file target-float.c.
References type::length(), match_endianness(), and set_decnumber_context().
Referenced by decimal_float_ops::binop(), decimal_float_ops::convert(), decimal_float_ops::from_longest(), and decimal_float_ops::from_ulongest().
|
static |
Definition at line 1862 of file target-float.c.
References decimal_to_number().
Referenced by target_float_is_zero().
|
static |
Definition at line 1837 of file target-float.c.
References type::length(), and match_endianness().
Referenced by decimal_float_ops::binop(), decimal_float_ops::compare(), decimal_float_ops::convert(), and decimal_is_zero().
|
static |
Definition at line 325 of file target-float.c.
References float_infinite, float_nan, float_normal, float_subnormal, float_zero, FLOATFORMAT_CHAR_BIT, FLOATFORMAT_LARGEST_BYTES, floatformat_normalize_byteorder(), and get_field().
Referenced by mpfr_float_ops::from_target(), host_float_ops< T >::from_target(), target_float_is_zero(), target_float_to_string(), and mpfr_float_ops::to_string().
|
static |
Definition at line 300 of file target-float.c.
References FLOATFORMAT_CHAR_BIT, FLOATFORMAT_LARGEST_BYTES, floatformat_normalize_byteorder(), and get_field().
Referenced by mpfr_float_ops::from_target(), target_float_to_string(), and mpfr_float_ops::to_string().
|
static |
Definition at line 413 of file target-float.c.
References FLOATFORMAT_CHAR_BIT, FLOATFORMAT_LARGEST_BYTES, floatformat_normalize_byteorder(), and get_field().
Referenced by target_float_to_string(), and mpfr_float_ops::to_string().
|
static |
Definition at line 119 of file target-float.c.
References FLOATFORMAT_CHAR_BIT.
Referenced by floatformat_classify(), floatformat_is_negative(), floatformat_mantissa(), mpfr_float_ops::from_target(), host_float_ops< T >::from_target(), mpfr_float_ops::to_target(), and host_float_ops< T >::to_target().
|
static |
Definition at line 99 of file target-float.c.
References floatformat_precision().
Referenced by floatformat_precision(), floatformat_printf_format(), and mpfr_float_ops::gdb_mpfr::gdb_mpfr().
|
static |
Definition at line 483 of file target-float.c.
References floatformat_precision().
Referenced by host_float_ops< T >::to_string(), and mpfr_float_ops::to_string().
|
static |
Definition at line 91 of file target-float.c.
References FLOATFORMAT_CHAR_BIT.
Referenced by host_float_ops< T >::from_target(), target_float_format_length(), mpfr_float_ops::to_target(), and host_float_ops< T >::to_target().
|
static |
Definition at line 169 of file target-float.c.
References FLOATFORMAT_CHAR_BIT.
Referenced by floatformat_classify(), floatformat_is_negative(), floatformat_mantissa(), mpfr_float_ops::from_target(), and host_float_ops< T >::from_target().
|
static |
Definition at line 2285 of file target-float.c.
References get_target_float_ops(), and get_target_float_ops_kind().
|
static |
Definition at line 2293 of file target-float.c.
References type::code(), get_target_float_ops(), and get_target_float_ops_kind().
|
static |
Definition at line 2235 of file target-float.c.
References binary, decimal, host_double, host_float, and host_long_double.
Referenced by get_target_float_ops(), get_target_float_ops(), target_float_binop(), target_float_compare(), target_float_convert(), target_float_from_host_double(), target_float_from_longest(), target_float_from_string(), target_float_from_ulongest(), target_float_to_host_double(), target_float_to_longest(), and target_float_to_string().
|
static |
Definition at line 2202 of file target-float.c.
References binary, type::code(), decimal, floatformat_from_type(), host_double, host_double_format, host_float, host_float_format, host_long_double, and host_long_double_format.
Referenced by get_target_float_ops(), and get_target_float_ops().
|
static |
Definition at line 1739 of file target-float.c.
References type::code(), type::length(), OPPOSITE_BYTE_ORDER, and type_byte_order().
Referenced by decimal_from_number(), decimal_to_number(), decimal_float_ops::from_string(), and decimal_float_ops::to_string().
|
static |
Definition at line 236 of file target-float.c.
References FLOATFORMAT_CHAR_BIT.
Referenced by mpfr_float_ops::to_target(), and host_float_ops< T >::to_target().
|
static |
Definition at line 1765 of file target-float.c.
References type::code(), and type::length().
Referenced by decimal_float_ops::binop(), decimal_float_ops::compare(), decimal_from_number(), and decimal_float_ops::from_string().
void target_float_binop | ( | enum exp_opcode | opcode, |
const gdb_byte * | x, | ||
const struct type * | type_x, | ||
const gdb_byte * | y, | ||
const struct type * | type_y, | ||
gdb_byte * | res, | ||
const struct type * | type_res ) |
Definition at line 2467 of file target-float.c.
References target_float_ops::binop(), get_target_float_ops(), and target_float_same_category_p().
Referenced by scalar_binop().
int target_float_compare | ( | const gdb_byte * | x, |
const struct type * | type_x, | ||
const gdb_byte * | y, | ||
const struct type * | type_y ) |
Definition at line 2487 of file target-float.c.
References target_float_ops::compare(), get_target_float_ops(), and target_float_same_category_p().
Referenced by value_equal(), and value_less().
void target_float_convert | ( | const gdb_byte * | from, |
const struct type * | from_type, | ||
gdb_byte * | to, | ||
const struct type * | to_type ) |
Definition at line 2432 of file target-float.c.
References target_float_ops::convert(), get_target_float_ops(), type::length(), target_float_format_length(), target_float_from_string(), target_float_same_category_p(), target_float_same_format_p(), and target_float_to_string().
Referenced by arm_extract_return_value(), arm_store_return_value(), do_ppc_sysv_return_value(), i386_extract_return_value(), i386_store_return_value(), i387_register_to_value(), i387_value_to_register(), ia64_extract_return_value(), ia64_push_dummy_call(), ia64_register_to_value(), ia64_store_return_value(), ia64_value_to_register(), m68k_register_to_value(), m68k_svr4_extract_return_value(), m68k_svr4_store_return_value(), m68k_value_to_register(), ppc64_sysv_abi_push_freg(), ppc64_sysv_abi_return_value_base(), ppc_sysv_abi_push_dummy_call(), rs6000_lynx178_push_dummy_call(), rs6000_lynx178_return_value(), rs6000_push_dummy_call(), rs6000_register_to_value(), rs6000_return_value(), sh_register_convert_to_raw(), sh_register_convert_to_virtual(), and value_cast().
|
static |
Definition at line 2170 of file target-float.c.
References type::code(), floatformat_from_type(), floatformat_totalsize_bytes(), and type::length().
Referenced by target_float_convert().
void target_float_from_host_double | ( | gdb_byte * | addr, |
const struct type * | type, | ||
double | val ) |
Definition at line 2421 of file target-float.c.
References target_float_ops::from_host_double(), and get_target_float_ops().
Referenced by value_cast(), value_from_host_double(), and yyparse().
void target_float_from_longest | ( | gdb_byte * | addr, |
const struct type * | type, | ||
LONGEST | val ) |
Definition at line 2391 of file target-float.c.
References target_float_ops::from_longest(), and get_target_float_ops().
Referenced by pack_long(), and value_args_as_target_float().
bool target_float_from_string | ( | gdb_byte * | addr, |
const struct type * | type, | ||
const std::string & | string ) |
Definition at line 2372 of file target-float.c.
References target_float_ops::from_string(), and get_target_float_ops().
Referenced by define_symbol(), parse_float(), selftests::register_to_value_test(), and target_float_convert().
void target_float_from_ulongest | ( | gdb_byte * | addr, |
const struct type * | type, | ||
ULONGEST | val ) |
Definition at line 2401 of file target-float.c.
References target_float_ops::from_ulongest(), and get_target_float_ops().
Referenced by pack_unsigned_long(), and value_args_as_target_float().
bool target_float_is_valid | ( | const gdb_byte * | addr, |
const struct type * | type ) |
Definition at line 2308 of file target-float.c.
References type::code(), and floatformat_from_type().
Referenced by is_floating_value().
bool target_float_is_zero | ( | const gdb_byte * | addr, |
const struct type * | type ) |
Definition at line 2322 of file target-float.c.
References type::code(), decimal_is_zero(), float_zero, floatformat_classify(), and floatformat_from_type().
Referenced by valpy_nonzero(), and value_logical_not().
|
static |
Definition at line 2138 of file target-float.c.
References type::code().
Referenced by target_float_binop(), target_float_compare(), target_float_convert(), and target_float_same_format_p().
|
static |
Definition at line 2146 of file target-float.c.
References type::code(), floatformat_from_type(), type::length(), target_float_same_category_p(), and type_byte_order().
Referenced by target_float_convert().
double target_float_to_host_double | ( | const gdb_byte * | addr, |
const struct type * | type ) |
Definition at line 2411 of file target-float.c.
References get_target_float_ops(), and target_float_ops::to_host_double().
Referenced by eval_op_f_abs(), eval_op_f_mod(), eval_op_f_modulo(), fortran_ceil_operation(), fortran_floor_operation(), gdbscm_value_to_real(), valpy_float(), and value_to_gdb_mpq().
LONGEST target_float_to_longest | ( | const gdb_byte * | addr, |
const struct type * | type ) |
Definition at line 2382 of file target-float.c.
References get_target_float_ops(), and target_float_ops::to_longest().
Referenced by unpack_long().
std::string target_float_to_string | ( | const gdb_byte * | addr, |
const struct type * | type, | ||
const char * | format ) |
Definition at line 2337 of file target-float.c.
References type::code(), float_infinite, float_nan, floatformat_classify(), floatformat_from_type(), floatformat_is_negative(), floatformat_mantissa(), get_target_float_ops(), and target_float_ops::to_string().
Referenced by mips_print_fp_register(), print_floating(), print_i387_value(), printf_floating(), and target_float_convert().
|
static |
Definition at line 592 of file target-float.c.
Referenced by host_float_ops< T >::from_target(), get_target_float_ops_kind(), and host_float_ops< T >::to_target().
|
static |
Definition at line 591 of file target-float.c.
Referenced by host_float_ops< T >::from_target(), get_target_float_ops_kind(), and host_float_ops< T >::to_target().
|
static |
Definition at line 593 of file target-float.c.
Referenced by host_float_ops< T >::from_target(), get_target_float_ops_kind(), and host_float_ops< T >::to_target().