[AArch64] Re-enable SME only for Linux and new versions of Clang

This was previously disabled in
679e851f653866a49e21f69fe8380bd20123f0ee, so re-enable it but only for
Linux where SME is known to work correctly.

Change-Id: I2626b03f3854b27162df1b55fc6767e02ffe318d
Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/5802958
Reviewed-by: Frank Barchard <fbarchard@chromium.org>
Reviewed-by: Justin Green <greenjustin@google.com>
This commit is contained in:
George Steed 2024-08-19 10:10:21 +01:00 committed by Frank Barchard
parent 8315fa1d3a
commit a37e6bc81b
3 changed files with 11 additions and 6 deletions

View File

@ -72,9 +72,11 @@ extern "C" {
#define VISUALC_HAS_AVX2 1
#endif // VisualStudio >= 2012
// Temporary disable SME.
#if !defined(LIBYUV_DISABLE_SME)
#define LIBYUV_DISABLE_SME
// Clang 19 required for SME due to needing __arm_tpidr2_save from compiler-rt,
// only enabled on Linux for now.
#if !defined(LIBYUV_DISABLE_SME) && defined(__aarch64__) && \
defined(__gnu_linux__) && defined(__clang__) && (__clang_major__ >= 19)
#define CLANG_HAS_SME 1
#endif
#ifdef __cplusplus

View File

@ -50,7 +50,8 @@ extern "C" {
#define HAS_TRANSPOSE4X4_32_NEON
#endif
#if !defined(LIBYUV_DISABLE_SME) && defined(__aarch64__)
#if !defined(LIBYUV_DISABLE_SME) && defined(CLANG_HAS_SME) && \
defined(__aarch64__)
#define HAS_TRANSPOSEWXH_SME
#define HAS_TRANSPOSEUVWXH_SME
#endif

View File

@ -18,7 +18,8 @@ namespace libyuv {
extern "C" {
#endif
#if !defined(LIBYUV_DISABLE_SME) && defined(__aarch64__)
#if !defined(LIBYUV_DISABLE_SME) && defined(CLANG_HAS_SME) && \
defined(__aarch64__)
__arm_locally_streaming __arm_new("za") void TransposeWxH_SME(
const uint8_t* src,
@ -164,7 +165,8 @@ __arm_locally_streaming __arm_new("za") void TransposeUVWxH_SME(
} while (height > 0);
}
#endif // !defined(LIBYUV_DISABLE_SME) && defined(__aarch64__)
#endif // !defined(LIBYUV_DISABLE_SME) && defined(CLANG_HAS_SME) &&
// defined(__aarch64__)
#ifdef __cplusplus
} // extern "C"