+2020-01-21 Richard Sandiford <richard.sandiford@arm.com>
+
+ * config/aarch64/aarch64-sve-builtins.h
+ (function_expander::convert_to_pmode): Declare.
+ * config/aarch64/aarch64-sve-builtins.cc
+ (function_expander::convert_to_pmode): New function.
+ (function_expander::get_contiguous_base): Use it.
+ (function_expander::prepare_gather_address_operands): Likewise.
+ * config/aarch64/aarch64-sve-builtins-sve2.cc
+ (svwhilerw_svwhilewr_impl::expand): Likewise.
+
2020-01-21 Szabolcs Nagy <szabolcs.nagy@arm.com>
PR target/92424
rtx
expand (function_expander &e) const OVERRIDE
{
+ for (unsigned int i = 0; i < 2; ++i)
+ e.args[i] = e.convert_to_pmode (e.args[i]);
return e.use_exact_insn (code_for_while (m_unspec, Pmode, e.gp_mode (0)));
}
return false;
}
+/* Convert ptr_mode value X to Pmode. */
+rtx
+function_expander::convert_to_pmode (rtx x)
+{
+ if (ptr_mode == SImode)
+ x = simplify_gen_unary (ZERO_EXTEND, DImode, x, SImode);
+ return x;
+}
+
/* Return the base address for a contiguous load or store function.
MEM_MODE is the mode of the addressed memory. */
rtx
function_expander::get_contiguous_base (machine_mode mem_mode)
{
- rtx base = args[1];
+ rtx base = convert_to_pmode (args[1]);
if (mode_suffix_id == MODE_vnum)
{
/* Use the size of the memory mode for extending loads and truncating
{
/* Scalar base, vector displacement. This is the order that the md
pattern wants. */
- if (Pmode == SImode)
- args[argno] = simplify_gen_unary (ZERO_EXTEND, DImode,
- args[argno], SImode);
+ args[argno] = convert_to_pmode (args[argno]);
vector_type = displacement_vector_type ();
if (units == UNITS_elements && !scaled_p)
shift_idx = argno + 1;
bool overlaps_input_p (rtx);
+ rtx convert_to_pmode (rtx);
rtx get_contiguous_base (machine_mode);
rtx get_fallback_value (machine_mode, unsigned int,
unsigned int, unsigned int &);