Allow real_format to be passed to more real.h functions
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 30 Oct 2015 13:45:42 +0000 (13:45 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 30 Oct 2015 13:45:42 +0000 (13:45 +0000)
commitd55fadad346f18f1c931bde6be7b242b26cc2b08
tree2563ff48cbf908942137b14e5b91dba9144ee3c9
parent7d5736ebea3f27ef254c5748296d377674f83072
Allow real_format to be passed to more real.h functions

Most real.h routines used machine modes to specify the format of
an operation and converted that to a float_format * internally.
Some also had alternative versions that accepted a float_format *.

In an upcoming patch it seemed more convenient for the callers
I was adding to use float_format directly, since the callers need
to examine the format themselves for other reasons.  This patch
therefore replaces the machine_mode arguments with a new class that
allows both machine modes and float_format pointers to be used.

Tested on x86_64-linux-gnu, arm-linux-gnueabi and aarch64-linux-gnu.

gcc/
* real.h (format_helper): New.
(real_convert, exact_real_truncate, real_from_string3, real_to_target)
(real_from_target, real_nan, real_2expN, real_value_truncate)
(significand_size, real_from_string2, exact_real_inverse)
(exact_real_inverse, real_powi, real_trunc, real_floor, real_ceil)
(real_round, real_isinteger, real_from_integer): Replace
machine_mode arguments with format_helper arguments.
* real.c (exact_real_inverse, real_from_string2, real_from_string3)
(real_from_integer, real_nan, real_2expN, real_convert)
(real_value_truncate, exact_real_truncate, real_to_target)
(real_from_target, significand_size, real_powi, real_trunc)
(real_floor, real_ceil, real_round, real_isinteger): Replace
machine_mode arguments with format_helper arguments.
(real_to_target_fmt, real_from_target_fmt): Delete.
* dfp.h (decimal_real_convert): Replace mode argument with real_format.
* dfp.c (decimal_to_binary, decimal_real_convert): Replace mode
argument with real_format.
* builtins.c (do_real_to_int_conversion): Update type of fn argument.

gcc/java/
* jcf-parse.c (get_constant): Use real_from_target rather than
real_from_target_fmt.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229581 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/builtins.c
gcc/dfp.c
gcc/dfp.h
gcc/java/ChangeLog
gcc/java/jcf-parse.c
gcc/real.c
gcc/real.h