Merge pull request #455 from rmottola/master

Intel fixes from rmottola
This commit is contained in:
Cameron Kaiser 2017-12-19 18:43:32 -08:00 committed by GitHub
commit c7ce866bf1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 30 additions and 14 deletions

View File

@ -257,7 +257,8 @@ PluginInstanceChild::DoNPP_New()
Initialize();
#if defined(XP_MACOSX) && defined(__i386__)
#if 0
//#if defined(XP_MACOSX) && defined(__i386__)
// If an i386 Mac OS X plugin has selected the Carbon event model then
// we have to fail. We do not support putting Carbon event model plugins
// out of process. Note that Carbon is the default model so out of process

View File

@ -218,6 +218,12 @@ struct writeBuf
int offset;
};
#ifdef __ppc__
#define TAG_CFF 0x43464620
#else
#define TAG_CFF 0x20464643
#endif
bool
ScaledFontMac::GetFontFileData(FontFileDataOutput aDataCallback, void *aBaton)
{
@ -233,7 +239,7 @@ ScaledFontMac::GetFontFileData(FontFileDataOutput aDataCallback, void *aBaton)
bool CFF = false;
for (CFIndex i = 0; i<count; i++) {
uint32_t tag = (uint32_t)(uintptr_t)CFArrayGetValueAtIndex(tags, i);
if (tag == 0x43464620) // 'CFF '
if (tag == TAG_CFF) // 'CFF '
CFF = true;
CFDataRef data = CGFontCopyTableForTag(mFont, tag);
records[i].tag = tag;
@ -283,11 +289,8 @@ ScaledFontMac::GetFontFileData(FontFileDataOutput aDataCallback, void *aBaton)
uint32_t *wtable = (reinterpret_cast<uint32_t *>(table.Elements()));
TableRecord *records = new TableRecord[count];
for (uint32_t i=3; i<(sizer/4); i+=4) { // Skip header
#ifndef __ppc__
#error need little-endian version
#endif
uint32_t tag = wtable[i];
if (tag == 0x43464620) // 'CFF '
if (tag == TAG_CFF)
CFF = true;
// We know the length from the directory, so we can simply import
// the data. We assume the table exists, and OMG if it doesn't.

View File

@ -488,7 +488,7 @@ MacOSFontEntry::GetFontTable(uint32_t aTag)
if (MOZ_LIKELY(mFontTableDirSize > 0)) {
// XXX: This assumes big endian (warning Intel)
#ifndef __ppc__
#error needs GetFontTable fast path needs little endian version
#warning needs GetFontTable fast path needs little endian version
#endif
#ifdef DEBUG_X

View File

@ -72,8 +72,10 @@ inline int Log2Floor(uint32 n) {
#endif /* endianness */
#endif /* CPU whitelist */
#if !defined(__i386) && !defined(__x86_64__)
#ifndef WOFF_BIG_ENDIAN
#error unexpected endianness
#endif
#endif /* !defined(__i386) && !defined(__x86_64__) */
#endif // WOFF2_PORT_H_

View File

@ -37,6 +37,14 @@
#include <ucontext.h>
#endif
#ifdef XP_MACOSX
#ifndef __ppc__
#include <sys/ucontext.h>
#include <mach/mach_types.h>
#include <mach/thread_status.h>
#endif
#endif
static char _progname[1024] = "huh?";
// Note: some tests manipulate this value.
@ -160,14 +168,14 @@ static void fpehandler(int signum, siginfo_t *si, void *context)
ucontext_t *uc = (ucontext_t *)context;
#if defined(__i386__) || defined(__amd64__)
_STRUCT_FP_CONTROL *ctrl = &uc->uc_mcontext->__fs.__fpu_fcw;
ctrl->__invalid = ctrl->__denorm = ctrl->__zdiv = ctrl->__ovrfl = ctrl->__undfl = ctrl->__precis = 1;
fp_control *ctrl = &uc->uc_mcontext->fs.fpu_fcw;
ctrl->invalid = ctrl->denorm = ctrl->zdiv = ctrl->ovrfl = ctrl->undfl = ctrl->precis = 1;
_STRUCT_FP_STATUS *status = &uc->uc_mcontext->__fs.__fpu_fsw;
status->__invalid = status->__denorm = status->__zdiv = status->__ovrfl = status->__undfl =
status->__precis = status->__stkflt = status->__errsumm = 0;
fp_status *status = &uc->uc_mcontext->fs.fpu_fsw;
status->invalid = status->denorm = status->zdiv = status->ovrfl = status->undfl =
status->precis = status->stkflt = status->errsumm = 0;
uint32_t *mxcsr = &uc->uc_mcontext->__fs.__fpu_mxcsr;
uint32_t *mxcsr = &uc->uc_mcontext->fs.fpu_mxcsr;
*mxcsr |= SSE_EXCEPTION_MASK; /* disable all SSE exceptions */
*mxcsr &= ~SSE_STATUS_FLAGS; /* clear all pending SSE exceptions */
#endif

View File

@ -12,7 +12,8 @@
#include "nscore.h"
#include "mozilla/Assertions.h"
#if MOZILLA_MAY_SUPPORT_SSE2
#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
#include "mozilla/SSE.h"
#endif

View File

@ -48,6 +48,7 @@ using namespace mozilla;
#ifdef XP_MACOSX
typedef int cpu_type_t; // we don't have cpu_type* on 10.4.
#define CPU_TYPE_ANY ((cpu_type_t) -1)
#define CPU_TYPE_X86 ((cpu_type_t) 7)
#define CPU_TYPE_POWERPC ((cpu_type_t) 18)
cpu_type_t pref_cpu_types[2] = {