diff options
author | mrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-04-04 20:27:17 +0000 |
---|---|---|
committer | mrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-04-04 20:27:17 +0000 |
commit | db20fb4785ee648ca9ff51a2530bf5d1e9d06427 (patch) | |
tree | dbe6160ad6febabb7998df1b736a4d686b578623 /gcc/emit-rtl.c | |
parent | f450da21479a2fae2c1acab5409a603541fca144 (diff) | |
download | gcc-db20fb4785ee648ca9ff51a2530bf5d1e9d06427.tar.gz |
* doc/rtl.texi (const_double): Document as sign-extending.
* expmed.c (expand_mult): Ensure we don't use shift
incorrectly.
* emit-rtl.c (immed_double_int_const): Refine to state the
value is signed.
* simplify-rtx.c (mode_signbit_p): Add a fixme for wider than
CONST_DOUBLE integers.
(simplify_const_unary_operation, UNSIGNED_FLOAT): Ensure no
negative values are converted. Fix conversions bigger than
HOST_BITS_PER_WIDE_INT.
(simplify_binary_operation_1): Ensure we don't use shift
incorrectly.
(simplify_immed_subreg): Sign-extend CONST_DOUBLEs.
* explow.c (plus_constant_mode): Add.
(plus_constant): Implement with plus_constant_mode.
* rtl.h (plus_constant_mode): Add.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186147 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/emit-rtl.c')
-rw-r--r-- | gcc/emit-rtl.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index 4f809820b78..8d7d4417d59 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -517,8 +517,11 @@ immed_double_int_const (double_int i, enum machine_mode mode) /* Return a CONST_DOUBLE or CONST_INT for a value specified as a pair of ints: I0 is the low-order word and I1 is the high-order word. - Do not use this routine for non-integer modes; convert to - REAL_VALUE_TYPE and use CONST_DOUBLE_FROM_REAL_VALUE. */ + For values that are larger than 2*HOST_BITS_PER_WIDE_INT, the + implied upper bits are copies of the high bit of i1. The value + itself is neither signed nor unsigned. Do not use this routine for + non-integer modes; convert to REAL_VALUE_TYPE and use + CONST_DOUBLE_FROM_REAL_VALUE. */ rtx immed_double_const (HOST_WIDE_INT i0, HOST_WIDE_INT i1, enum machine_mode mode) @@ -531,10 +534,9 @@ immed_double_const (HOST_WIDE_INT i0, HOST_WIDE_INT i1, enum machine_mode mode) 1) If GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT, then we use gen_int_mode. - 2) GET_MODE_BITSIZE (mode) == 2 * HOST_BITS_PER_WIDE_INT, but the value of - the integer fits into HOST_WIDE_INT anyway (i.e., i1 consists only - from copies of the sign bit, and sign of i0 and i1 are the same), then - we return a CONST_INT for i0. + 2) If the value of the integer fits into HOST_WIDE_INT anyway + (i.e., i1 consists only from copies of the sign bit, and sign + of i0 and i1 are the same), then we return a CONST_INT for i0. 3) Otherwise, we create a CONST_DOUBLE for i0 and i1. */ if (mode != VOIDmode) { @@ -546,8 +548,6 @@ immed_double_const (HOST_WIDE_INT i0, HOST_WIDE_INT i1, enum machine_mode mode) if (GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT) return gen_int_mode (i0, mode); - - gcc_assert (GET_MODE_BITSIZE (mode) == 2 * HOST_BITS_PER_WIDE_INT); } /* If this integer fits in one word, return a CONST_INT. */ |