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 <fbarchard@chromium.org>
Reviewed-by: Frank Barchard <fbarchard@chromium.org>
This commit is contained in:
Wan-Teh Chang 2025-04-03 11:03:44 -07:00 committed by Frank Barchard
parent a4f653b389
commit b7a857659f
2 changed files with 22 additions and 6 deletions

View File

@ -28,13 +28,21 @@ extern "C" {
// MemorySanitizer does not support assembly code yet. http://crbug.com/344505 // MemorySanitizer does not support assembly code yet. http://crbug.com/344505
#if defined(__has_feature) #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 #define LIBYUV_DISABLE_NEON
#endif #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 #define LIBYUV_DISABLE_X86
#endif #endif
#endif #endif // __has_feature(memory_sanitizer)
#endif // defined(__has_feature)
// clang >= 3.5.0 required for Arm64. // clang >= 3.5.0 required for Arm64.
#if defined(__clang__) && defined(__aarch64__) && !defined(LIBYUV_DISABLE_NEON) #if defined(__clang__) && defined(__aarch64__) && !defined(LIBYUV_DISABLE_NEON)

View File

@ -30,13 +30,21 @@ extern "C" {
#endif #endif
// MemorySanitizer does not support assembly code yet. http://crbug.com/344505 // MemorySanitizer does not support assembly code yet. http://crbug.com/344505
#if defined(__has_feature) #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 #define LIBYUV_DISABLE_NEON
#endif #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 #define LIBYUV_DISABLE_X86
#endif #endif
#endif #endif // __has_feature(memory_sanitizer)
#endif // defined(__has_feature)
// The following are available on all x86 platforms: // The following are available on all x86 platforms:
#if !defined(LIBYUV_DISABLE_X86) && \ #if !defined(LIBYUV_DISABLE_X86) && \
(defined(_M_IX86) || \ (defined(_M_IX86) || \