From 06a1c004bbbca3cef3f468a8fe77704b855ca039 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Fri, 18 Jul 2025 10:27:09 +0800 Subject: [PATCH] Revert "Enable explicit control over LoongArch LSX & LASX for GYP builds" This reverts commit 6ecfe106c304d1eeaa31d1b29a42c58fb70d35ca. This "explicit control" with -mlasx as the default is really surprising and unfriendly to distro maintainers and/or downstream projects. They already know using -m{no-,}l{a,}sx in CXXFLAGS to enable/disable the LoongArch vector extensions, but this control does not respect those flags already in the environment, forcing every distro and every downstream project to wire an extra logic into their build system if they need to change the default. To make things worse, LSX is guaranteed to be available for LoongArch desktop processors but LASX is not. Thus most downstream works will indeed need to change the default for hardware compatibility. "LASX is widely supported among LoongArch desktops and servers, and performance is better than with LSX alone" is true, but in the future we can make the use of LASX correctly guarded by runtime CPU feature check to take the advantange without breaking the hardware compatibility. No-Try: true Change-Id: I43b31a139b106b7f6f8b6ca5dc04045633ea1989 Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/6772565 Reviewed-by: Wan-Teh Chang Reviewed-by: Frank Barchard --- libyuv.gyp | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/libyuv.gyp b/libyuv.gyp index d4973b0db..e853ba319 100644 --- a/libyuv.gyp +++ b/libyuv.gyp @@ -26,30 +26,15 @@ 'clang%': 0, # Link-Time Optimizations. 'use_lto%': 0, - # Enable LASX on LoongArch by default. - "loong_lasx%": 1, - # Enable LSX on LoongArch by default. Has no effect if loong_lasx is - # enabled because LASX implies LSX according to the architecture specs. - "loong_lsx%": 1, 'mips_msa%': 0, # Default to msa off. 'build_neon': 0, - "build_lasx": 0, - "build_lsx": 0, 'build_msa': 0, - 'conditions': [ ['(target_arch == "armv7" or target_arch == "armv7s" or \ (target_arch == "arm" and arm_version >= 7) or target_arch == "arm64")\ and (arm_neon == 1 or arm_neon_optional == 1)', { 'build_neon': 1, }], - ['(target_arch == "loong64") and (loong_lasx == 1)', { - "build_lasx": 1, - "build_lsx": 1, # LASX implies LSX. - }], - ['(target_arch == "loong64") and (loong_lsx == 1)', { - "build_lsx": 1, - }], ['(target_arch == "mipsel" or target_arch == "mips64el")\ and (mips_msa == 1)', { @@ -75,16 +60,6 @@ '-Wno-unused-parameter', ], }], - ["build_lasx != 0", { - "cflags": ["-mlasx"], - }, { # build_lasx == 0 - "cflags": ["-mno-lasx"], - }], - ["build_lsx != 0", { - "cflags": ["-mlsx"], - }, { # build_lsx == 0 - "cflags": ["-mno-lsx"], - }], ['build_neon != 0', { 'defines': [ 'LIBYUV_NEON',