diff options
| author | pierre <pierre@pirsoft.de> | 2010-12-27 15:05:18 +0000 |
|---|---|---|
| committer | pierre <pierre@pirsoft.de> | 2010-12-27 15:05:18 +0000 |
| commit | c33f46406e60fb2a0cf6613fdd062c6934e4914b (patch) | |
| tree | c7d66e712eef12af64d12c03d32d4181d995e52e /Source/Core/Common | |
| parent | 0e737235a86c12c5291973b4d2286b7fe148ab23 (diff) | |
Core/DSPCore: Improve Interpreter address register add/sub, convert to
assembler for JIT. Replace JIT ToMask() with a different variant. Remove
superfluous zeroWriteBackLog calls(added by me).
Core/Common: Don't bother creating a string and calling into a Logs trigger()
when there is noone listening. Change AtomicLoadAcquire for gcc to just
make the compiler not reorder memory accesses around it instead of doing
a full memory barrier, per the comment in the win32 variant.
Core/AudioCommon: Fix a use of uninitialized variable inside libalsa.
Microbenchmarking results for ToMask variants:(1 000 000 000 iterations):
cpu\variant| shifts | bit scan
intel mobile C2D@2.5GHz | 5.5s | 4.0s
amd athlon64x2@3GHz | 6.1s | 6.4s
(including some constant overhead identical to both variants)
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6667 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/Common')
| -rw-r--r-- | Source/Core/Common/Src/Atomic_GCC.h | 8 | ||||
| -rw-r--r-- | Source/Core/Common/Src/LogManager.cpp | 2 | ||||
| -rw-r--r-- | Source/Core/Common/Src/LogManager.h | 1 |
3 files changed, 8 insertions, 3 deletions
diff --git a/Source/Core/Common/Src/Atomic_GCC.h b/Source/Core/Common/Src/Atomic_GCC.h index 363cf7a4f7..8eb2f5d818 100644 --- a/Source/Core/Common/Src/Atomic_GCC.h +++ b/Source/Core/Common/Src/Atomic_GCC.h @@ -57,8 +57,12 @@ inline u32 AtomicLoad(volatile u32& src) { return src; // 32-bit reads are always atomic. } inline u32 AtomicLoadAcquire(volatile u32& src) { - __sync_synchronize(); // TODO: May not be necessary. - return src; + //keep the compiler from caching any memory references + u32 result = src; // 32-bit reads are always atomic. + //__sync_synchronize(); // TODO: May not be necessary. + // Compiler instruction only. x86 loads always have acquire semantics. + __asm__ __volatile__ ( "":::"memory" ); + return result; } inline void AtomicOr(volatile u32& target, u32 value) { diff --git a/Source/Core/Common/Src/LogManager.cpp b/Source/Core/Common/Src/LogManager.cpp index 651cb01ad2..cdf9a99acb 100644 --- a/Source/Core/Common/Src/LogManager.cpp +++ b/Source/Core/Common/Src/LogManager.cpp @@ -116,7 +116,7 @@ void LogManager::Log(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type, char msg[MAX_MSGLEN * 2]; LogContainer *log = m_Log[type]; - if (! log->isEnable() || level > log->getLevel()) + if (! log->isEnable() || level > log->getLevel() || ! log->hasListeners()) return; CharArrayFromFormatV(temp, MAX_MSGLEN, format, args); diff --git a/Source/Core/Common/Src/LogManager.h b/Source/Core/Common/Src/LogManager.h index 7e247925c4..37a0ca3c45 100644 --- a/Source/Core/Common/Src/LogManager.h +++ b/Source/Core/Common/Src/LogManager.h @@ -89,6 +89,7 @@ public: void setLevel(LogTypes::LOG_LEVELS level) { m_level = level; } + bool hasListeners() const { return listeners.size() > 0; } private: char m_fullName[128]; |
