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 <wtc@google.com>
Reviewed-by: Frank Barchard <fbarchard@chromium.org>
This commit is contained in:
Xi Ruoyao 2025-07-18 10:27:09 +08:00 committed by Frank Barchard
parent eb4e4736a4
commit 06a1c004bb

View File

@ -26,30 +26,15 @@
'clang%': 0, 'clang%': 0,
# Link-Time Optimizations. # Link-Time Optimizations.
'use_lto%': 0, '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. 'mips_msa%': 0, # Default to msa off.
'build_neon': 0, 'build_neon': 0,
"build_lasx": 0,
"build_lsx": 0,
'build_msa': 0, 'build_msa': 0,
'conditions': [ 'conditions': [
['(target_arch == "armv7" or target_arch == "armv7s" or \ ['(target_arch == "armv7" or target_arch == "armv7s" or \
(target_arch == "arm" and arm_version >= 7) or target_arch == "arm64")\ (target_arch == "arm" and arm_version >= 7) or target_arch == "arm64")\
and (arm_neon == 1 or arm_neon_optional == 1)', { and (arm_neon == 1 or arm_neon_optional == 1)', {
'build_neon': 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")\ ['(target_arch == "mipsel" or target_arch == "mips64el")\
and (mips_msa == 1)', and (mips_msa == 1)',
{ {
@ -75,16 +60,6 @@
'-Wno-unused-parameter', '-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', { ['build_neon != 0', {
'defines': [ 'defines': [
'LIBYUV_NEON', 'LIBYUV_NEON',