diff options
author | Richard Sandiford <richard.sandiford@linaro.org> | 2017-08-30 11:19:08 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2017-08-30 11:19:08 +0000 |
commit | 90970acd061f18e5e97162a36b92555ad162ed34 (patch) | |
tree | 8c7c40e3f29c6df23347ac91df8c5aa0f8fa17c3 /gcc/expmed.c | |
parent | 095a2d76a26fa4ee17fa56bff21bf4f269db2368 (diff) | |
download | gcc-90970acd061f18e5e97162a36b92555ad162ed34.zip gcc-90970acd061f18e5e97162a36b92555ad162ed34.tar.gz gcc-90970acd061f18e5e97162a36b92555ad162ed34.tar.bz2 |
[63/77] Simplifications after type switch
This patch makes a few simplifications after the previous
mechanical machine_mode->scalar_int_mode change.
2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
Alan Hayward <alan.hayward@arm.com>
David Sherwood <david.sherwood@arm.com>
gcc/
* expmed.c (extract_high_half): Use scalar_int_mode and remove
assertion.
(expmed_mult_highpart_optab): Likewise.
(expmed_mult_highpart): Likewise.
Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
Co-Authored-By: David Sherwood <david.sherwood@arm.com>
From-SVN: r251514
Diffstat (limited to 'gcc/expmed.c')
-rw-r--r-- | gcc/expmed.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/gcc/expmed.c b/gcc/expmed.c index 5873df4..10cf59c 100644 --- a/gcc/expmed.c +++ b/gcc/expmed.c @@ -3672,14 +3672,11 @@ expand_mult_highpart_adjust (scalar_int_mode mode, rtx adj_operand, rtx op0, static rtx extract_high_half (scalar_int_mode mode, rtx op) { - machine_mode wider_mode; - if (mode == word_mode) return gen_highpart (mode, op); - gcc_assert (!SCALAR_FLOAT_MODE_P (mode)); + scalar_int_mode wider_mode = GET_MODE_WIDER_MODE (mode).require (); - wider_mode = GET_MODE_WIDER_MODE (mode).require (); op = expand_shift (RSHIFT_EXPR, wider_mode, op, GET_MODE_BITSIZE (mode), 0, 1); return convert_modes (mode, wider_mode, op, 0); @@ -3693,15 +3690,13 @@ expmed_mult_highpart_optab (scalar_int_mode mode, rtx op0, rtx op1, rtx target, int unsignedp, int max_cost) { rtx narrow_op1 = gen_int_mode (INTVAL (op1), mode); - machine_mode wider_mode; optab moptab; rtx tem; int size; bool speed = optimize_insn_for_speed_p (); - gcc_assert (!SCALAR_FLOAT_MODE_P (mode)); + scalar_int_mode wider_mode = GET_MODE_WIDER_MODE (mode).require (); - wider_mode = GET_MODE_WIDER_MODE (mode).require (); size = GET_MODE_BITSIZE (mode); /* Firstly, try using a multiplication insn that only generates the needed @@ -3807,7 +3802,6 @@ static rtx expmed_mult_highpart (scalar_int_mode mode, rtx op0, rtx op1, rtx target, int unsignedp, int max_cost) { - machine_mode wider_mode = GET_MODE_WIDER_MODE (mode).require (); unsigned HOST_WIDE_INT cnst1; int extra_cost; bool sign_adjust = false; @@ -3816,7 +3810,6 @@ expmed_mult_highpart (scalar_int_mode mode, rtx op0, rtx op1, rtx tem; bool speed = optimize_insn_for_speed_p (); - gcc_assert (!SCALAR_FLOAT_MODE_P (mode)); /* We can't support modes wider than HOST_BITS_PER_INT. */ gcc_assert (HWI_COMPUTABLE_MODE_P (mode)); @@ -3826,6 +3819,7 @@ expmed_mult_highpart (scalar_int_mode mode, rtx op0, rtx op1, ??? We might be able to perform double-word arithmetic if mode == word_mode, however all the cost calculations in synth_mult etc. assume single-word operations. */ + scalar_int_mode wider_mode = GET_MODE_WIDER_MODE (mode).require (); if (GET_MODE_BITSIZE (wider_mode) > BITS_PER_WORD) return expmed_mult_highpart_optab (mode, op0, op1, target, unsignedp, max_cost); |