aboutsummaryrefslogtreecommitdiff
path: root/gcc/dfp.h
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2015-10-30 13:45:42 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2015-10-30 13:45:42 +0000
commitf16e6077eaecf7ace56ff9f0147c9854f93d77e1 (patch)
tree2563ff48cbf908942137b14e5b91dba9144ee3c9 /gcc/dfp.h
parent4ff7defd046ca231a35c93b4000962b37ccad31c (diff)
downloadgcc-f16e6077eaecf7ace56ff9f0147c9854f93d77e1.zip
gcc-f16e6077eaecf7ace56ff9f0147c9854f93d77e1.tar.gz
gcc-f16e6077eaecf7ace56ff9f0147c9854f93d77e1.tar.bz2
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. From-SVN: r229581
Diffstat (limited to 'gcc/dfp.h')
-rw-r--r--gcc/dfp.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/dfp.h b/gcc/dfp.h
index 013de8b..a3653c9 100644
--- a/gcc/dfp.h
+++ b/gcc/dfp.h
@@ -34,7 +34,8 @@ void encode_decimal128 (const struct real_format *fmt, long *, const REAL_VALUE_
int decimal_do_compare (const REAL_VALUE_TYPE *, const REAL_VALUE_TYPE *, int);
void decimal_real_from_string (REAL_VALUE_TYPE *, const char *);
void decimal_round_for_format (const struct real_format *, REAL_VALUE_TYPE *);
-void decimal_real_convert (REAL_VALUE_TYPE *, machine_mode, const REAL_VALUE_TYPE *);
+void decimal_real_convert (REAL_VALUE_TYPE *, const real_format *,
+ const REAL_VALUE_TYPE *);
void decimal_real_to_decimal (char *, const REAL_VALUE_TYPE *, size_t, size_t, int);
void decimal_do_fix_trunc (REAL_VALUE_TYPE *, const REAL_VALUE_TYPE *);
void decimal_real_maxval (REAL_VALUE_TYPE *, int, machine_mode);