🛠️🐜 Antkeeper superbuild with dependencies included https://antkeeper.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
469 B

  1. #ifndef CORE_FPU_CTRL_H
  2. #define CORE_FPU_CTRL_H
  3. class FPUCtl {
  4. #if defined(HAVE_SSE_INTRINSICS) || (defined(__GNUC__) && defined(HAVE_SSE))
  5. unsigned int sse_state{};
  6. #endif
  7. bool in_mode{};
  8. public:
  9. FPUCtl() noexcept { enter(); in_mode = true; }
  10. ~FPUCtl() { if(in_mode) leave(); }
  11. FPUCtl(const FPUCtl&) = delete;
  12. FPUCtl& operator=(const FPUCtl&) = delete;
  13. void enter() noexcept;
  14. void leave() noexcept;
  15. };
  16. #endif /* CORE_FPU_CTRL_H */