diff options
author | Richard Sandiford <richard.sandiford@linaro.org> | 2017-08-30 11:19:47 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2017-08-30 11:19:47 +0000 |
commit | 79052416a684cde121a3f70619c2eb12371be67a (patch) | |
tree | a08db0758c2391ecccdffb242e712fba7c8e4d8e /gcc/fixed-value.c | |
parent | db61b7f923b769142156eab047c94b04bb7adaae (diff) | |
download | gcc-79052416a684cde121a3f70619c2eb12371be67a.zip gcc-79052416a684cde121a3f70619c2eb12371be67a.tar.gz gcc-79052416a684cde121a3f70619c2eb12371be67a.tar.bz2 |
[67/77] Use scalar_mode in fixed-value.*
This patch makes the fixed-value.* routines use scalar_mode.
It would be possible to define special classes for these modes, as for
scalar_int_mode and scalar_float_mode, but at the moment nothing would
benefit from them. In particular, there's no use case that would help
select between one class for all fixed-point modes versus one class for
fractional modes and one class for accumulator modes.
2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
Alan Hayward <alan.hayward@arm.com>
David Sherwood <david.sherwood@arm.com>
gcc/
* fixed-value.h (fixed_from_double_int): Take a scalar_mode
rather than a machine_mode.
(fixed_from_string): Likewise.
(fixed_convert): Likewise.
(fixed_convert_from_int): Likewise.
(fixed_convert_from_real): Likewise.
(real_convert_from_fixed): Likewise.
* fixed-value.c (fixed_from_double_int): Likewise.
(fixed_from_string): Likewise.
(fixed_convert): Likewise.
(fixed_convert_from_int): Likewise.
(fixed_convert_from_real): Likewise.
(real_convert_from_fixed): Likewise.
* config/avr/avr.c (avr_out_round): Use as_a <scalar_mode>.
Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
Co-Authored-By: David Sherwood <david.sherwood@arm.com>
From-SVN: r251518
Diffstat (limited to 'gcc/fixed-value.c')
-rw-r--r-- | gcc/fixed-value.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/gcc/fixed-value.c b/gcc/fixed-value.c index 3cd44dd..3c92453 100644 --- a/gcc/fixed-value.c +++ b/gcc/fixed-value.c @@ -86,7 +86,7 @@ check_real_for_fixed_mode (REAL_VALUE_TYPE *real_value, machine_mode mode) The bits in PAYLOAD are sign-extended/zero-extended according to MODE. */ FIXED_VALUE_TYPE -fixed_from_double_int (double_int payload, machine_mode mode) +fixed_from_double_int (double_int payload, scalar_mode mode) { FIXED_VALUE_TYPE value; @@ -108,7 +108,7 @@ fixed_from_double_int (double_int payload, machine_mode mode) /* Initialize from a decimal or hexadecimal string. */ void -fixed_from_string (FIXED_VALUE_TYPE *f, const char *str, machine_mode mode) +fixed_from_string (FIXED_VALUE_TYPE *f, const char *str, scalar_mode mode) { REAL_VALUE_TYPE real_value, fixed_value, base_value; unsigned int fbit; @@ -803,7 +803,7 @@ fixed_compare (int icode, const FIXED_VALUE_TYPE *op0, Return true, if !SAT_P and overflow. */ bool -fixed_convert (FIXED_VALUE_TYPE *f, machine_mode mode, +fixed_convert (FIXED_VALUE_TYPE *f, scalar_mode mode, const FIXED_VALUE_TYPE *a, bool sat_p) { bool overflow_p = false; @@ -947,7 +947,7 @@ fixed_convert (FIXED_VALUE_TYPE *f, machine_mode mode, Return true, if !SAT_P and overflow. */ bool -fixed_convert_from_int (FIXED_VALUE_TYPE *f, machine_mode mode, +fixed_convert_from_int (FIXED_VALUE_TYPE *f, scalar_mode mode, double_int a, bool unsigned_p, bool sat_p) { bool overflow_p = false; @@ -1031,7 +1031,7 @@ fixed_convert_from_int (FIXED_VALUE_TYPE *f, machine_mode mode, Return true, if !SAT_P and overflow. */ bool -fixed_convert_from_real (FIXED_VALUE_TYPE *f, machine_mode mode, +fixed_convert_from_real (FIXED_VALUE_TYPE *f, scalar_mode mode, const REAL_VALUE_TYPE *a, bool sat_p) { bool overflow_p = false; @@ -1090,7 +1090,7 @@ fixed_convert_from_real (FIXED_VALUE_TYPE *f, machine_mode mode, /* Convert to a new real mode from a fixed-point. */ void -real_convert_from_fixed (REAL_VALUE_TYPE *r, machine_mode mode, +real_convert_from_fixed (REAL_VALUE_TYPE *r, scalar_mode mode, const FIXED_VALUE_TYPE *f) { REAL_VALUE_TYPE base_value, fixed_value, real_value; |