zend_float.c 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. +----------------------------------------------------------------------+
  3. | Zend Engine |
  4. +----------------------------------------------------------------------+
  5. | Copyright (c) 1998-2016 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. /* $Id$ */
  19. #include "zend.h"
  20. #include "zend_compile.h"
  21. #include "zend_float.h"
  22. ZEND_API void zend_init_fpu(TSRMLS_D) /* {{{ */
  23. {
  24. #if XPFPA_HAVE_CW
  25. XPFPA_DECLARE
  26. if (!EG(saved_fpu_cw_ptr)) {
  27. EG(saved_fpu_cw_ptr) = (void*)&EG(saved_fpu_cw);
  28. }
  29. XPFPA_STORE_CW(EG(saved_fpu_cw_ptr));
  30. XPFPA_SWITCH_DOUBLE();
  31. #else
  32. EG(saved_fpu_cw_ptr) = NULL;
  33. #endif
  34. }
  35. /* }}} */
  36. ZEND_API void zend_shutdown_fpu(TSRMLS_D) /* {{{ */
  37. {
  38. #if XPFPA_HAVE_CW
  39. if (EG(saved_fpu_cw_ptr)) {
  40. XPFPA_RESTORE_CW(EG(saved_fpu_cw_ptr));
  41. }
  42. #endif
  43. EG(saved_fpu_cw_ptr) = NULL;
  44. }
  45. /* }}} */
  46. ZEND_API void zend_ensure_fpu_mode(TSRMLS_D) /* {{{ */
  47. {
  48. XPFPA_DECLARE
  49. XPFPA_SWITCH_DOUBLE();
  50. }
  51. /* }}} */