arm.c (neon_element_bits, [...]): Call GET_MODE_INNER unconditionally.
gcc/ 2015-07-28 David Sherwood <david.sherwood@arm.com> * config/arm/arm.c (neon_element_bits, neon_valid_immediate): Call GET_MODE_INNER unconditionally. * config/spu/spu.c (arith_immediate_p): Likewise. * config/i386/i386.c (ix86_build_signbit_mask): Likewise. * expmed.c (synth_mult): Remove check for VOIDmode result from GET_MODE_INNER. (expand_mult_const): Likewise. * fold-const.c (fold_binary_loc): Replace call to element_precision with call to GET_MODE_PRECISION. * genmodes.c (emit_mode_inner_inline): Replace void_mode->name with m->name. (emit_mode_inner): Likewise. * lto-streamer-out.c (lto_write_mode_table): Update GET_MODE_INNER result check. * machmode.h (GET_MODE_UNIT_SIZE): Simplify. (GET_MODE_UNIT_PRECISION): Likewise. * rtlanal.c (subreg_get_info): Call GET_MODE_INNER unconditionally. * simplify-rtx.c (simplify_immed_subreg): Likewise. * stor-layout.c (bitwise_type_for_mode): Update assert. (element_precision): Remove. From-SVN: r226328
This commit is contained in:
parent
726858e309
commit
1c0e448f4b
|
@ -1,3 +1,26 @@
|
|||
2015-07-28 David Sherwood <david.sherwood@arm.com>
|
||||
|
||||
* config/arm/arm.c (neon_element_bits, neon_valid_immediate): Call
|
||||
GET_MODE_INNER unconditionally.
|
||||
* config/spu/spu.c (arith_immediate_p): Likewise.
|
||||
* config/i386/i386.c (ix86_build_signbit_mask): Likewise.
|
||||
* expmed.c (synth_mult): Remove check for VOIDmode result from
|
||||
GET_MODE_INNER.
|
||||
(expand_mult_const): Likewise.
|
||||
* fold-const.c (fold_binary_loc): Replace call to element_precision
|
||||
with call to GET_MODE_PRECISION.
|
||||
* genmodes.c (emit_mode_inner_inline): Replace void_mode->name with
|
||||
m->name.
|
||||
(emit_mode_inner): Likewise.
|
||||
* lto-streamer-out.c (lto_write_mode_table): Update GET_MODE_INNER
|
||||
result check.
|
||||
* machmode.h (GET_MODE_UNIT_SIZE): Simplify.
|
||||
(GET_MODE_UNIT_PRECISION): Likewise.
|
||||
* rtlanal.c (subreg_get_info): Call GET_MODE_INNER unconditionally.
|
||||
* simplify-rtx.c (simplify_immed_subreg): Likewise.
|
||||
* stor-layout.c (bitwise_type_for_mode): Update assert.
|
||||
(element_precision): Remove.
|
||||
|
||||
2015-07-28 Richard Sandiford <richard.sandiford@arm.com>
|
||||
|
||||
* target-insns.def (reload_load_address): New targetm instruction
|
||||
|
|
|
@ -12238,18 +12238,16 @@ neon_valid_immediate (rtx op, machine_mode mode, int inverse,
|
|||
bool vector = GET_CODE (op) == CONST_VECTOR;
|
||||
|
||||
if (vector)
|
||||
{
|
||||
n_elts = CONST_VECTOR_NUNITS (op);
|
||||
innersize = GET_MODE_SIZE (GET_MODE_INNER (mode));
|
||||
}
|
||||
n_elts = CONST_VECTOR_NUNITS (op);
|
||||
else
|
||||
{
|
||||
n_elts = 1;
|
||||
if (mode == VOIDmode)
|
||||
mode = DImode;
|
||||
innersize = GET_MODE_SIZE (mode);
|
||||
}
|
||||
|
||||
innersize = GET_MODE_SIZE (GET_MODE_INNER (mode));
|
||||
|
||||
/* Vectors of float constants. */
|
||||
if (GET_MODE_CLASS (mode) == MODE_VECTOR_FLOAT)
|
||||
{
|
||||
|
@ -12832,10 +12830,7 @@ neon_const_bounds (rtx operand, HOST_WIDE_INT low, HOST_WIDE_INT high)
|
|||
HOST_WIDE_INT
|
||||
neon_element_bits (machine_mode mode)
|
||||
{
|
||||
if (mode == DImode)
|
||||
return GET_MODE_BITSIZE (mode);
|
||||
else
|
||||
return GET_MODE_BITSIZE (GET_MODE_INNER (mode));
|
||||
return GET_MODE_BITSIZE (GET_MODE_INNER (mode));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -19599,7 +19599,6 @@ ix86_build_signbit_mask (machine_mode mode, bool vect, bool invert)
|
|||
case V8SFmode:
|
||||
case V4SFmode:
|
||||
vec_mode = mode;
|
||||
mode = GET_MODE_INNER (mode);
|
||||
imode = SImode;
|
||||
break;
|
||||
|
||||
|
@ -19610,7 +19609,6 @@ ix86_build_signbit_mask (machine_mode mode, bool vect, bool invert)
|
|||
case V4DFmode:
|
||||
case V2DFmode:
|
||||
vec_mode = mode;
|
||||
mode = GET_MODE_INNER (mode);
|
||||
imode = DImode;
|
||||
break;
|
||||
|
||||
|
@ -19624,17 +19622,18 @@ ix86_build_signbit_mask (machine_mode mode, bool vect, bool invert)
|
|||
gcc_unreachable ();
|
||||
}
|
||||
|
||||
w = wi::set_bit_in_zero (GET_MODE_BITSIZE (mode) - 1,
|
||||
GET_MODE_BITSIZE (mode));
|
||||
machine_mode inner_mode = GET_MODE_INNER (mode);
|
||||
w = wi::set_bit_in_zero (GET_MODE_BITSIZE (inner_mode) - 1,
|
||||
GET_MODE_BITSIZE (inner_mode));
|
||||
if (invert)
|
||||
w = wi::bit_not (w);
|
||||
|
||||
/* Force this value into the low part of a fp vector constant. */
|
||||
mask = immed_wide_int_const (w, imode);
|
||||
mask = gen_lowpart (mode, mask);
|
||||
mask = gen_lowpart (inner_mode, mask);
|
||||
|
||||
if (vec_mode == VOIDmode)
|
||||
return force_reg (mode, mask);
|
||||
return force_reg (inner_mode, mask);
|
||||
|
||||
v = ix86_build_const_vector (vec_mode, vect, mask);
|
||||
return force_reg (vec_mode, v);
|
||||
|
|
|
@ -3391,9 +3391,7 @@ arith_immediate_p (rtx op, machine_mode mode,
|
|||
|
||||
constant_to_array (mode, op, arr);
|
||||
|
||||
if (VECTOR_MODE_P (mode))
|
||||
mode = GET_MODE_INNER (mode);
|
||||
|
||||
mode = GET_MODE_INNER (mode);
|
||||
bytes = GET_MODE_SIZE (mode);
|
||||
mode = mode_for_size (GET_MODE_BITSIZE (mode), MODE_INT, 0);
|
||||
|
||||
|
|
|
@ -2427,8 +2427,6 @@ synth_mult (struct algorithm *alg_out, unsigned HOST_WIDE_INT t,
|
|||
|
||||
/* Be prepared for vector modes. */
|
||||
imode = GET_MODE_INNER (mode);
|
||||
if (imode == VOIDmode)
|
||||
imode = mode;
|
||||
|
||||
maxm = MIN (BITS_PER_WORD, GET_MODE_BITSIZE (imode));
|
||||
|
||||
|
@ -3088,8 +3086,6 @@ expand_mult_const (machine_mode mode, rtx op0, HOST_WIDE_INT val,
|
|||
/* Compare only the bits of val and val_so_far that are significant
|
||||
in the result mode, to avoid sign-/zero-extension confusion. */
|
||||
nmode = GET_MODE_INNER (mode);
|
||||
if (nmode == VOIDmode)
|
||||
nmode = mode;
|
||||
val &= GET_MODE_MASK (nmode);
|
||||
val_so_far &= GET_MODE_MASK (nmode);
|
||||
gcc_assert (val == val_so_far);
|
||||
|
|
|
@ -9421,7 +9421,7 @@ fold_binary_loc (location_t loc,
|
|||
/* Only create rotates in complete modes. Other cases are not
|
||||
expanded properly. */
|
||||
&& (element_precision (rtype)
|
||||
== element_precision (TYPE_MODE (rtype))))
|
||||
== GET_MODE_PRECISION (GET_MODE_INNER (TYPE_MODE (rtype)))))
|
||||
{
|
||||
tree tree01, tree11;
|
||||
enum tree_code code01, code11;
|
||||
|
|
|
@ -1039,7 +1039,7 @@ mode_inner_inline (machine_mode mode)\n\
|
|||
for_all_modes (c, m)
|
||||
printf (" case %smode: return %smode;\n", m->name,
|
||||
c != MODE_PARTIAL_INT && m->component
|
||||
? m->component->name : void_mode->name);
|
||||
? m->component->name : m->name);
|
||||
|
||||
puts ("\
|
||||
default: return mode_inner[mode];\n\
|
||||
|
@ -1338,7 +1338,7 @@ emit_mode_inner (void)
|
|||
for_all_modes (c, m)
|
||||
tagged_printf ("%smode",
|
||||
c != MODE_PARTIAL_INT && m->component
|
||||
? m->component->name : void_mode->name,
|
||||
? m->component->name : m->name,
|
||||
m->name);
|
||||
|
||||
print_closer ();
|
||||
|
|
|
@ -2682,7 +2682,7 @@ lto_write_mode_table (void)
|
|||
if (streamer_mode_table[i])
|
||||
{
|
||||
machine_mode m = (machine_mode) i;
|
||||
if (GET_MODE_INNER (m) != VOIDmode)
|
||||
if (GET_MODE_INNER (m) != m)
|
||||
streamer_mode_table[(int) GET_MODE_INNER (m)] = 1;
|
||||
}
|
||||
/* First stream modes that have GET_MODE_INNER (m) == VOIDmode,
|
||||
|
@ -2692,7 +2692,7 @@ lto_write_mode_table (void)
|
|||
if (streamer_mode_table[i] && i != (int) VOIDmode && i != (int) BLKmode)
|
||||
{
|
||||
machine_mode m = (machine_mode) i;
|
||||
if ((GET_MODE_INNER (m) == VOIDmode) ^ (pass == 0))
|
||||
if ((GET_MODE_INNER (m) == m) ^ (pass == 0))
|
||||
continue;
|
||||
bp_pack_value (&bp, m, 8);
|
||||
bp_pack_enum (&bp, mode_class, MAX_MODE_CLASS, GET_MODE_CLASS (m));
|
||||
|
|
|
@ -209,7 +209,9 @@ extern const unsigned HOST_WIDE_INT mode_mask_array[NUM_MACHINE_MODES];
|
|||
|
||||
#define GET_MODE_MASK(MODE) mode_mask_array[MODE]
|
||||
|
||||
/* Return the mode of the inner elements in a vector. */
|
||||
/* Return the mode of the basic parts of MODE. For vector modes this is the
|
||||
mode of the vector elements. For complex modes it is the mode of the real
|
||||
and imaginary parts. For other modes it is MODE itself. */
|
||||
|
||||
extern const unsigned char mode_inner[NUM_MACHINE_MODES];
|
||||
#if GCC_VERSION >= 4001
|
||||
|
@ -220,21 +222,15 @@ extern const unsigned char mode_inner[NUM_MACHINE_MODES];
|
|||
#define GET_MODE_INNER(MODE) ((machine_mode) mode_inner[MODE])
|
||||
#endif
|
||||
|
||||
/* Get the size in bytes or bites of the basic parts of an
|
||||
/* Get the size in bytes or bits of the basic parts of an
|
||||
object of mode MODE. */
|
||||
|
||||
#define GET_MODE_UNIT_SIZE(MODE) \
|
||||
(GET_MODE_INNER (MODE) == VOIDmode \
|
||||
? GET_MODE_SIZE (MODE) \
|
||||
: GET_MODE_SIZE (GET_MODE_INNER (MODE)))
|
||||
#define GET_MODE_UNIT_SIZE(MODE) GET_MODE_SIZE (GET_MODE_INNER (MODE))
|
||||
|
||||
#define GET_MODE_UNIT_BITSIZE(MODE) \
|
||||
((unsigned short) (GET_MODE_UNIT_SIZE (MODE) * BITS_PER_UNIT))
|
||||
|
||||
#define GET_MODE_UNIT_PRECISION(MODE) \
|
||||
(GET_MODE_INNER (MODE) == VOIDmode \
|
||||
? GET_MODE_PRECISION (MODE) \
|
||||
: GET_MODE_PRECISION (GET_MODE_INNER (MODE)))
|
||||
#define GET_MODE_UNIT_PRECISION(MODE) GET_MODE_PRECISION (GET_MODE_INNER (MODE))
|
||||
|
||||
/* Get the number of units in the object. */
|
||||
|
||||
|
@ -320,10 +316,6 @@ extern unsigned get_mode_alignment (machine_mode);
|
|||
|
||||
#define GET_MODE_ALIGNMENT(MODE) get_mode_alignment (MODE)
|
||||
|
||||
/* Get the precision of the mode or its inner mode if it has one. */
|
||||
|
||||
extern unsigned int element_precision (machine_mode);
|
||||
|
||||
/* For each class, get the narrowest mode in that class. */
|
||||
|
||||
extern const unsigned char class_narrowest_mode[MAX_MODE_CLASS];
|
||||
|
|
|
@ -3571,10 +3571,7 @@ subreg_get_info (unsigned int xregno, machine_mode xmode,
|
|||
machine_mode xmode_unit;
|
||||
|
||||
nregs_xmode = HARD_REGNO_NREGS_WITH_PADDING (xregno, xmode);
|
||||
if (GET_MODE_INNER (xmode) == VOIDmode)
|
||||
xmode_unit = xmode;
|
||||
else
|
||||
xmode_unit = GET_MODE_INNER (xmode);
|
||||
xmode_unit = GET_MODE_INNER (xmode);
|
||||
gcc_assert (HARD_REGNO_NREGS_HAS_PADDING (xregno, xmode_unit));
|
||||
gcc_assert (nregs_xmode
|
||||
== (GET_MODE_NUNITS (xmode)
|
||||
|
|
|
@ -5650,21 +5650,17 @@ simplify_immed_subreg (machine_mode outermode, rtx op,
|
|||
value_start = byte * (BITS_PER_UNIT / value_bit);
|
||||
|
||||
/* Re-pack the value. */
|
||||
num_elem = GET_MODE_NUNITS (outermode);
|
||||
|
||||
if (VECTOR_MODE_P (outermode))
|
||||
{
|
||||
num_elem = GET_MODE_NUNITS (outermode);
|
||||
result_v = rtvec_alloc (num_elem);
|
||||
elems = &RTVEC_ELT (result_v, 0);
|
||||
outer_submode = GET_MODE_INNER (outermode);
|
||||
}
|
||||
else
|
||||
{
|
||||
num_elem = 1;
|
||||
elems = &result_s;
|
||||
outer_submode = outermode;
|
||||
}
|
||||
elems = &result_s;
|
||||
|
||||
outer_submode = GET_MODE_INNER (outermode);
|
||||
outer_class = GET_MODE_CLASS (outer_submode);
|
||||
elem_bitsize = GET_MODE_BITSIZE (outer_submode);
|
||||
|
||||
|
|
|
@ -491,7 +491,7 @@ bitwise_type_for_mode (machine_mode mode)
|
|||
if (COMPLEX_MODE_P (mode))
|
||||
return build_complex_type (inner_type);
|
||||
|
||||
gcc_checking_assert (GET_MODE_INNER (mode) == VOIDmode);
|
||||
gcc_checking_assert (GET_MODE_INNER (mode) == mode);
|
||||
return inner_type;
|
||||
}
|
||||
|
||||
|
@ -548,18 +548,6 @@ get_mode_alignment (machine_mode mode)
|
|||
return MIN (BIGGEST_ALIGNMENT, MAX (1, mode_base_align[mode]*BITS_PER_UNIT));
|
||||
}
|
||||
|
||||
/* Return the precision of the mode, or for a complex or vector mode the
|
||||
precision of the mode of its elements. */
|
||||
|
||||
unsigned int
|
||||
element_precision (machine_mode mode)
|
||||
{
|
||||
if (COMPLEX_MODE_P (mode) || VECTOR_MODE_P (mode))
|
||||
mode = GET_MODE_INNER (mode);
|
||||
|
||||
return GET_MODE_PRECISION (mode);
|
||||
}
|
||||
|
||||
/* Return the natural mode of an array, given that it is SIZE bytes in
|
||||
total and has elements of type ELEM_TYPE. */
|
||||
|
||||
|
|
Loading…
Reference in New Issue