mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 13:51:41 +00:00
Bug 1063754. Cache result of Factory::HasSSE2(). r=bas
--HG-- extra : rebase_source : 3d25afdc6d679303ea1b73cc9ef1dbd9b971c5c0
This commit is contained in:
parent
8432077b40
commit
b54cad168f
@ -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