summaryrefslogtreecommitdiff
path: root/gcc/expmed.c
diff options
context:
space:
mode:
authormrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4>2012-04-04 20:27:17 +0000
committermrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4>2012-04-04 20:27:17 +0000
commitdb20fb4785ee648ca9ff51a2530bf5d1e9d06427 (patch)
treedbe6160ad6febabb7998df1b736a4d686b578623 /gcc/expmed.c
parentf450da21479a2fae2c1acab5409a603541fca144 (diff)
downloadgcc-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/expmed.c')
-rw-r--r--gcc/expmed.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/expmed.c b/gcc/expmed.c
index 5eea2ab8b51..aa24fbf630b 100644
--- a/gcc/expmed.c
+++ b/gcc/expmed.c
@@ -3139,8 +3139,10 @@ expand_mult (enum machine_mode mode, rtx op0, rtx op1, rtx target,
{
int shift = floor_log2 (CONST_DOUBLE_HIGH (op1))
+ HOST_BITS_PER_WIDE_INT;
- return expand_shift (LSHIFT_EXPR, mode, op0,
- shift, target, unsignedp);
+ if (shift < 2 * HOST_BITS_PER_WIDE_INT - 1
+ || GET_MODE_BITSIZE (mode) <= 2 * HOST_BITS_PER_WIDE_INT)
+ return expand_shift (LSHIFT_EXPR, mode, op0,
+ shift, target, unsignedp);
}
}