mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1063754. Cache result of Factory::HasSSE2(). r=bas
--HG-- extra : rebase_source : 3d25afdc6d679303ea1b73cc9ef1dbd9b971c5c0
This commit is contained in:
parent
4297e80105
commit
eaae02626a
@ -178,7 +178,16 @@ Factory::HasSSE2()
|
||||
// cl.exe with -arch:SSE2 (default on x64 compiler)
|
||||
return true;
|
||||
#elif defined(HAVE_CPU_DETECTION)
|
||||
return HasCPUIDBit(1u, edx, (1u<<26));
|
||||
static enum {
|
||||
UNINITIALIZED,
|
||||
NO_SSE2,
|
||||
HAS_SSE2
|
||||
} sDetectionState = UNINITIALIZED;
|
||||
|
||||
if (sDetectionState == UNINITIALIZED) {
|
||||
sDetectionState = HasCPUIDBit(1u, edx, (1u<<26)) ? HAS_SSE2 : NO_SSE2;
|
||||
}
|
||||
return sDetectionState == HAS_SSE2;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user