summaryrefslogtreecommitdiff
path: root/Source/Core/Common
diff options
context:
space:
mode:
authorFiora <fioraaeterna@gmail.com>2014-10-11 14:22:44 -0700
committerFiora <fioraaeterna@gmail.com>2014-11-29 11:33:11 -0800
commit72c96c20d31327f0885bbbc7bf3fc104cd1b6e99 (patch)
treef4a0319814708f560c2f90018e73176fd7b4e0ab /Source/Core/Common
parent4e0591cdf19607c9f4e2852fbb270d1cef2a422b (diff)
JIT: more optimizing of float ops based on known input characteristics
If the inputs are both float singles, and the top half is known to be identical to the bottom half, we can use packed arithmetic instead of scalar to skip the movddup. This is slower on a few rather old CPUs, plus the Atom+Silvermont, so detect Atom and disable it in that case. Also avoid PPC_FP on stores if we know that the output came from a float op.
Diffstat (limited to 'Source/Core/Common')
-rw-r--r--Source/Core/Common/CPUDetect.h2
-rw-r--r--Source/Core/Common/x64CPUDetect.cpp6
2 files changed, 7 insertions, 1 deletions
diff --git a/Source/Core/Common/CPUDetect.h b/Source/Core/Common/CPUDetect.h
index 752d26afb2..c63076ff7b 100644
--- a/Source/Core/Common/CPUDetect.h
+++ b/Source/Core/Common/CPUDetect.h
@@ -50,10 +50,10 @@ struct CPUInfo
bool bMOVBE;
// This flag indicates that the hardware supports some mode
// in which denormal inputs _and_ outputs are automatically set to (signed) zero.
- // TODO: ARM
bool bFlushToZero;
bool bLAHFSAHF64;
bool bLongMode;
+ bool bAtom;
// ARM specific CPUInfo
bool bSwp;
diff --git a/Source/Core/Common/x64CPUDetect.cpp b/Source/Core/Common/x64CPUDetect.cpp
index 31409685e8..8ad8046c8b 100644
--- a/Source/Core/Common/x64CPUDetect.cpp
+++ b/Source/Core/Common/x64CPUDetect.cpp
@@ -129,6 +129,12 @@ void CPUInfo::Detect()
if (max_std_fn >= 1)
{
__cpuid(cpu_id, 0x00000001);
+ int family = ((cpu_id[0] >> 8) & 0xf) + ((cpu_id[0] >> 20) & 0xff);
+ int model = ((cpu_id[0] >> 4) & 0xf) + ((cpu_id[0] >> 12) & 0xf0);
+ // Detect people unfortunate enough to be running Dolphin on an Atom
+ if (family == 6 && (model == 0x1C || model == 0x26 ||model == 0x27 || model == 0x35 || model == 0x36 ||
+ model == 0x37 || model == 0x4A || model == 0x4D || model == 0x5A || model == 0x5D))
+ bAtom = true;
logical_cpu_count = (cpu_id[1] >> 16) & 0xFF;
ht = (cpu_id[3] >> 28) & 1;