Issue #2354 - Restore ARM32 buildability on Linux. Fix ION breakages due to BigInt changes. Fix breakages from libjpeg, libyuv and libvpx upgrades. Restore ARM(32/64) NEON FPU support in libyuv.

This commit is contained in:
Brian Smith 2023-10-25 19:01:38 +00:00 • committed by roytam1
commit cd66a17327
7 changed files with 35 additions and 25 deletions

View file

@ -288,24 +288,6 @@ class CodeGeneratorARM : public CodeGeneratorShared
void visitUDiv(LUDiv* ins); void visitUDiv(LUDiv* ins);
void visitUMod(LUMod* ins); void visitUMod(LUMod* ins);
void visitSoftUDivOrMod(LSoftUDivOrMod* ins); void visitSoftUDivOrMod(LSoftUDivOrMod* ins);
public:
// Unimplemented SIMD instructions
void visitSimdSplatX4(LSimdSplatX4* lir) { MOZ_CRASH("NYI"); }
void visitSimd128Int(LSimd128Int* ins) { MOZ_CRASH("NYI"); }
void visitSimd128Float(LSimd128Float* ins) { MOZ_CRASH("NYI"); }
void visitSimdReinterpretCast(LSimdReinterpretCast* ins) { MOZ_CRASH("NYI"); }
void visitSimdExtractElementI(LSimdExtractElementI* ins) { MOZ_CRASH("NYI"); }
void visitSimdExtractElementF(LSimdExtractElementF* ins) { MOZ_CRASH("NYI"); }
void visitSimdGeneralShuffleI(LSimdGeneralShuffleI* lir) { MOZ_CRASH("NYI"); }
void visitSimdGeneralShuffleF(LSimdGeneralShuffleF* lir) { MOZ_CRASH("NYI"); }
void visitSimdSwizzleI(LSimdSwizzleI* lir) { MOZ_CRASH("NYI"); }
void visitSimdSwizzleF(LSimdSwizzleF* lir) { MOZ_CRASH("NYI"); }
void visitSimdBinaryCompIx4(LSimdBinaryCompIx4* lir) { MOZ_CRASH("NYI"); }
void visitSimdBinaryCompFx4(LSimdBinaryCompFx4* lir) { MOZ_CRASH("NYI"); }
void visitSimdBinaryArithIx4(LSimdBinaryArithIx4* lir) { MOZ_CRASH("NYI"); }
void visitSimdBinaryArithFx4(LSimdBinaryArithFx4* lir) { MOZ_CRASH("NYI"); }
void visitSimdBinaryBitwise(LSimdBinaryBitwise* lir) { MOZ_CRASH("NYI"); }
}; };
typedef CodeGeneratorARM CodeGeneratorSpecific; typedef CodeGeneratorARM CodeGeneratorSpecific;

View file

@ -3013,7 +3013,7 @@ MacroAssemblerARMCompat::testInt32(Condition cond, const BaseIndex& src)
return cond; return cond;
} }
+Assembler::Condition Assembler::Condition
MacroAssemblerARMCompat::testBigInt(Condition cond,const BaseIndex& src) MacroAssemblerARMCompat::testBigInt(Condition cond,const BaseIndex& src)
{ {
MOZ_ASSERT(cond == Equal || cond == NotEqual); MOZ_ASSERT(cond == Equal || cond == NotEqual);
@ -3766,7 +3766,7 @@ MacroAssemblerARMCompat::testStringTruthy(bool truthy, const ValueOperand& value
return truthy ? Assembler::NotEqual : Assembler::Equal; return truthy ? Assembler::NotEqual : Assembler::Equal;
} }
+Assembler::Condition Assembler::Condition
MacroAssemblerARMCompat::testBigIntTruthy(bool truthy, const ValueOperand& value) MacroAssemblerARMCompat::testBigIntTruthy(bool truthy, const ValueOperand& value)
{ {
Register bi = value.payloadReg(); Register bi = value.payloadReg();

View file

@ -201,6 +201,17 @@ ICUnaryArith_Int32::Compiler::generateStubCode(MacroAssembler& masm)
// Compile -x as 0 - x. // Compile -x as 0 - x.
masm.as_rsb(R0.payloadReg(), R0.payloadReg(), Imm8(0)); masm.as_rsb(R0.payloadReg(), R0.payloadReg(), Imm8(0));
break; break;
case JSOP_INC: {
RegisterOrInt32Constant rval = RegisterOrInt32Constant(R0.payloadReg());
masm.inc32(&rval);
break;
}
case JSOP_DEC: {
RegisterOrInt32Constant rval = RegisterOrInt32Constant(R0.payloadReg());
masm.dec32(&rval);
break;
}
default: default:
MOZ_CRASH("Unexpected op"); MOZ_CRASH("Unexpected op");
} }

View file

@ -91,6 +91,7 @@ if CONFIG['LIBJPEG_TURBO_ASFLAGS']:
'simd/arm/jidctred-neon.c', 'simd/arm/jidctred-neon.c',
'simd/arm/jquanti-neon.c', 'simd/arm/jquanti-neon.c',
] ]
CFLAGS += ['-mfpu=neon']
elif CONFIG['CPU_ARCH'] == 'aarch64': elif CONFIG['CPU_ARCH'] == 'aarch64':
SOURCES += [ SOURCES += [
'simd/jsimd_arm64.c', 'simd/jsimd_arm64.c',

View file

@ -64,7 +64,7 @@
'defines': [ 'defines': [
'LIBYUV_NEON', 'LIBYUV_NEON',
], ],
'cflags!': [ 'cflags_mozilla!': [
'-mfpu=vfp', '-mfpu=vfp',
'-mfpu=vfpv3', '-mfpu=vfpv3',
'-mfpu=vfpv3-d16', '-mfpu=vfpv3-d16',
@ -73,14 +73,14 @@
'conditions': [ 'conditions': [
# Disable LTO in libyuv_neon target due to gcc 4.9 compiler bug. # Disable LTO in libyuv_neon target due to gcc 4.9 compiler bug.
['clang == 0 and use_lto == 1', { ['clang == 0 and use_lto == 1', {
'cflags!': [ 'cflags_mozilla!': [
'-flto', '-flto',
'-ffat-lto-objects', '-ffat-lto-objects',
], ],
}], }],
# arm64 does not need -mfpu=neon option as neon is not optional # arm64 does not need -mfpu=neon option as neon is not optional
['target_arch != "arm64"', { ['target_arch != "arm64"', {
'cflags': [ 'cflags_mozilla': [
'-mfpu=neon', '-mfpu=neon',
# '-marm', # arm32 not thumb # '-marm', # arm32 not thumb
], ],

View file

@ -20,10 +20,26 @@ libyuv_non_unified_sources = [
'source/scale_common.cc', 'source/scale_common.cc',
'source/scale_uv.cc', 'source/scale_uv.cc',
] ]
if CONFIG['CPU_ARCH'] == 'arm':
libyuv_non_unified_sources += [
'source/compare_neon.cc',
'source/rotate_neon.cc',
'source/row_neon.cc',
'source/scale_neon.cc',
]
if CONFIG['CPU_ARCH'] == 'aarch64':
libyuv_non_unified_sources += [
'source/compare_neon64.cc',
'source/rotate_neon64.cc',
'source/row_neon64.cc',
'source/scale_neon64.cc',
]
GYP_DIRS['.'].input = 'libyuv.gyp' GYP_DIRS['.'].input = 'libyuv.gyp'
GYP_DIRS['.'].variables = gyp_vars GYP_DIRS['.'].variables = gyp_vars
GYP_DIRS['.'].sandbox_vars['FINAL_LIBRARY'] = 'xul' GYP_DIRS['.'].sandbox_vars['FINAL_LIBRARY'] = 'xul'
GYP_DIRS['.'].non_unified_sources += libyuv_non_unified_sources GYP_DIRS['.'].non_unified_sources += sorted(libyuv_non_unified_sources)
# We allow warnings for third-party code that can be updated from upstream. # We allow warnings for third-party code that can be updated from upstream.
GYP_DIRS['.'].sandbox_vars['ALLOW_COMPILER_WARNINGS'] = True GYP_DIRS['.'].sandbox_vars['ALLOW_COMPILER_WARNINGS'] = True

View file

@ -2943,7 +2943,7 @@ if test -z "$MOZ_SYSTEM_LIBVPX"; then
dnl These flags are a lie; they're just used to enable the requisite dnl These flags are a lie; they're just used to enable the requisite
dnl opcodes; actual arch detection is done at runtime. dnl opcodes; actual arch detection is done at runtime.
VPX_ASFLAGS="-march=armv7-a -mfpu=neon" VPX_ASFLAGS="-march=armv7-a -mfpu=neon"
VPX_AS_CONVERSION='$(PERL) $(topsrcdir)/media/libvpx/build/make/ads2gas.pl' VPX_AS_CONVERSION='$(PERL) $(topsrcdir)/media/libvpx/libvpx/build/make/ads2gas.pl'
VPX_ARM_ASM=1 VPX_ARM_ASM=1
dnl Building with -mfpu=neon requires either the "softfp" or the dnl Building with -mfpu=neon requires either the "softfp" or the
dnl "hardfp" ABI. Depending on the compiler's default target, and the dnl "hardfp" ABI. Depending on the compiler's default target, and the