AARCH64_EXTRA_TUNING_OPTION ("rename_load_regs", RENAME_LOAD_REGS)
+/* Prefer Advanced SIMD over SVE for auto-vectorization. */
+AARCH64_EXTRA_TUNING_OPTION ("prefer_advsimd_autovec", PREFER_ADVSIMD_AUTOVEC)
+
#undef AARCH64_EXTRA_TUNING_OPTION
2, /* min_div_recip_mul_df. */
0, /* max_case_values. */
tune_params::AUTOPREFETCHER_WEAK, /* autoprefetcher_model. */
- (AARCH64_EXTRA_TUNE_NONE), /* tune_flags. */
+ (AARCH64_EXTRA_TUNE_PREFER_ADVSIMD_AUTOVEC), /* tune_flags. */
&generic_prefetch_tune
};
SET_OPTION_IF_UNSET (opts, &global_options_set,
param_sched_autopref_queue_depth, queue_depth);
+ /* If the core wants only AdvancedSIMD autovectorization, do this through
+ aarch64_autovec_preference. If the user set it explicitly, they should
+ know what they want. */
+ if (aarch64_tune_params.extra_tuning_flags
+ & AARCH64_EXTRA_TUNE_PREFER_ADVSIMD_AUTOVEC)
+ SET_OPTION_IF_UNSET (opts, &global_options_set,
+ aarch64_autovec_preference, 1);
+
/* If using Advanced SIMD only for autovectorization disable SVE vector costs
comparison. */
if (aarch64_autovec_preference == 1)
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O3 -mcpu=neoverse-v1" } */
+
+void __attribute__((noinline, noclone))
+vadd (int * __restrict__ dst, int * __restrict__ op1, int * __restrict__ op2, unsigned int count)
+{
+ for (int i = 0; i < count; ++i)
+ {
+ dst[i] = op1[i] + op2[i];
+ }
+}
+
+/* { dg-final { scan-assembler-not {\tadd\tz[0-9]+} } } */