zend_float.c 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. +----------------------------------------------------------------------+
  3. | Zend Engine |
  4. +----------------------------------------------------------------------+
  5. | Copyright (c) 1998-2018 Zend Technologies Ltd. (http://www.zend.com) |
  6. +----------------------------------------------------------------------+
  7. | This source file is subject to version 2.00 of the Zend license, |
  8. | that is bundled with this package in the file LICENSE, and is |
  9. | available through the world-wide-web at the following url: |
  10. | http://www.zend.com/license/2_00.txt. |
  11. | If you did not receive a copy of the Zend license and are unable to |
  12. | obtain it through the world-wide-web, please send a note to |
  13. | license@zend.com so we can mail you a copy immediately. |
  14. +----------------------------------------------------------------------+
  15. | Authors: Christian Seiler <chris_se@gmx.net> |
  16. +----------------------------------------------------------------------+
  17. */
  18. #include "zend.h"
  19. #include "zend_compile.h"
  20. #include "zend_float.h"
  21. ZEND_API void zend_init_fpu(void) /* {{{ */
  22. {
  23. #if XPFPA_HAVE_CW
  24. XPFPA_DECLARE
  25. if (!EG(saved_fpu_cw_ptr)) {
  26. EG(saved_fpu_cw_ptr) = (void*)&EG(saved_fpu_cw);
  27. }
  28. XPFPA_STORE_CW(EG(saved_fpu_cw_ptr));
  29. XPFPA_SWITCH_DOUBLE();
  30. #else
  31. EG(saved_fpu_cw_ptr) = NULL;
  32. #endif
  33. }
  34. /* }}} */
  35. ZEND_API void zend_shutdown_fpu(void) /* {{{ */
  36. {
  37. #if XPFPA_HAVE_CW
  38. if (EG(saved_fpu_cw_ptr)) {
  39. XPFPA_RESTORE_CW(EG(saved_fpu_cw_ptr));
  40. }
  41. #endif
  42. EG(saved_fpu_cw_ptr) = NULL;
  43. }
  44. /* }}} */
  45. ZEND_API void zend_ensure_fpu_mode(void) /* {{{ */
  46. {
  47. XPFPA_DECLARE
  48. XPFPA_SWITCH_DOUBLE();
  49. }
  50. /* }}} */
  51. /*
  52. * Local variables:
  53. * tab-width: 4
  54. * c-basic-offset: 4
  55. * indent-tabs-mode: t
  56. * End:
  57. * vim600: sw=4 ts=4 fdm=marker
  58. * vim<600: sw=4 ts=4
  59. */