From eee459798486116575ed66c6d6609205d445ffb2 Mon Sep 17 00:00:00 2001 From: Frank Barchard Date: Thu, 1 Oct 2026 02:38:01 -0700 Subject: [PATCH] Fix _M_X86 to _M_IX86 Fix _M_X86 to _M_IX86 for Visual C 32 bit Visual C defines _M_IX86 for 32 bit x86, not _M_X86. row.h and row_win.cc tested _M_X86, so a real 32 bit Visual C build got neither USE_ROW_WIN nor USE_ROW_GCC, row_win.cc compiled to nothing, and the HAS_*_AVX2 defines for all x86 platforms were skipped. clang-cl and Android x86 are unaffected since clang defines __i386__. Testing: ninja -C out/Release libyuv_unittest && out/Release/libyuv_unittest ninja -C out/Release_x86 libyuv_unittest && out/Release_x86/libyuv_unittest ninja -C out/rowwin libyuv_unittest && out/rowwin/libyuv_unittest blaze test --config=windows_x86 //third_party/libyuv:libyuv_test blaze build --config=android_x86 //third_party/libyuv:libyuv Bug: None Change-Id: I0f90c03855f2981040ab4f250cd2facc9ef47ac0 TAG=agy CONV=bea53b37-b2bf-46fa-9e44-a708b438fabc Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/8499834 Commit-Queue: Frank Barchard Reviewed-by: Mirko Bonadei --- include/libyuv/row.h | 6 +++--- source/row_win.cc | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/libyuv/row.h b/include/libyuv/row.h index 7d1d2fb9e..0202c4351 100644 --- a/include/libyuv/row.h +++ b/include/libyuv/row.h @@ -26,7 +26,7 @@ extern "C" { // This module is for Visual C 32/64 bit #if !defined(LIBYUV_DISABLE_X86) && \ (defined(__x86_64__) || defined(__i386__) || defined(_M_X64) || \ - defined(_M_X86)) + defined(_M_IX86)) #if ((defined(_MSC_VER) && !defined(__clang__)) || \ defined(LIBYUV_ENABLE_ROWWIN)) #define USE_ROW_WIN @@ -128,7 +128,7 @@ extern "C" { // require VS2012, clang 3.4 or gcc 4.7. #if !defined(LIBYUV_DISABLE_X86) && \ (defined(__x86_64__) || defined(__i386__) || defined(_M_X64) || \ - defined(_M_X86)) + defined(_M_IX86)) #define HAS_ARGBMIRRORROW_AVX2 #define HAS_RGB24MIRRORROW_AVX2 #define HAS_ARGBTOUVMATRIXROW_AVX2 @@ -351,7 +351,7 @@ extern "C" { // This module is for Visual C 32/64 bit #if !defined(LIBYUV_DISABLE_X86) && defined(USE_ROW_WIN) && \ (defined(__x86_64__) || defined(__i386__) || defined(_M_X64) || \ - defined(_M_X86)) && \ + defined(_M_IX86)) && \ ((defined(_MSC_VER) && !defined(__clang__)) || \ defined(LIBYUV_ENABLE_ROWWIN)) #define HAS_RAWTOARGBROW_AVX2 diff --git a/source/row_win.cc b/source/row_win.cc index ad5db9206..c89aa9308 100644 --- a/source/row_win.cc +++ b/source/row_win.cc @@ -14,7 +14,7 @@ // This module is for Visual C 32/64 bit #if !defined(LIBYUV_DISABLE_X86) && \ (defined(__x86_64__) || defined(__i386__) || defined(_M_X64) || \ - defined(_M_X86)) && \ + defined(_M_IX86)) && \ ((defined(_MSC_VER) && !defined(__clang__)) || \ defined(LIBYUV_ENABLE_ROWWIN)) @@ -2545,6 +2545,6 @@ void BlendPlaneRow_AVX512BW(const uint8_t* src0, #endif #endif // !defined(LIBYUV_DISABLE_X86) && (defined(__x86_64__) || - // defined(__i386__) || defined(_M_X64) || defined(_M_X86)) && + // defined(__i386__) || defined(_M_X64) || defined(_M_IX86)) && // ((defined(_MSC_VER) && !defined(__clang__)) || // defined(LIBYUV_ENABLE_ROWWIN))