Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
FPException.h
Go to the documentation of this file.
1// Jolt Physics Library (https://github.com/jrouwe/JoltPhysics)
2// SPDX-FileCopyrightText: 2021 Jorrit Rouwe
3// SPDX-License-Identifier: MIT
4
5#pragma once
6
8
10
11#ifdef JPH_FLOATING_POINT_EXCEPTIONS_ENABLED
12
13#if defined(JPH_CPU_WASM)
14
15// Not supported
16class FPExceptionsEnable { };
19
20#elif defined(JPH_USE_SSE)
21
23class FPExceptionsEnable : public FPControlWord<0, _MM_MASK_DIV_ZERO | _MM_MASK_INVALID> { };
24
26class FPExceptionDisableInvalid : public FPControlWord<_MM_MASK_INVALID, _MM_MASK_INVALID> { };
27
29class FPExceptionDisableDivByZero : public FPControlWord<_MM_MASK_DIV_ZERO, _MM_MASK_DIV_ZERO> { };
30
31#elif defined(JPH_CPU_ARM) && defined(JPH_COMPILER_MSVC)
32
34class FPExceptionsEnable : public FPControlWord<0, _EM_INVALID | _EM_ZERODIVIDE> { };
35
37class FPExceptionDisableInvalid : public FPControlWord<_EM_INVALID, _EM_INVALID> { };
38
40class FPExceptionDisableDivByZero : public FPControlWord<_EM_ZERODIVIDE, _EM_ZERODIVIDE> { };
41
42#elif defined(JPH_CPU_ARM)
43
45static constexpr uint64 FP_IOE = 1 << 8;
46
48static constexpr uint64 FP_DZE = 1 << 9;
49
51class FPExceptionsEnable : public FPControlWord<FP_IOE | FP_DZE, FP_IOE | FP_DZE> { };
52
54class FPExceptionDisableInvalid : public FPControlWord<0, FP_IOE> { };
55
57class FPExceptionDisableDivByZero : public FPControlWord<0, FP_DZE> { };
58
59#else
60
61#error Unsupported CPU architecture
62
63#endif
64
65#else
66
71
72#endif
73
std::uint64_t uint64
Definition Core.h:457
#define JPH_NAMESPACE_END
Definition Core.h:379
#define JPH_NAMESPACE_BEGIN
Definition Core.h:373
Definition FPException.h:70
Definition FPException.h:69
Dummy implementations.
Definition FPException.h:68