mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 451743 - On x86 processors, only use SSE2 if the processor supports it, otherwise default back to x87 FPU (r=gal, sr=mrbkap)
This commit is contained in:
parent
f0606ee551
commit
36ea645fbe
@ -117,6 +117,7 @@ static avmplus::AvmCore* core = &s_core;
|
||||
/* We really need a better way to configure the JIT. Shaver, where is my fancy JIT object? */
|
||||
static bool nesting_enabled = true;
|
||||
static bool oracle_enabled = true;
|
||||
static bool did_we_check_sse2 = false;
|
||||
|
||||
#ifdef DEBUG
|
||||
static bool verbose_debug = getenv("TRACEMONKEY") && strstr(getenv("TRACEMONKEY"), "verbose");
|
||||
@ -2167,9 +2168,44 @@ js_AbortRecording(JSContext* cx, jsbytecode* abortpc, const char* reason)
|
||||
}
|
||||
}
|
||||
|
||||
#if defined NANOJIT_IA32
|
||||
static bool
|
||||
js_CheckForSSE2()
|
||||
{
|
||||
int features = 0;
|
||||
#if defined _MSC_VER
|
||||
__asm
|
||||
{
|
||||
pushad
|
||||
mov eax, 1
|
||||
cpuid
|
||||
mov features, edx
|
||||
popad
|
||||
}
|
||||
#elif defined __GNUC__
|
||||
asm("pusha\n"
|
||||
"mov $0x01, %%eax\n"
|
||||
"cpuid\n"
|
||||
"mov %%edx, %0\n"
|
||||
"popa\n"
|
||||
: "=m" (features)
|
||||
: /* We have no inputs */
|
||||
: /* We don't clobber anything */
|
||||
);
|
||||
#endif
|
||||
return (features & (1<<26)) != 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
extern void
|
||||
js_InitJIT(JSTraceMonitor *tm)
|
||||
{
|
||||
#if defined NANOJIT_IA32
|
||||
if (!did_we_check_sse2) {
|
||||
avmplus::AvmCore::sse2_available = js_CheckForSSE2();
|
||||
did_we_check_sse2 = true;
|
||||
}
|
||||
#endif
|
||||
if (!tm->fragmento) {
|
||||
JS_ASSERT(!tm->globalSlots && !tm->globalTypeMap);
|
||||
Fragmento* fragmento = new (&gc) Fragmento(core, 24);
|
||||
|
@ -39,3 +39,5 @@ static GC _gc;
|
||||
GC* AvmCore::gc = &_gc;
|
||||
GCHeap GC::heap;
|
||||
String* AvmCore::k_str[] = { (String*)"" };
|
||||
bool AvmCore::sse2_available = false;
|
||||
|
||||
|
@ -394,11 +394,12 @@ namespace avmplus
|
||||
static AvmConfiguration config;
|
||||
static GC* gc;
|
||||
static String* k_str[];
|
||||
static bool sse2_available;
|
||||
|
||||
static inline bool
|
||||
use_sse2()
|
||||
{
|
||||
return true;
|
||||
return sse2_available;
|
||||
}
|
||||
|
||||
static inline bool
|
||||
|
Loading…
Reference in New Issue
Block a user