Bug 1948198 - Enable LSX for libpng on LoongArch64. r=firefox-build-system-reviewers,tnikkel,glandium
Enable LSX unconditionally for LoongArch64 because its availability is guaranteed for LoongArch desktop and server platforms, which are general-purpose and popular, according to [the *Software Development and Build Convention for LoongArch Architectures* spec, version 0.2][softdev-conv]. [softdev-conv]: https://github.com/loongson/la-softdev-convention/blob/v0.2/la-softdev-convention.adoc#73-vector-instruction-support This change partially reverts D231469. Differential Revision: https://phabricator.services.mozilla.com/D238166
This commit is contained in:
@@ -72,7 +72,12 @@ if CONFIG['HAVE_ALTIVEC']:
|
||||
]
|
||||
|
||||
if CONFIG['TARGET_CPU'] == 'loongarch64':
|
||||
CFLAGS += ['-mno-lsx']
|
||||
DEFINES['MOZ_PNG_USE_LOONGARCH_LSX'] = True
|
||||
CFLAGS += ['-mlsx']
|
||||
UNIFIED_SOURCES += [
|
||||
'loongarch/filter_lsx_intrinsics.c',
|
||||
'loongarch/loongarch_lsx_init.c',
|
||||
]
|
||||
|
||||
if CONFIG['MOZ_TREE_FREETYPE']:
|
||||
DEFINES['FT_CONFIG_OPTION_USE_PNG'] = True
|
||||
|
||||
@@ -54,6 +54,13 @@
|
||||
# define PNG_ARM_NEON_OPT 0
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_PNG_USE_LOONGARCH_LSX
|
||||
# undef PNG_LOONGARCH_LSX_OPT /* Let libpng decide */
|
||||
# define PNG_ALIGNED_MEMORY_SUPPORTED
|
||||
#else
|
||||
# define PNG_LOONGARCH_LSX_OPT 0
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_PNG_USE_MIPS_MSA
|
||||
# undef PNG_MIPS_MSA_OPT
|
||||
# define PNG_ALIGNED_MEMORY_SUPPORTED
|
||||
|
||||
Reference in New Issue
Block a user