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_USE_SSE)
14
16class FPExceptionsEnable : public FPControlWord<0, _MM_MASK_DIV_ZERO | _MM_MASK_INVALID> { };
17
19class FPExceptionDisableInvalid : public FPControlWord<_MM_MASK_INVALID, _MM_MASK_INVALID> { };
20
22class FPExceptionDisableDivByZero : public FPControlWord<_MM_MASK_DIV_ZERO, _MM_MASK_DIV_ZERO> { };
23
24#elif defined(JPH_CPU_ARM) && defined(JPH_COMPILER_MSVC)
25
27class FPExceptionsEnable : public FPControlWord<0, _EM_INVALID | _EM_ZERODIVIDE> { };
28
30class FPExceptionDisableInvalid : public FPControlWord<_EM_INVALID, _EM_INVALID> { };
31
33class FPExceptionDisableDivByZero : public FPControlWord<_EM_ZERODIVIDE, _EM_ZERODIVIDE> { };
34
35#elif defined(JPH_CPU_ARM)
36
38static constexpr uint64 FP_IOE = 1 << 8;
39
41static constexpr uint64 FP_DZE = 1 << 9;
42
44class FPExceptionsEnable : public FPControlWord<FP_IOE | FP_DZE, FP_IOE | FP_DZE> { };
45
47class FPExceptionDisableInvalid : public FPControlWord<0, FP_IOE> { };
48
50class FPExceptionDisableDivByZero : public FPControlWord<0, FP_DZE> { };
51
52#elif defined(JPH_CPU_WASM)
53
54// Not supported
55class FPExceptionsEnable { };
58
59#else
60
61#error Unsupported CPU architecture
62
63#endif
64
65#else
66
71
72#endif
73
#define JPH_NAMESPACE_END
Definition: Core.h:240
uint64_t uint64
Definition: Core.h:313
#define JPH_NAMESPACE_BEGIN
Definition: Core.h:234
Definition: FPException.h:70
Definition: FPException.h:69
Dummy implementations.
Definition: FPException.h:68