11#if defined(JPH_CPU_WASM)
15#elif defined(JPH_USE_SSE)
19template <u
int Value, u
int Mask>
25 mPrevState = _mm_getcsr();
26 _mm_setcsr((mPrevState & ~Mask) | Value);
31 _mm_setcsr((_mm_getcsr() & ~Mask) | (mPrevState & Mask));
38#elif defined(JPH_CPU_ARM) && defined(JPH_COMPILER_MSVC)
42template <
unsigned int Value,
unsigned int Mask>
49 _controlfp_s(&mPrevState, 0, 0);
53 _controlfp_s(&dummy, Value, Mask);
60 _controlfp_s(&dummy, mPrevState, Mask);
64 unsigned int mPrevState;
67#elif defined(JPH_CPU_ARM) && defined(JPH_USE_NEON)
71template <u
int64 Value, u
int64 Mask>
78 asm volatile(
"mrs %0, fpcr" :
"=r" (val));
82 asm volatile(
"msr fpcr, %0" : :
"r" (val));
88 asm volatile(
"mrs %0, fpcr" :
"=r" (val));
90 val |= mPrevState & Mask;
91 asm volatile(
"msr fpcr, %0" : :
"r" (val));
98#elif defined(JPH_CPU_ARM)
102template <u
int32 Value, u
int32 Mask>
109 asm volatile(
"vmrs %0, fpscr" :
"=r" (val));
113 asm volatile(
"vmsr fpscr, %0" : :
"r" (val));
119 asm volatile(
"vmrs %0, fpscr" :
"=r" (val));
121 val |= mPrevState & Mask;
122 asm volatile(
"vmsr fpscr, %0" : :
"r" (val));
131#error Unsupported CPU architecture
std::uint64_t uint64
Definition Core.h:457
unsigned int uint
Definition Core.h:453
#define JPH_NAMESPACE_END
Definition Core.h:379
std::uint32_t uint32
Definition Core.h:456
#define JPH_NAMESPACE_BEGIN
Definition Core.h:373
Class that makes another class non-copyable. Usage: Inherit from NonCopyable.
Definition NonCopyable.h:11