https://gcc.gnu.org/g:c3aaf80822f28e4517e783422473a3785f94d619
commit r17-4899-gc3aaf80822f28e4517e783422473a3785f94d619 Author: Alfie Richards <[email protected]> Date: Fri Oct 2 15:06:04 2026 +0000 aarch64: Add --param=aarch64-autovec-mode Allows forcing the autovec mode for testing and debugging purposes. gcc/ChangeLog: * config/aarch64/aarch64.cc (aarch64_autovectorize_vector_modes): All logic to only use aarch64-autovec-mode when specified. * config/aarch64/aarch64.opt: Add --param=aarch64-autovec-mode. * doc/params.texi: Document --param=aarch64-autovec-mode. Diff: --- gcc/config/aarch64/aarch64.cc | 6 ++++++ gcc/config/aarch64/aarch64.opt | 34 ++++++++++++++++++++++++++++++++++ gcc/doc/params.texi | 4 ++++ 3 files changed, 44 insertions(+) diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc index 107271b04045..6693cec98bdb 100644 --- a/gcc/config/aarch64/aarch64.cc +++ b/gcc/config/aarch64/aarch64.cc @@ -24187,6 +24187,12 @@ aarch64_autovectorize_vector_modes (vector_modes *modes, bool) V2SImode }; + if (aarch64_force_autovec_mode != VOIDmode) + { + modes->safe_push (aarch64_force_autovec_mode); + return 0; + } + /* Try using N-byte SVE modes only after trying N-byte Advanced SIMD mode. This is because: diff --git a/gcc/config/aarch64/aarch64.opt b/gcc/config/aarch64/aarch64.opt index deccc6c8887a..50d5623ec98a 100644 --- a/gcc/config/aarch64/aarch64.opt +++ b/gcc/config/aarch64/aarch64.opt @@ -406,6 +406,40 @@ Enum(aarch64_autovec_preference) String(prefer-asimd) Value(AARCH64_AUTOVEC_PREF EnumValue Enum(aarch64_autovec_preference) String(prefer-sve) Value(AARCH64_AUTOVEC_PREFER_SVE) +-param=aarch64-autovec-mode= +Target Joined Var(aarch64_force_autovec_mode) Enum(aarch64_autovec_mode) Init(VOIDmode) Param +Force a specific mode to be the only one considered for auto vectorization. + +If this is specified in addition to --param=aarch64-autovec-preference or +-mautovec-preference then this takes priority. + +Enum +Name(aarch64_autovec_mode) Type(machine_mode) UnknownError(unknown machine mode %qs) + +EnumValue +Enum(aarch64_autovec_mode) String(VNx16QI) Value(VNx16QImode) + +EnumValue +Enum(aarch64_autovec_mode) String(VNx8QI) Value(VNx8QImode) + +EnumValue +Enum(aarch64_autovec_mode) String(VNx4QI) Value(VNx4QImode) + +EnumValue +Enum(aarch64_autovec_mode) String(VNx2QI) Value(VNx2QImode) + +EnumValue +Enum(aarch64_autovec_mode) String(V16QI) Value(V16QImode) + +EnumValue +Enum(aarch64_autovec_mode) String(V8QI) Value(V8QImode) + +EnumValue +Enum(aarch64_autovec_mode) String(V4HI) Value(V4HImode) + +EnumValue +Enum(aarch64_autovec_mode) String(V2SI) Value(V2SImode) + -param=aarch64-loop-vect-issue-rate-niters= Target Joined UInteger Var(aarch64_loop_vect_issue_rate_niters) Init(6) IntegerRange(0, 65536) Param diff --git a/gcc/doc/params.texi b/gcc/doc/params.texi index e69be2d2923e..8d8e5926cb10 100644 --- a/gcc/doc/params.texi +++ b/gcc/doc/params.texi @@ -2027,6 +2027,10 @@ An old alias for @option{-mautovec-preference}. If both @option{-mautovec-preference} and @option{--param=aarch64-autovec-preference} are passed, the @option{--param} value is used. +@paindex aarch64-autovec-mode +@item aarch64-autovec-preference +Force a specific mode to be the only one considered for auto vectorization. + @paindex aarch64-ldp-policy @item aarch64-ldp-policy Fine-grained policy for load pair (@code{stp}) instructions.
