Skip to content

Commit

Permalink
fix SVE min compiler. Thanks @Mousius, refs #2103
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 631341096
  • Loading branch information
jan-wassenberg authored and copybara-github committed May 7, 2024
1 parent d7856f4 commit c1646cb
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions hwy/detect_targets.h
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,10 @@

#if HWY_ARCH_ARM

#if defined(__ARM_FEATURE_SVE2)
// Also check compiler version as done for HWY_ATTAINABLE_SVE2 because the
// static target (influenced here) must be one of the attainable targets.
#if defined(__ARM_FEATURE_SVE2) && \
(HWY_COMPILER_CLANG >= 1400 || HWY_COMPILER_GCC_ACTUAL >= 1200)
#undef HWY_BASELINE_SVE2 // was 0, will be re-defined
// If user specified -msve-vector-bits=128, they assert the vector length is
// 128 bits and we should use the HWY_SVE2_128 (more efficient for some ops).
Expand All @@ -353,7 +356,8 @@
#endif // __ARM_FEATURE_SVE_BITS
#endif // __ARM_FEATURE_SVE2

#if defined(__ARM_FEATURE_SVE)
#if defined(__ARM_FEATURE_SVE) && \
(HWY_COMPILER_CLANG >= 900 || HWY_COMPILER_GCC_ACTUAL >= 800)
#undef HWY_BASELINE_SVE // was 0, will be re-defined
// See above. If user-specified vector length matches our optimization, use it.
#if defined(__ARM_FEATURE_SVE_BITS) && __ARM_FEATURE_SVE_BITS == 256
Expand Down Expand Up @@ -583,9 +587,9 @@
#define HWY_ATTAINABLE_NEON 0
#endif

#if HWY_ARCH_ARM_A64 && \
(HWY_COMPILER_CLANG >= 1400 || HWY_COMPILER_GCC_ACTUAL >= 1200) && \
(HWY_HAVE_RUNTIME_DISPATCH || \
#if HWY_ARCH_ARM_A64 && \
(HWY_COMPILER_CLANG >= 900 || HWY_COMPILER_GCC_ACTUAL >= 800) && \
(HWY_HAVE_RUNTIME_DISPATCH || \
(HWY_ENABLED_BASELINE & (HWY_SVE | HWY_SVE_256)))
#define HWY_ATTAINABLE_SVE (HWY_SVE | HWY_SVE_256)
#else
Expand Down

0 comments on commit c1646cb

Please sign in to comment.