Merge pull request #475 from rmottola/master

Intel patches from @rmottola
This commit is contained in:
Cameron Kaiser 2018-02-19 09:24:41 -08:00 committed by GitHub
commit bd99fc9bfa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 108 additions and 20 deletions

View File

@ -71,7 +71,9 @@ if CONFIG['MOZ_LINKER']:
if CONFIG['HAVE_CLOCK_MONOTONIC']: if CONFIG['HAVE_CLOCK_MONOTONIC']:
OS_LIBS += CONFIG['REALTIME_LIBS'] OS_LIBS += CONFIG['REALTIME_LIBS']
OS_LIBS += ['-Wl,-stack_size,0x40000000,-stack_addr,0xf0000000'] # we build only on Darwin anyway
if CONFIG['OS_ARCH'] == 'Darwin' and CONFIG['CPU_TYPE'] == 'ppc':
OS_LIBS += ['-Wl,-stack_size,0x40000000,-stack_addr,0xf0000000']
if CONFIG['GNU_CXX']: if CONFIG['GNU_CXX']:
CXXFLAGS += ['-Wshadow'] CXXFLAGS += ['-Wshadow']

View File

@ -8136,6 +8136,9 @@ else
MOZ_ENABLE_SKIA= MOZ_ENABLE_SKIA=
fi fi
dnl force disabling of SKIA totally for FFF, to be optionally re-enabled later
MOZ_ENABLE_SKIA=
MOZ_ARG_ENABLE_BOOL(skia, MOZ_ARG_ENABLE_BOOL(skia,
[ --enable-skia Enable use of Skia], [ --enable-skia Enable use of Skia],
MOZ_ENABLE_SKIA=1, MOZ_ENABLE_SKIA=1,

View File

@ -479,16 +479,16 @@ MacOSFontEntry::GetFontTable(uint32_t aTag)
if (fontRef == kInvalidFont) return nullptr; if (fontRef == kInvalidFont) return nullptr;
ByteCount dataLength = 0; ByteCount dataLength = 0;
if (!mIsDataUserFont || mIsLocalUserFont) TryGlobalFontTableCache(); if (!mIsDataUserFont || mIsLocalUserFont) TryGlobalFontTableCache();
// See if we already know how long the table is. This saves a potentially // See if we already know how long the table is. This saves a potentially
// expensive call to ATSGetFontTable() to simply get the length. // expensive call to ATSGetFontTable() to simply get the length.
// Essentially a hardcoded form of FindTagInTableDir; see below. // Essentially a hardcoded form of FindTagInTableDir; see below.
if (MOZ_LIKELY(mFontTableDirSize > 0)) { if (MOZ_LIKELY(mFontTableDirSize > 0)) {
// XXX: This assumes big endian (warning Intel) uint32_t aTagHE = aTag;
#ifndef __ppc__ #ifndef __ppc__
#warning needs GetFontTable fast path needs little endian version aTagHE = __builtin_bswap32(aTag);
#endif #endif
#ifdef DEBUG_X #ifdef DEBUG_X
@ -500,19 +500,23 @@ MacOSFontEntry::GetFontTable(uint32_t aTag)
uint32_t i; uint32_t i;
uint32_t *wtable = (reinterpret_cast<uint32_t *>( uint32_t *wtable = (reinterpret_cast<uint32_t *>(
mFontTableDir.Elements())); mFontTableDir.Elements()));
for (i=3; i<(mFontTableDirSize/4); i+=4) { // Skip header for (i=3; i<(mFontTableDirSize/4); i+=4) { // Skip header
#ifdef DEBUG_X #ifdef DEBUG_X
char tag[5] = { table[j], table[j+1], table[j+2], table[j+3], char tag[5] = { table[j], table[j+1], table[j+2], table[j+3],
'\0' }; '\0' };
fprintf(stderr, "%s ", tag); // remember: big endian fprintf(stderr, "%s ", tag); // remember: host endian
j += 16; j += 16;
#endif #endif
// ASSUME THAT aTag is already big endian // ASSUME THAT aTag is in host endianness
if(wtable[i] == aTag) { if(wtable[i] == aTagHE) {
#ifdef DEBUG_X
fprintf(stderr, "MATCH: length %i\n", wtable[i+3]);
#endif
dataLength = (ByteCount)wtable[i+3]; dataLength = (ByteCount)wtable[i+3];
#ifndef __ppc__
dataLength = __builtin_bswap32(dataLength);
#endif
#ifdef DEBUG_X
fprintf(stderr, "FF MATCH: length %u\n", dataLength);
#endif
break; break;
} }
} }
@ -559,6 +563,11 @@ static bool FindTagInTableDir(FallibleTArray<uint8_t>& table,
// corresponding to the tag, checksum, offset and length, with a // corresponding to the tag, checksum, offset and length, with a
// 96 bit header (three 32-bit words). One day we could even write // 96 bit header (three 32-bit words). One day we could even write
// an AltiVec version ... // an AltiVec version ...
// aTableTag is expected to be Big Endian order
#ifndef __ppc__
aTableTag = __builtin_bswap32(aTableTag);
#endif
#ifdef DEBUG_X #ifdef DEBUG_X
fprintf(stderr, "Tables: "); fprintf(stderr, "Tables: ");
uint32_t j = 12; uint32_t j = 12;
@ -571,7 +580,7 @@ static bool FindTagInTableDir(FallibleTArray<uint8_t>& table,
fprintf(stderr, "%s ", tag); // remember: big endian fprintf(stderr, "%s ", tag); // remember: big endian
j+=16; j+=16;
#endif #endif
// ASSUME THAT aTableTag is already big endian // ASSUME THAT aTableTag is already big endian (we converted it in case)
if(wtable[i] == aTableTag) { if(wtable[i] == aTableTag) {
#ifdef DEBUG_X #ifdef DEBUG_X
fprintf(stderr, "MATCH\n"); fprintf(stderr, "MATCH\n");

24
intel-Yonah.mozcfg Normal file
View File

@ -0,0 +1,24 @@
. $topsrcdir/browser/config/mozconfig
export CC="/opt/local/bin/gcc-mp-4.8 -flax-vector-conversions -O3 -m32 -march=pentium-m -read_only_relocs suppress -mdynamic-no-pic"
export CXX="/opt/local/bin/g++-mp-4.8 -flax-vector-conversions -fpermissive -O3 -m32 -march=pentium-m -read_only_relocs suppress -mdynamic-no-pic"
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-ff-dbg
mk_add_options MOZ_MAKE_FLAGS="-s -j2"
mk_add_options AUTOCONF=autoconf213
ac_add_options --disable-tests
ac_add_options --disable-static
ac_add_options --enable-optimize
ac_add_options --disable-cpp-exceptions
ac_add_options --disable-debug
ac_add_options --disable-crashreporter
ac_add_options --enable-printing
ac_add_options --enable-prebinding
ac_add_options --enable-macos-target=10.4
ac_add_options --enable-chrome-format=jar
ac_add_options --with-macos-sdk=/Developer/SDKs/MacOSX10.4u.sdk
ac_add_options --enable-strip
ac_add_options --enable-install-strip
ac_add_options --with-distribution-id=com.floodgap
ac_add_options --enable-webrtc
ac_add_options --disable-ion
ac_add_options --disable-ctypes

View File

@ -3161,13 +3161,17 @@ elif test "$CPU_ARCH" = "mips32"; then
elif test "$CPU_ARCH" = "mips64"; then elif test "$CPU_ARCH" = "mips64"; then
AC_DEFINE(JS_CODEGEN_MIPS64) AC_DEFINE(JS_CODEGEN_MIPS64)
JS_CODEGEN_MIPS64=1 JS_CODEGEN_MIPS64=1
elif test "$CPU_ARCH" = "ppc"; then
AC_DEFINE(JS_CODEGEN_PPC_OSX)
JS_CODEGEN_PPC_OSX=1
elif test "$CPU_ARCH" = "ppc64"; then
AC_DEFINE(JS_CODEGEN_PPC_OSX)
JS_CODEGEN_PPC_OSX=1
fi fi
dnl Hey, Mozilla, bite me. dnl Hey, Mozilla, bite me.
dnl Eventually we will expunge the old JS_CPU_PPC_OSX. dnl Eventually we will expunge the old JS_CPU_PPC_OSX.
dnl dnl
AC_DEFINE(JS_CODEGEN_PPC_OSX)
JS_CODEGEN_PPC_OSX=1
AC_SUBST(JS_CODEGEN_PPC_OSX) AC_SUBST(JS_CODEGEN_PPC_OSX)
AC_SUBST(JS_CPU_PPC_OSX) AC_SUBST(JS_CPU_PPC_OSX)

View File

@ -315,7 +315,9 @@ NativeRegExpMacroAssembler::GenerateCode(JSContext* cx, bool match_only)
masm.jump(&start_label_); masm.jump(&start_label_);
// Exit code: // Exit code:
#if defined(JS_CODEGEN_PPC_OSX)
BufferOffset bo_exit1, bo_exit2; BufferOffset bo_exit1, bo_exit2;
#endif
if (success_label_.used()) { if (success_label_.used()) {
MOZ_ASSERT(num_saved_registers_ > 0); MOZ_ASSERT(num_saved_registers_ > 0);

View File

@ -2542,7 +2542,7 @@ ICGetElem_Arguments::Compiler::generateStubCode(MacroAssembler& masm)
AllocatableGeneralRegisterSet regs(availableGeneralRegs(2)); AllocatableGeneralRegisterSet regs(availableGeneralRegs(2));
Register scratchReg = regs.takeAny(); Register scratchReg = regs.takeAny();
#if(0) #ifndef JS_CODEGEN_PPC_OSX
// Guard on input being an arguments object. // Guard on input being an arguments object.
masm.branchTestObject(Assembler::NotEqual, R0, &failure); masm.branchTestObject(Assembler::NotEqual, R0, &failure);
Register objReg = masm.extractObject(R0, ExtractTemp0); Register objReg = masm.extractObject(R0, ExtractTemp0);

View File

@ -1029,7 +1029,9 @@ CodeGenerator::visitValueToString(LValueToString* lir)
StoreRegisterTo(output)); StoreRegisterTo(output));
Label done; Label done;
#ifdef JS_CODEGEN_PPC_OSX
BufferOffset bo_done1, bo_done2, bo_done3, bo_done4, bo_done5, bo_done6; BufferOffset bo_done1, bo_done2, bo_done3, bo_done4, bo_done5, bo_done6;
#endif
Register tag = masm.splitTagForTest(input); Register tag = masm.splitTagForTest(input);
const JSAtomState& names = GetJitContext()->runtime->names(); const JSAtomState& names = GetJitContext()->runtime->names();

View File

@ -310,20 +310,40 @@ MacroAssembler::loadFromTypedArray(Scalar::Type arrayType, const T& src, AnyRegi
load8ZeroExtend(src, dest.gpr()); load8ZeroExtend(src, dest.gpr());
break; break;
case Scalar::Int16: case Scalar::Int16:
#if defined(JS_CODEGEN_PPC_OSX)
load16SignExtendSwapped(src, dest.gpr()); load16SignExtendSwapped(src, dest.gpr());
#elif defined(JS_CODEGEN_X86)
load16SignExtend(src, dest.gpr());
#endif
break; break;
case Scalar::Uint16: case Scalar::Uint16:
#if defined(JS_CODEGEN_PPC_OSX)
load16ZeroExtendSwapped(src, dest.gpr()); load16ZeroExtendSwapped(src, dest.gpr());
#elif defined(JS_CODEGEN_X86)
load16ZeroExtend(src, dest.gpr());
#endif
break; break;
case Scalar::Int32: case Scalar::Int32:
#if defined(JS_CODEGEN_PPC_OSX)
load32ByteSwapped(src, dest.gpr()); load32ByteSwapped(src, dest.gpr());
#elif defined(JS_CODEGEN_X86)
load32Byte(src, dest.gpr());
#endif
break; break;
case Scalar::Uint32: case Scalar::Uint32:
if (dest.isFloat()) { if (dest.isFloat()) {
#if defined(JS_CODEGEN_PPC_OSX)
load32ByteSwapped(src, temp); load32ByteSwapped(src, temp);
#elif defined(JS_CODEGEN_X86)
load32Byte(src, temp);
#endif
convertUInt32ToDouble(temp, dest.fpu()); convertUInt32ToDouble(temp, dest.fpu());
} else { } else {
#if defined(JS_CODEGEN_PPC_OSX)
load32ByteSwapped(src, dest.gpr()); load32ByteSwapped(src, dest.gpr());
#elif defined(JS_CODEGEN_X86)
load32Byte(src, temp);
#endif
// Bail out if the value doesn't fit into a signed int32 value. This // Bail out if the value doesn't fit into a signed int32 value. This
// is what allows MLoadUnboxedScalar to have a type() of // is what allows MLoadUnboxedScalar to have a type() of
@ -491,7 +511,11 @@ MacroAssembler::loadFromTypedArray(Scalar::Type arrayType, const T& src, const V
break; break;
case Scalar::Uint32: case Scalar::Uint32:
// Don't clobber dest when we could fail, instead use temp. // Don't clobber dest when we could fail, instead use temp.
#if defined(JS_CODEGEN_PPC_OSX)
load32ByteSwapped(src, temp); load32ByteSwapped(src, temp);
#elif defined(JS_CODEGEN_X86)
load32(src, temp);
#endif
if (allowDouble) { if (allowDouble) {
// If the value fits in an int32, store an int32 type tag. // If the value fits in an int32, store an int32 type tag.
// Else, convert the value to double and box it. // Else, convert the value to double and box it.

View File

@ -1109,11 +1109,19 @@ private:
break; break;
case Scalar::Int16: case Scalar::Int16:
case Scalar::Uint16: case Scalar::Uint16:
#if defined(JS_CODEGEN_PPC_OSX)
store16Swapped(value, dest); store16Swapped(value, dest);
#elif defined(JS_CODEGEN_X86)
store16(value, dest);
#endif
break; break;
case Scalar::Int32: case Scalar::Int32:
case Scalar::Uint32: case Scalar::Uint32:
#if defined(JS_CODEGEN_PPC_OSX)
store32ByteSwapped(value, dest); store32ByteSwapped(value, dest);
#elif defined(JS_CODEGEN_X86)
store32(value, dest);
#endif
break; break;
default: default:
MOZ_CRASH("Invalid typed array type"); MOZ_CRASH("Invalid typed array type");

View File

@ -126,7 +126,7 @@ IsAnyTypedArrayClass(const Class* clasp)
class SharedOps class SharedOps
{ {
public: public:
#if(0) #ifndef JS_CODEGEN_PPC_OSX
template<typename T> template<typename T>
static T load(SharedMem<T*> addr) { static T load(SharedMem<T*> addr) {
return js::jit::AtomicOperations::loadSafeWhenRacy(addr); return js::jit::AtomicOperations::loadSafeWhenRacy(addr);
@ -214,7 +214,7 @@ class SharedOps
class UnsharedOps class UnsharedOps
{ {
public: public:
#if(0) #ifndef JS_CODEGEN_PPC_OSX
template<typename T> template<typename T>
static T load(SharedMem<T*> addr) { static T load(SharedMem<T*> addr) {
return *addr.unwrapUnshared(); return *addr.unwrapUnshared();

View File

@ -187,10 +187,11 @@ endif
ifeq ($(OS_TARGET),Darwin) ifeq ($(OS_TARGET),Darwin)
ifeq ($(CPU_ARCH),x86) ifeq ($(CPU_ARCH),x86)
ASFILES = mpi_sse2.s # Disable SSE2 since it causes assembler and linker issues
# ASFILES = mpi_sse2.s
DEFINES += -DMP_USE_UINT_DIGIT DEFINES += -DMP_USE_UINT_DIGIT
DEFINES += -DMP_ASSEMBLY_MULTIPLY -DMP_ASSEMBLY_SQUARE # DEFINES += -DMP_ASSEMBLY_MULTIPLY -DMP_ASSEMBLY_SQUARE
DEFINES += -DMP_ASSEMBLY_DIV_2DX1D # DEFINES += -DMP_ASSEMBLY_DIV_2DX1D
endif endif
endif # Darwin endif # Darwin

View File

@ -188,13 +188,22 @@ main(int argc, char **argv)
} }
} }
#if (MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4)
[fileClerk removeFileAtPath: myWebRTPath handler:nil];
#else
[fileClerk removeItemAtPath: myWebRTPath error: &errorDesc]; [fileClerk removeItemAtPath: myWebRTPath error: &errorDesc];
#endif
if (errorDesc != nil) { if (errorDesc != nil) {
NSLog(@"failed to unlink old binary file at path: %@ with error: %@", myWebRTPath, errorDesc); NSLog(@"failed to unlink old binary file at path: %@ with error: %@", myWebRTPath, errorDesc);
@throw MakeException(@"Unable To Update", @"Failed preparation for Web Runtime update"); @throw MakeException(@"Unable To Update", @"Failed preparation for Web Runtime update");
} }
#if (MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4)
[fileClerk copyPath: newWebRTPath toPath: myWebRTPath handler:nil];
#else
[fileClerk copyItemAtPath: newWebRTPath toPath: myWebRTPath error: &errorDesc]; [fileClerk copyItemAtPath: newWebRTPath toPath: myWebRTPath error: &errorDesc];
#endif
[fileClerk release]; [fileClerk release];
if (errorDesc != nil) { if (errorDesc != nil) {
NSLog(@"failed to copy new webrt file: %@", errorDesc); NSLog(@"failed to copy new webrt file: %@", errorDesc);