AARCH64_KEY_B
};
+/* An enum for setting the auto-vectorization preference:
+ - AARCH64_AUTOVEC_DEFAULT: Use default heuristics
+ - AARCH64_AUTOVEC_ASIMD_ONLY: Use only Advanced SIMD (Neon)
+ for auto-vectorisation
+ - AARCH64_AUTOVEC_SVE_ONLY: Use only SVE for auto-vectorisation
+ - AARCH64_AUTOVEC_PREFER_ASIMD: Use both Neon and SVE,
+ but prefer Neon when the costs are equal
+ - AARCH64_AUTOVEC_PREFER_SVE: Use both Neon and SVE,
+ but prefer SVE when the costs are equal. */
+enum aarch64_autovec_preference_enum {
+ AARCH64_AUTOVEC_DEFAULT,
+ AARCH64_AUTOVEC_ASIMD_ONLY,
+ AARCH64_AUTOVEC_SVE_ONLY,
+ AARCH64_AUTOVEC_PREFER_ASIMD,
+ AARCH64_AUTOVEC_PREFER_SVE
+};
+
/* An enum specifying how to handle load and store pairs using
a fine-grained policy:
- LDP_STP_POLICY_DEFAULT: Use the policy defined in the tuning structure.
/* Check whether it is possible in principle to use Advanced SIMD
instead. */
- if (aarch64_autovec_preference == 2)
+ if (aarch64_autovec_preference == AARCH64_AUTOVEC_SVE_ONLY)
return;
/* We don't want to apply the heuristic to outer loops, since it's
aarch64_cmp_autovec_modes (machine_mode sve_m, machine_mode asimd_m)
{
/* Take into account the aarch64-autovec-preference param if non-zero. */
- bool only_asimd_p = aarch64_autovec_preference == 1;
- bool only_sve_p = aarch64_autovec_preference == 2;
+ bool only_asimd_p = aarch64_autovec_preference == AARCH64_AUTOVEC_ASIMD_ONLY;
+ bool only_sve_p = aarch64_autovec_preference == AARCH64_AUTOVEC_SVE_ONLY;
if (only_asimd_p)
return false;
return true;
/* The preference in case of a tie in costs. */
- bool prefer_asimd = aarch64_autovec_preference == 3;
- bool prefer_sve = aarch64_autovec_preference == 4;
+ bool prefer_asimd = aarch64_autovec_preference == AARCH64_AUTOVEC_PREFER_ASIMD;
+ bool prefer_sve = aarch64_autovec_preference == AARCH64_AUTOVEC_PREFER_SVE;
poly_int64 nunits_sve = GET_MODE_NUNITS (sve_m);
poly_int64 nunits_asimd = GET_MODE_NUNITS (asimd_m);
than an SVE main loop with N bytes then by default we'll try to
use the SVE loop to vectorize the epilogue instead. */
- bool only_asimd_p = aarch64_autovec_preference == 1;
- bool only_sve_p = aarch64_autovec_preference == 2;
+ bool only_asimd_p = aarch64_autovec_preference == AARCH64_AUTOVEC_ASIMD_ONLY;
+ bool only_sve_p = aarch64_autovec_preference == AARCH64_AUTOVEC_SVE_ONLY;
unsigned int sve_i = (TARGET_SVE && !only_asimd_p) ? 0 : ARRAY_SIZE (sve_modes);
unsigned int advsimd_i = 0;
The number of Newton iterations for calculating the reciprocal for double type. The precision of division is proportional to this param when division approximation is enabled. The default value is 2.
-param=aarch64-autovec-preference=
-Target Joined UInteger Var(aarch64_autovec_preference) Init(0) IntegerRange(0, 4) Param
+Target Joined Var(aarch64_autovec_preference) Enum(aarch64_autovec_preference) Init(AARCH64_AUTOVEC_DEFAULT) Param
+--param=aarch64-autovec-preference=[default|asimd-only|sve-only|prefer-asimd|prefer-sve]
+Force an ISA selection strategy for auto-vectorization.
+
+Enum
+Name(aarch64_autovec_preference) Type(enum aarch64_autovec_preference_enum) UnknownError(unknown autovec preference %qs)
+
+EnumValue
+Enum(aarch64_autovec_preference) String(default) Value(AARCH64_AUTOVEC_DEFAULT)
+
+EnumValue
+Enum(aarch64_autovec_preference) String(asimd-only) Value(AARCH64_AUTOVEC_ASIMD_ONLY)
+
+EnumValue
+Enum(aarch64_autovec_preference) String(sve-only) Value(AARCH64_AUTOVEC_SVE_ONLY)
+
+EnumValue
+Enum(aarch64_autovec_preference) String(prefer-asimd) Value(AARCH64_AUTOVEC_PREFER_ASIMD)
+
+EnumValue
+Enum(aarch64_autovec_preference) String(prefer-sve) Value(AARCH64_AUTOVEC_PREFER_SVE)
-param=aarch64-loop-vect-issue-rate-niters=
Target Joined UInteger Var(aarch64_loop_vect_issue_rate_niters) Init(6) IntegerRange(0, 65536) Param
approximation is enabled. The default value is 2.
@item aarch64-autovec-preference
-Force an ISA selection strategy for auto-vectorization. Accepts values from
-0 to 4, inclusive.
+Force an ISA selection strategy for auto-vectorization.
@table @samp
-@item 0
+@item default
Use the default heuristics.
-@item 1
+@item asimd-only
Use only Advanced SIMD for auto-vectorization.
-@item 2
+@item sve-only
Use only SVE for auto-vectorization.
-@item 3
+@item prefer-asimd
Use both Advanced SIMD and SVE. Prefer Advanced SIMD when the costs are
deemed equal.
-@item 4
+@item prefer-sve
Use both Advanced SIMD and SVE. Prefer SVE when the costs are deemed equal.
@end table
-The default value is 0.
@item aarch64-ldp-policy
Fine-grained policy for load pairs.
--- /dev/null
+/* { dg-options "--param aarch64-autovec-preference=asimd-only" } */
+
+void
+foo (void) {}
--- /dev/null
+/* { dg-options "--param aarch64-autovec-preference=default" } */
+
+void
+foo (void) {}
--- /dev/null
+/* { dg-options "--param aarch64-autovec-preference=prefer-asimd" } */
+
+void
+foo (void) {}
--- /dev/null
+/* { dg-options "--param aarch64-autovec-preference=prefer-sve" } */
+
+void
+foo (void) {}
--- /dev/null
+/* { dg-options "--param aarch64-autovec-preference=sve-only" } */
+
+void
+foo (void) {}
-/* { dg-options "-O2 -mcpu=neoverse-v1 --param aarch64-autovec-preference=1 -fdump-tree-vect-details" } */
+/* { dg-options "-O2 -mcpu=neoverse-v1 --param aarch64-autovec-preference=asimd-only -fdump-tree-vect-details" } */
void
f (float x[restrict][100], float y[restrict][100])
-/* { dg-options "-O2 -mcpu=neoverse-v1 --param aarch64-autovec-preference=2 -fdump-tree-vect-details" } */
+/* { dg-options "-O2 -mcpu=neoverse-v1 --param aarch64-autovec-preference=sve-only -fdump-tree-vect-details" } */
void
f (float x[restrict][100], float y[restrict][100])
/* { dg-do compile } */
-/* { dg-options "-O2 -ftree-vectorize -moverride=sve_width=256 --param=aarch64-autovec-preference=2" } */
+/* { dg-options "-O2 -ftree-vectorize -moverride=sve_width=256 --param=aarch64-autovec-preference=sve-only" } */
#include <stdint.h>
/* { dg-do compile } */
-/* { dg-options "-O2 -ftree-vectorize -moverride=sve_width=256 --param=aarch64-autovec-preference=2" } */
+/* { dg-options "-O2 -ftree-vectorize -moverride=sve_width=256 --param=aarch64-autovec-preference=sve-only" } */
#include <stdint.h>
/* { dg-do compile } */
-/* { dg-options "-O2 -ftree-vectorize -moverride=sve_width=256 --param=aarch64-autovec-preference=2" } */
+/* { dg-options "-O2 -ftree-vectorize -moverride=sve_width=256 --param=aarch64-autovec-preference=sve-only" } */
#include <stdint.h>
/* { dg-do compile } */
-/* { dg-options "-O2 -ftree-vectorize -moverride=sve_width=256 --param=aarch64-autovec-preference=2" } */
+/* { dg-options "-O2 -ftree-vectorize -moverride=sve_width=256 --param=aarch64-autovec-preference=sve-only" } */
#include <stdint.h>
/* { dg-do compile } */
-/* { dg-options "-O2 -msve-vector-bits=128 --param aarch64-autovec-preference=2" } */
+/* { dg-options "-O2 -msve-vector-bits=128 --param aarch64-autovec-preference=sve-only" } */
#include "cond_xorsign_1.c"
/* { dg-do link } */
-/* { dg-options "-flto -O -ftree-vectorize --param=aarch64-autovec-preference=3" } */
+/* { dg-options "-flto -O -ftree-vectorize --param=aarch64-autovec-preference=prefer-asimd" } */
/* { dg-additional-sources "pr98268-2.c" } */
short d, e;
/* { dg-do compile } */
-/* { dg-options "-O -ftree-vectorize --param=aarch64-autovec-preference=3" } */
+/* { dg-options "-O -ftree-vectorize --param=aarch64-autovec-preference=prefer-asimd" } */
extern short d[], e[];
void f(char a, long *b) {