mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-12-12 10:37:02 +00:00
arm: flush denormals to zero
This commit is contained in:
parent
3c1f920d6c
commit
c5498cd010
1 changed files with 30 additions and 6 deletions
|
|
@ -15,6 +15,33 @@
|
||||||
|
|
||||||
#include "util/helpers/helpers.h"
|
#include "util/helpers/helpers.h"
|
||||||
|
|
||||||
|
#ifdef __arm64__
|
||||||
|
#if defined(__clang__)
|
||||||
|
#include <arm_acle.h>
|
||||||
|
#elif defined(_MSC_VER)
|
||||||
|
#include <intrin.h>
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
|
void enableFlushDenormalsToZero()
|
||||||
|
{
|
||||||
|
#if defined(ARCH_X86_64)
|
||||||
|
_mm_setcsr(_mm_getcsr() | 0x8000);
|
||||||
|
#elif defined(__arm64__)
|
||||||
|
#if defined(__clang__)
|
||||||
|
__arm_wsr64("fpcr", __arm_rsr64("fpcr") | (1 << 24));
|
||||||
|
#elif defined(__GNUC__)
|
||||||
|
__builtin_aarch64_set_fpcr(__builtin_aarch64_get_fpcr() | (1 << 24));
|
||||||
|
#elif defined(_MSC_VER)
|
||||||
|
_WriteStatusReg(ARM64_FPCR, _ReadStatusReg(ARM64_FPCR) | (1 << 24));
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
SlimRWLock srwlock_activeThreadList;
|
SlimRWLock srwlock_activeThreadList;
|
||||||
|
|
||||||
// public list of active threads
|
// public list of active threads
|
||||||
|
|
@ -1321,9 +1348,7 @@ namespace coreinit
|
||||||
#endif
|
#endif
|
||||||
OSHostThread* hostThread = (OSHostThread*)_thread;
|
OSHostThread* hostThread = (OSHostThread*)_thread;
|
||||||
|
|
||||||
#if defined(ARCH_X86_64)
|
enableFlushDenormalsToZero();
|
||||||
_mm_setcsr(_mm_getcsr() | 0x8000); // flush denormals to zero
|
|
||||||
#endif
|
|
||||||
|
|
||||||
PPCInterpreter_t* hCPU = &hostThread->ppcInstance;
|
PPCInterpreter_t* hCPU = &hostThread->ppcInstance;
|
||||||
__OSLoadThread(hostThread->m_thread, hCPU, hostThread->selectedCore);
|
__OSLoadThread(hostThread->m_thread, hCPU, hostThread->selectedCore);
|
||||||
|
|
@ -1369,9 +1394,8 @@ namespace coreinit
|
||||||
{
|
{
|
||||||
SetThreadName(fmt::format("OSSched[core={}]", (uintptr_t)_assignedCoreIndex).c_str());
|
SetThreadName(fmt::format("OSSched[core={}]", (uintptr_t)_assignedCoreIndex).c_str());
|
||||||
t_assignedCoreIndex = (sint32)(uintptr_t)_assignedCoreIndex;
|
t_assignedCoreIndex = (sint32)(uintptr_t)_assignedCoreIndex;
|
||||||
#if defined(ARCH_X86_64)
|
|
||||||
_mm_setcsr(_mm_getcsr() | 0x8000); // flush denormals to zero
|
enableFlushDenormalsToZero();
|
||||||
#endif
|
|
||||||
|
|
||||||
#if BOOST_OS_LINUX
|
#if BOOST_OS_LINUX
|
||||||
if (g_gdbstub)
|
if (g_gdbstub)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue