From b7a857659f8485ee3c6769c27a3e74b0af910746 Mon Sep 17 00:00:00 2001 From: Wan-Teh Chang Date: Thu, 3 Apr 2025 11:03:44 -0700 Subject: [PATCH] Disable Arm SME and SVE assmbly code under MSan The code that disables Arm and Intel assembly code under MSan is duplicated in cpu_support.h and planar_functions.h. This CL does not address the code duplication. Bug: b:407277484, b:407278016, b:407278132 Change-Id: If70fd8d3382916041d75efabcc84010ea3f1e60e Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/6430806 Commit-Queue: Frank Barchard Reviewed-by: Frank Barchard --- include/libyuv/cpu_support.h | 14 +++++++++++--- include/libyuv/planar_functions.h | 14 +++++++++++--- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/include/libyuv/cpu_support.h b/include/libyuv/cpu_support.h index 9304ab2ac..79c6fb943 100644 --- a/include/libyuv/cpu_support.h +++ b/include/libyuv/cpu_support.h @@ -28,13 +28,21 @@ extern "C" { // MemorySanitizer does not support assembly code yet. http://crbug.com/344505 #if defined(__has_feature) -#if __has_feature(memory_sanitizer) && !defined(LIBYUV_DISABLE_NEON) +#if __has_feature(memory_sanitizer) +#if !defined(LIBYUV_DISABLE_NEON) #define LIBYUV_DISABLE_NEON #endif -#if __has_feature(memory_sanitizer) && !defined(LIBYUV_DISABLE_X86) +#if !defined(LIBYUV_DISABLE_SME) +#define LIBYUV_DISABLE_SME +#endif +#if !defined(LIBYUV_DISABLE_SVE) +#define LIBYUV_DISABLE_SVE +#endif +#if !defined(LIBYUV_DISABLE_X86) #define LIBYUV_DISABLE_X86 #endif -#endif +#endif // __has_feature(memory_sanitizer) +#endif // defined(__has_feature) // clang >= 3.5.0 required for Arm64. #if defined(__clang__) && defined(__aarch64__) && !defined(LIBYUV_DISABLE_NEON) diff --git a/include/libyuv/planar_functions.h b/include/libyuv/planar_functions.h index dbf51de52..b9878d22b 100644 --- a/include/libyuv/planar_functions.h +++ b/include/libyuv/planar_functions.h @@ -30,13 +30,21 @@ extern "C" { #endif // MemorySanitizer does not support assembly code yet. http://crbug.com/344505 #if defined(__has_feature) -#if __has_feature(memory_sanitizer) && !defined(LIBYUV_DISABLE_NEON) +#if __has_feature(memory_sanitizer) +#if !defined(LIBYUV_DISABLE_NEON) #define LIBYUV_DISABLE_NEON #endif -#if __has_feature(memory_sanitizer) && !defined(LIBYUV_DISABLE_X86) +#if !defined(LIBYUV_DISABLE_SME) +#define LIBYUV_DISABLE_SME +#endif +#if !defined(LIBYUV_DISABLE_SVE) +#define LIBYUV_DISABLE_SVE +#endif +#if !defined(LIBYUV_DISABLE_X86) #define LIBYUV_DISABLE_X86 #endif -#endif +#endif // __has_feature(memory_sanitizer) +#endif // defined(__has_feature) // The following are available on all x86 platforms: #if !defined(LIBYUV_DISABLE_X86) && \ (defined(_M_IX86) || \