zend_float.c 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. +----------------------------------------------------------------------+
  3. | Zend Engine |
  4. +----------------------------------------------------------------------+
  5. | Copyright (c) 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. /* }}} */