зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1165654 - Cleanup how libjpeg-turbo assembly build variables are set. r=mshal
Most notably, always set LIBJPEG_TURBO_AS if LIBJPEG_TURBO_ASFLAGS is set.
This commit is contained in:
Родитель
3a1bea9785
Коммит
48bd7f52ac
57
configure.in
57
configure.in
|
@ -3857,11 +3857,6 @@ VPX_X86_ASM=
|
|||
VPX_ARM_ASM=
|
||||
LIBJPEG_TURBO_AS=
|
||||
LIBJPEG_TURBO_ASFLAGS=
|
||||
LIBJPEG_TURBO_X86_ASM=
|
||||
LIBJPEG_TURBO_X64_ASM=
|
||||
LIBJPEG_TURBO_ARM_ASM=
|
||||
LIBJPEG_TURBO_ARM64_ASM=
|
||||
LIBJPEG_TURBO_MIPS_ASM=
|
||||
MOZ_PERMISSIONS=1
|
||||
MOZ_PLACES=1
|
||||
MOZ_SOCIAL=1
|
||||
|
@ -6101,55 +6096,47 @@ dnl files.
|
|||
if test -n "$MOZ_LIBJPEG_TURBO"; then
|
||||
|
||||
dnl Do we support libjpeg-turbo on this platform?
|
||||
case "$OS_ARCH:$OS_TEST" in
|
||||
Darwin:i?86)
|
||||
case "$OS_ARCH:$CPU_ARCH" in
|
||||
Darwin:x86)
|
||||
LIBJPEG_TURBO_ASFLAGS="-f macho32 -rnasm -pnasm -DPIC -DMACHO"
|
||||
LIBJPEG_TURBO_X86_ASM=1
|
||||
;;
|
||||
Darwin:x86_64)
|
||||
LIBJPEG_TURBO_ASFLAGS="-f macho64 -rnasm -pnasm -D__x86_64__ -DPIC -DMACHO"
|
||||
LIBJPEG_TURBO_X64_ASM=1
|
||||
;;
|
||||
WINNT:x86|WINNT:i?86)
|
||||
WINNT:x86)
|
||||
LIBJPEG_TURBO_ASFLAGS="-f win32 -rnasm -pnasm -DPIC -DWIN32"
|
||||
LIBJPEG_TURBO_X86_ASM=1
|
||||
;;
|
||||
WINNT:x86_64)
|
||||
LIBJPEG_TURBO_ASFLAGS="-f win64 -rnasm -pnasm -D__x86_64__ -DPIC -DWIN64 -DMSVC"
|
||||
LIBJPEG_TURBO_X64_ASM=1
|
||||
;;
|
||||
*:arm*)
|
||||
*:arm)
|
||||
LIBJPEG_TURBO_ASFLAGS="-march=armv7-a -mfpu=neon"
|
||||
LIBJPEG_TURBO_ARM_ASM=1
|
||||
;;
|
||||
*:aarch64*)
|
||||
*:aarch64)
|
||||
LIBJPEG_TURBO_ASFLAGS="-march=armv8-a"
|
||||
LIBJPEG_TURBO_ARM64_ASM=1
|
||||
;;
|
||||
*:mips*)
|
||||
*:mips)
|
||||
LIBJPEG_TURBO_ASFLAGS="-mdspr2"
|
||||
LIBJPEG_TURBO_MIPS_ASM=1
|
||||
;;
|
||||
*:x86|*:i?86)
|
||||
*:x86)
|
||||
if $CC -E -dM -</dev/null | grep -q __ELF__; then
|
||||
LIBJPEG_TURBO_ASFLAGS="-f elf32 -rnasm -pnasm -DPIC -DELF"
|
||||
LIBJPEG_TURBO_X86_ASM=1
|
||||
fi
|
||||
;;
|
||||
*:x86_64)
|
||||
if $CC -E -dM -</dev/null | grep -q __ELF__; then
|
||||
LIBJPEG_TURBO_ASFLAGS="-f elf64 -rnasm -pnasm -D__x86_64__ -DPIC -DELF"
|
||||
LIBJPEG_TURBO_X64_ASM=1
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
fi
|
||||
|
||||
if test -n "$LIBJPEG_TURBO_ASFLAGS"; then
|
||||
case "$CPU_ARCH" in
|
||||
dnl If we're on an x86 or x64 system which supports libjpeg-turbo's asm routines
|
||||
dnl and --disable-libjpeg-turbo wasn't passed, check for Yasm, and error out if
|
||||
dnl it doesn't exist or we have too old of a version.
|
||||
if test -n "$LIBJPEG_TURBO_X86_ASM" -o -n "$LIBJPEG_TURBO_X64_ASM" ; then
|
||||
x86_64|x86)
|
||||
LIBJPEG_TURBO_AS=$YASM
|
||||
|
||||
if test -z "$LIBJPEG_TURBO_AS" ; then
|
||||
|
@ -6167,21 +6154,12 @@ if test -n "$LIBJPEG_TURBO_X86_ASM" -o -n "$LIBJPEG_TURBO_X64_ASM" ; then
|
|||
AC_MSG_ERROR([Yasm 1.1 or greater is required to build with libjpeg-turbo's optimized JPEG decoding routines, but you appear to have version $_YASM_MAJOR_VERSION.$_YASM_MINOR_VERSION. Upgrade to the newest version or configure with --disable-libjpeg-turbo to use the pure C JPEG decoder. See https://developer.mozilla.org/en/YASM for more details.])
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl If we're on an ARM system which supports libjpeg-turbo's asm routines and
|
||||
dnl --disable-libjpeg-turbo wasn't passed, use the C compiler as the assembler.
|
||||
if test -n "$LIBJPEG_TURBO_ARM_ASM" ; then
|
||||
echo "Using $AS as the assembler for ARM code."
|
||||
;;
|
||||
dnl On other platforms, use the C compiler as the assembler.
|
||||
*)
|
||||
LIBJPEG_TURBO_AS=$AS
|
||||
fi
|
||||
|
||||
if test -n "$LIBJPEG_TURBO_X86_ASM"; then
|
||||
AC_DEFINE(LIBJPEG_TURBO_X86_ASM)
|
||||
elif test -n "$LIBJPEG_TURBO_X64_ASM"; then
|
||||
AC_DEFINE(LIBJPEG_TURBO_X64_ASM)
|
||||
elif test -n "$LIBJPEG_TURBO_ARM_ASM"; then
|
||||
AC_DEFINE(LIBJPEG_TURBO_ARM_ASM)
|
||||
;;
|
||||
esac
|
||||
elif test -n "$MOZ_LIBJPEG_TURBO"; then
|
||||
dnl Warn if we're not building the optimized routines, even though the user
|
||||
dnl didn't specify --disable-libjpeg-turbo.
|
||||
|
@ -8871,11 +8849,6 @@ AC_SUBST(MOZ_INSTRUMENT_EVENT_LOOP)
|
|||
AC_SUBST(MOZ_CODE_COVERAGE)
|
||||
AC_SUBST(LIBJPEG_TURBO_AS)
|
||||
AC_SUBST_LIST(LIBJPEG_TURBO_ASFLAGS)
|
||||
AC_SUBST(LIBJPEG_TURBO_X86_ASM)
|
||||
AC_SUBST(LIBJPEG_TURBO_X64_ASM)
|
||||
AC_SUBST(LIBJPEG_TURBO_ARM_ASM)
|
||||
AC_SUBST(LIBJPEG_TURBO_ARM64_ASM)
|
||||
AC_SUBST(LIBJPEG_TURBO_MIPS_ASM)
|
||||
|
||||
AC_SUBST(MOZ_PACKAGE_JSSHELL)
|
||||
AC_SUBST(MOZ_FOLD_LIBS)
|
||||
|
|
|
@ -13,62 +13,6 @@ EXPORTS += [
|
|||
'jpeglib.h',
|
||||
]
|
||||
|
||||
if CONFIG['LIBJPEG_TURBO_X64_ASM']:
|
||||
SOURCES += [
|
||||
'simd/jccolor-sse2-64.asm',
|
||||
'simd/jcgray-sse2-64.asm',
|
||||
'simd/jcsample-sse2-64.asm',
|
||||
'simd/jdcolor-sse2-64.asm',
|
||||
'simd/jdmerge-sse2-64.asm',
|
||||
'simd/jdsample-sse2-64.asm',
|
||||
'simd/jfdctflt-sse-64.asm',
|
||||
'simd/jfdctfst-sse2-64.asm',
|
||||
'simd/jfdctint-sse2-64.asm',
|
||||
'simd/jidctflt-sse2-64.asm',
|
||||
'simd/jidctfst-sse2-64.asm',
|
||||
'simd/jidctint-sse2-64.asm',
|
||||
'simd/jidctred-sse2-64.asm',
|
||||
'simd/jquantf-sse2-64.asm',
|
||||
'simd/jquanti-sse2-64.asm',
|
||||
]
|
||||
|
||||
if CONFIG['LIBJPEG_TURBO_X86_ASM']:
|
||||
SOURCES += [
|
||||
'simd/jccolor-mmx.asm',
|
||||
'simd/jccolor-sse2.asm',
|
||||
'simd/jcgray-mmx.asm',
|
||||
'simd/jcgray-sse2.asm',
|
||||
'simd/jcsample-mmx.asm',
|
||||
'simd/jcsample-sse2.asm',
|
||||
'simd/jdcolor-mmx.asm',
|
||||
'simd/jdcolor-sse2.asm',
|
||||
'simd/jdmerge-mmx.asm',
|
||||
'simd/jdmerge-sse2.asm',
|
||||
'simd/jdsample-mmx.asm',
|
||||
'simd/jdsample-sse2.asm',
|
||||
'simd/jfdctflt-3dn.asm',
|
||||
'simd/jfdctflt-sse.asm',
|
||||
'simd/jfdctfst-mmx.asm',
|
||||
'simd/jfdctfst-sse2.asm',
|
||||
'simd/jfdctint-mmx.asm',
|
||||
'simd/jfdctint-sse2.asm',
|
||||
'simd/jidctflt-3dn.asm',
|
||||
'simd/jidctflt-sse.asm',
|
||||
'simd/jidctflt-sse2.asm',
|
||||
'simd/jidctfst-mmx.asm',
|
||||
'simd/jidctfst-sse2.asm',
|
||||
'simd/jidctint-mmx.asm',
|
||||
'simd/jidctint-sse2.asm',
|
||||
'simd/jidctred-mmx.asm',
|
||||
'simd/jidctred-sse2.asm',
|
||||
'simd/jquant-3dn.asm',
|
||||
'simd/jquant-mmx.asm',
|
||||
'simd/jquant-sse.asm',
|
||||
'simd/jquantf-sse2.asm',
|
||||
'simd/jquanti-sse2.asm',
|
||||
'simd/jsimdcpu.asm',
|
||||
]
|
||||
|
||||
SOURCES += [
|
||||
'jcomapi.c',
|
||||
'jdapimin.c',
|
||||
|
@ -122,29 +66,78 @@ SOURCES += [
|
|||
'jctrans.c',
|
||||
]
|
||||
|
||||
if CONFIG['LIBJPEG_TURBO_ARM_ASM']:
|
||||
SOURCES += [
|
||||
'simd/jsimd_arm.c',
|
||||
'simd/jsimd_arm_neon.S',
|
||||
]
|
||||
elif CONFIG['LIBJPEG_TURBO_ARM64_ASM']:
|
||||
SOURCES += [
|
||||
'simd/jsimd_arm64.c',
|
||||
'simd/jsimd_arm64_neon.S',
|
||||
]
|
||||
elif CONFIG['LIBJPEG_TURBO_MIPS_ASM']:
|
||||
SOURCES += [
|
||||
'simd/jsimd_mips.c',
|
||||
'simd/jsimd_mips_dspr2.S',
|
||||
]
|
||||
elif CONFIG['LIBJPEG_TURBO_X64_ASM']:
|
||||
SOURCES += [
|
||||
'simd/jsimd_x86_64.c',
|
||||
]
|
||||
elif CONFIG['LIBJPEG_TURBO_X86_ASM']:
|
||||
SOURCES += [
|
||||
'simd/jsimd_i386.c',
|
||||
]
|
||||
if CONFIG['LIBJPEG_TURBO_AS']:
|
||||
if CONFIG['CPU_ARCH'] == 'arm':
|
||||
SOURCES += [
|
||||
'simd/jsimd_arm.c',
|
||||
'simd/jsimd_arm_neon.S',
|
||||
]
|
||||
elif CONFIG['CPU_ARCH'] == 'aarch64':
|
||||
SOURCES += [
|
||||
'simd/jsimd_arm64.c',
|
||||
'simd/jsimd_arm64_neon.S',
|
||||
]
|
||||
elif CONFIG['CPU_ARCH'] == 'mips':
|
||||
SOURCES += [
|
||||
'simd/jsimd_mips.c',
|
||||
'simd/jsimd_mips_dspr2.S',
|
||||
]
|
||||
elif CONFIG['CPU_ARCH'] == 'x86_64':
|
||||
SOURCES += [
|
||||
'simd/jccolor-sse2-64.asm',
|
||||
'simd/jcgray-sse2-64.asm',
|
||||
'simd/jcsample-sse2-64.asm',
|
||||
'simd/jdcolor-sse2-64.asm',
|
||||
'simd/jdmerge-sse2-64.asm',
|
||||
'simd/jdsample-sse2-64.asm',
|
||||
'simd/jfdctflt-sse-64.asm',
|
||||
'simd/jfdctfst-sse2-64.asm',
|
||||
'simd/jfdctint-sse2-64.asm',
|
||||
'simd/jidctflt-sse2-64.asm',
|
||||
'simd/jidctfst-sse2-64.asm',
|
||||
'simd/jidctint-sse2-64.asm',
|
||||
'simd/jidctred-sse2-64.asm',
|
||||
'simd/jquantf-sse2-64.asm',
|
||||
'simd/jquanti-sse2-64.asm',
|
||||
'simd/jsimd_x86_64.c',
|
||||
]
|
||||
elif CONFIG['CPU_ARCH'] == 'x86':
|
||||
SOURCES += [
|
||||
'simd/jccolor-mmx.asm',
|
||||
'simd/jccolor-sse2.asm',
|
||||
'simd/jcgray-mmx.asm',
|
||||
'simd/jcgray-sse2.asm',
|
||||
'simd/jcsample-mmx.asm',
|
||||
'simd/jcsample-sse2.asm',
|
||||
'simd/jdcolor-mmx.asm',
|
||||
'simd/jdcolor-sse2.asm',
|
||||
'simd/jdmerge-mmx.asm',
|
||||
'simd/jdmerge-sse2.asm',
|
||||
'simd/jdsample-mmx.asm',
|
||||
'simd/jdsample-sse2.asm',
|
||||
'simd/jfdctflt-3dn.asm',
|
||||
'simd/jfdctflt-sse.asm',
|
||||
'simd/jfdctfst-mmx.asm',
|
||||
'simd/jfdctfst-sse2.asm',
|
||||
'simd/jfdctint-mmx.asm',
|
||||
'simd/jfdctint-sse2.asm',
|
||||
'simd/jidctflt-3dn.asm',
|
||||
'simd/jidctflt-sse.asm',
|
||||
'simd/jidctflt-sse2.asm',
|
||||
'simd/jidctfst-mmx.asm',
|
||||
'simd/jidctfst-sse2.asm',
|
||||
'simd/jidctint-mmx.asm',
|
||||
'simd/jidctint-sse2.asm',
|
||||
'simd/jidctred-mmx.asm',
|
||||
'simd/jidctred-sse2.asm',
|
||||
'simd/jquant-3dn.asm',
|
||||
'simd/jquant-mmx.asm',
|
||||
'simd/jquant-sse.asm',
|
||||
'simd/jquantf-sse2.asm',
|
||||
'simd/jquanti-sse2.asm',
|
||||
'simd/jsimd_i386.c',
|
||||
'simd/jsimdcpu.asm',
|
||||
]
|
||||
else: # No SIMD support?
|
||||
SOURCES += [
|
||||
'jsimd_none.c',
|
||||
|
|
Загрузка…
Ссылка в новой задаче