This is the mail archive of the gdb-testers@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Target FP: Add binop and compare routines to target-float.{c, h}


*** TEST RESULTS FOR COMMIT 66c02b9ed1eabf1d7981c0c27ec9fd3c17fc5d35 ***

Author: Ulrich Weigand <ulrich.weigand@de.ibm.com>
Branch: master
Commit: 66c02b9ed1eabf1d7981c0c27ec9fd3c17fc5d35

Target FP: Add binop and compare routines to target-float.{c,h}

This patch adds the following target floating-point routines:
 - target_float_binop
 - target_float_compare
which call the equivalent decimal_ routines to handle decimal FP,
and call helper routines that currently still go via DOUBLEST to
handle binary FP (derived from current valarith.c code).

These routines are used to handle both binary and decimal FP types
in scalar_binop, value_equal, and value_less, mostly following the
method currently used for decimal FP.  The existing value_args_as_decimal
helper is renamed to value_args_as_target_float and extended to handle
both binary and decimal types.

The unary operations value_pos and value_neg are also simplified,
the former by using a simple copy for all scalar types, the latter
by using value_binop (... BINOP_SUB) to implement negation as
subtraction from zero.

ChangeLog:
2017-11-06  Ulrich Weigand  <uweigand@de.ibm.com>

	* target-float.c: Include <math.h>.
	(floatformat_binop): New function.
	(floatformat_compare): Likewise.
	(target_float_binop): Likewise.
	(target_float_compare): Likewise.
	* target-float.h: Include "expression.h".
	(target_float_binop): Add prototype.
	(target_float_compare): Likewise.

	* valarith.c: Do not include "doublest.h" and "dfp.h".
	Include "common/byte-vector.h".
	(value_args_as_decimal): Remove, replace by ...
	(value_args_as_target_float): ... this function.  Handle both
	binary and decimal target floating-point formats.
	(scalar_binop): Handle both binary and decimal FP using
	value_args_as_target_float and target_float_binop.
	(value_equal): Handle both binary and decimal FP using
	value_args_as_target_float and target_float_compare.
	(value_less): Likewise.
	(value_pos): Handle all scalar types as simple copy.
	(value_neg): Handle all scalar types via BINOP_SUB from 0.
	* dfp.c (decimal_binop): Throw error instead of internal_error
	when called with an unsupported operation code.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]