[AArch64] Add a aarch64_sve_mode_p query

This patch adds an exported function for testing whether a mode is
an SVE mode.  The ACLE will make more use of it, but there's already
one place that can benefit.

2019-08-15  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	* config/aarch64/aarch64-protos.h (aarch64_sve_mode_p): Declare.
	* config/aarch64/aarch64.c (aarch64_sve_mode_p): New function.
	(aarch64_select_early_remat_modes): Use it.

From-SVN: r274523
This commit is contained in:
Richard Sandiford 2019-08-15 09:00:22 +00:00 committed by Richard Sandiford
parent 07108a9ebe
commit 5c38705dbd
3 changed files with 17 additions and 6 deletions

View File

@ -1,3 +1,9 @@
2019-08-15 Richard Sandiford <richard.sandiford@arm.com>
* config/aarch64/aarch64-protos.h (aarch64_sve_mode_p): Declare.
* config/aarch64/aarch64.c (aarch64_sve_mode_p): New function.
(aarch64_select_early_remat_modes): Use it.
2019-08-15 Richard Sandiford <richard.sandiford@arm.com>
* config/aarch64/aarch64.c (aarch64_simd_vector_alignment): Return

View File

@ -475,6 +475,7 @@ bool aarch64_masks_and_shift_for_bfi_p (scalar_int_mode, unsigned HOST_WIDE_INT,
bool aarch64_zero_extend_const_eq (machine_mode, rtx, machine_mode, rtx);
bool aarch64_move_imm (HOST_WIDE_INT, machine_mode);
opt_machine_mode aarch64_sve_pred_mode (unsigned int);
bool aarch64_sve_mode_p (machine_mode);
bool aarch64_sve_cnt_immediate_p (rtx);
bool aarch64_sve_scalar_inc_dec_immediate_p (rtx);
bool aarch64_sve_addvl_addpl_immediate_p (rtx);

View File

@ -1606,6 +1606,14 @@ aarch64_vector_data_mode_p (machine_mode mode)
return aarch64_classify_vector_mode (mode) & VEC_ANY_DATA;
}
/* Return true if MODE is any form of SVE mode, including predicates,
vectors and structures. */
bool
aarch64_sve_mode_p (machine_mode mode)
{
return aarch64_classify_vector_mode (mode) & VEC_ANY_SVE;
}
/* Return true if MODE is an SVE data vector mode; either a single vector
or a structure of vectors. */
static bool
@ -19962,12 +19970,8 @@ aarch64_select_early_remat_modes (sbitmap modes)
/* SVE values are not normally live across a call, so it should be
worth doing early rematerialization even in VL-specific mode. */
for (int i = 0; i < NUM_MACHINE_MODES; ++i)
{
machine_mode mode = (machine_mode) i;
unsigned int vec_flags = aarch64_classify_vector_mode (mode);
if (vec_flags & VEC_ANY_SVE)
bitmap_set_bit (modes, i);
}
if (aarch64_sve_mode_p ((machine_mode) i))
bitmap_set_bit (modes, i);
}
/* Override the default target speculation_safe_value. */