15template <u
int Value, u
int Mask>
21 mPrevState = _mm_getcsr();
22 _mm_setcsr((mPrevState & ~Mask) | Value);
27 _mm_setcsr((_mm_getcsr() & ~Mask) | (mPrevState & Mask));
34#elif defined(JPH_CPU_ARM) && defined(JPH_COMPILER_MSVC)
38template <
unsigned int Value,
unsigned int Mask>
45 _controlfp_s(&mPrevState, 0, 0);
49 _controlfp_s(&dummy, Value, Mask);
56 _controlfp_s(&dummy, mPrevState, Mask);
60 unsigned int mPrevState;
63#elif defined(JPH_CPU_ARM) && defined(JPH_USE_NEON)
67template <u
int64 Value, u
int64 Mask>
74 asm volatile(
"mrs %0, fpcr" :
"=r" (val));
78 asm volatile(
"msr fpcr, %0" : :
"r" (val));
84 asm volatile(
"mrs %0, fpcr" :
"=r" (val));
86 val |= mPrevState & Mask;
87 asm volatile(
"msr fpcr, %0" : :
"r" (val));
94#elif defined(JPH_CPU_ARM)
98template <u
int32 Value, u
int32 Mask>
105 asm volatile(
"vmrs %0, fpscr" :
"=r" (val));
109 asm volatile(
"vmsr fpscr, %0" : :
"r" (val));
115 asm volatile(
"vmrs %0, fpscr" :
"=r" (val));
117 val |= mPrevState & Mask;
118 asm volatile(
"vmsr fpscr, %0" : :
"r" (val));
125#elif defined(JPH_CPU_WASM)
131#error Unsupported CPU architecture
std::uint64_t uint64
Definition Core.h:430
unsigned int uint
Definition Core.h:426
#define JPH_NAMESPACE_END
Definition Core.h:354
std::uint32_t uint32
Definition Core.h:429
#define JPH_NAMESPACE_BEGIN
Definition Core.h:348
Class that makes another class non-copyable. Usage: Inherit from NonCopyable.
Definition NonCopyable.h:11