aboutsummaryrefslogtreecommitdiffstats
path: root/alc/fpu_modes.h
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2019-12-12 19:21:00 +0100
committerSven Gothel <[email protected]>2019-12-12 19:21:00 +0100
commit4df06c6894b39af5bf4681c0acf0c1c080084c80 (patch)
tree2505eb6e3b5798db34033c4cac2d4613bf6bda44 /alc/fpu_modes.h
parent8915501ed02eac2b3bce9a7fc06cb1ab562901c3 (diff)
parentc0cf323e1d56ce605e90927324d2fdafcfbb564a (diff)
merge v1.20.0
Diffstat (limited to 'alc/fpu_modes.h')
-rw-r--r--alc/fpu_modes.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/alc/fpu_modes.h b/alc/fpu_modes.h
new file mode 100644
index 00000000..5465e9cf
--- /dev/null
+++ b/alc/fpu_modes.h
@@ -0,0 +1,25 @@
+#ifndef FPU_MODES_H
+#define FPU_MODES_H
+
+class FPUCtl {
+#if defined(HAVE_SSE_INTRINSICS) || (defined(__GNUC__) && defined(HAVE_SSE))
+ unsigned int sse_state{};
+#endif
+ bool in_mode{};
+
+public:
+ FPUCtl();
+ /* HACK: 32-bit targets for GCC seem to have a problem here with certain
+ * noexcept methods (which destructors are) causing an internal compiler
+ * error. No idea why it's these methods specifically, but this is needed
+ * to get it to compile.
+ */
+ ~FPUCtl() noexcept(false) { leave(); }
+
+ FPUCtl(const FPUCtl&) = delete;
+ FPUCtl& operator=(const FPUCtl&) = delete;
+
+ void leave();
+};
+
+#endif /* FPU_MODES_H */