summaryrefslogtreecommitdiff
path: root/Source/Core/Common/x64CPUDetect.cpp
diff options
context:
space:
mode:
authorTony Wasserka <neobrainx@gmail.com>2014-06-19 16:53:21 +0200
committerTony Wasserka <neobrainx@gmail.com>2014-06-19 16:53:21 +0200
commit0e0238eccfa314a24d11aa36c727c54e1ca90a2a (patch)
tree770a28d8d6107655c17523fb561ca41eb216f003 /Source/Core/Common/x64CPUDetect.cpp
parent9f22b2378de40c4059d5dc925ee1daad1b7b9e2d (diff)
parentee0c5bdc20f748417dd42663127bcfb9a60ebf1a (diff)
Merge pull request #498 from magumagu/remove-daz
Don't set DAZ on x86 in non-IEEE mode.
Diffstat (limited to 'Source/Core/Common/x64CPUDetect.cpp')
-rw-r--r--Source/Core/Common/x64CPUDetect.cpp29
1 files changed, 3 insertions, 26 deletions
diff --git a/Source/Core/Common/x64CPUDetect.cpp b/Source/Core/Common/x64CPUDetect.cpp
index e64cd9d1ee..8340344481 100644
--- a/Source/Core/Common/x64CPUDetect.cpp
+++ b/Source/Core/Common/x64CPUDetect.cpp
@@ -162,32 +162,10 @@ void CPUInfo::Detect()
if ((cpu_id[2] >> 22) & 1) bMOVBE = true;
if ((cpu_id[2] >> 25) & 1) bAES = true;
- // To check DAZ support, we first need to check FXSAVE support.
if ((cpu_id[3] >> 24) & 1)
{
// We can use FXSAVE.
bFXSR = true;
-
- GC_ALIGNED16(u8 fx_state[512]);
- memset(fx_state, 0, sizeof(fx_state));
-#ifdef _WIN32
-#if _M_X86_32
- _fxsave(fx_state);
-#elif _M_X86_64
- _fxsave64(fx_state);
-#endif
-#else
- __asm__("fxsave %0" : "=m" (fx_state));
-#endif
-
- // lowest byte of MXCSR_MASK
- if ((fx_state[0x1C] >> 6) & 1)
- {
- // On x86, the FTZ field (supported since SSE1) only flushes denormal _outputs_ to zero,
- // now that we checked DAZ support (flushing denormal _inputs_ to zero),
- // we can set our generic flag.
- bFlushToZero = true;
- }
}
// AVX support requires 3 separate checks:
@@ -204,6 +182,9 @@ void CPUInfo::Detect()
}
}
}
+
+ bFlushToZero = bSSE;
+
if (max_ex_fn >= 0x80000004) {
// Extract brand string
__cpuid(cpu_id, 0x80000002);
@@ -269,7 +250,3 @@ std::string CPUInfo::Summarize()
return sum;
}
-bool CPUInfo::IsUnsafe()
-{
- return !bFlushToZero;
-}