Back to index

php5  5.3.10
zend_float.c
Go to the documentation of this file.
00001 /*
00002    +----------------------------------------------------------------------+
00003    | Zend Engine                                                          |
00004    +----------------------------------------------------------------------+
00005    | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
00006    +----------------------------------------------------------------------+
00007    | This source file is subject to version 2.00 of the Zend license,     |
00008    | that is bundled with this package in the file LICENSE, and is        | 
00009    | available through the world-wide-web at the following url:           |
00010    | http://www.zend.com/license/2_00.txt.                                |
00011    | If you did not receive a copy of the Zend license and are unable to  |
00012    | obtain it through the world-wide-web, please send a note to          |
00013    | license@zend.com so we can mail you a copy immediately.              |
00014    +----------------------------------------------------------------------+
00015    | Authors: Christian Seiler <chris_se@gmx.net>                         |
00016    +----------------------------------------------------------------------+
00017 */
00018 
00019 /* $Id: zend_float.c 321634 2012-01-01 13:15:04Z felipe $ */
00020 
00021 #include "zend.h"
00022 #include "zend_compile.h"
00023 #include "zend_float.h"
00024 
00025 ZEND_API void zend_init_fpu(TSRMLS_D) /* {{{ */
00026 {
00027 #if XPFPA_HAVE_CW
00028        XPFPA_DECLARE
00029        
00030        if (!EG(saved_fpu_cw)) {
00031               EG(saved_fpu_cw) = emalloc(sizeof(XPFPA_CW_DATATYPE));
00032        }
00033        XPFPA_STORE_CW(EG(saved_fpu_cw));
00034        XPFPA_SWITCH_DOUBLE();
00035 #else
00036        if (EG(saved_fpu_cw)) {
00037               efree(EG(saved_fpu_cw));
00038        }
00039        EG(saved_fpu_cw) = NULL;
00040 #endif
00041 }
00042 /* }}} */
00043 
00044 ZEND_API void zend_shutdown_fpu(TSRMLS_D) /* {{{ */
00045 {
00046 #if XPFPA_HAVE_CW
00047        if (EG(saved_fpu_cw)) {
00048               XPFPA_RESTORE_CW(EG(saved_fpu_cw));
00049        }
00050 #endif
00051        if (EG(saved_fpu_cw)) {
00052               efree(EG(saved_fpu_cw));
00053               EG(saved_fpu_cw) = NULL;
00054        }
00055 }
00056 /* }}} */
00057 
00058 ZEND_API void zend_ensure_fpu_mode(TSRMLS_D) /* {{{ */
00059 {
00060        XPFPA_DECLARE
00061        
00062        XPFPA_SWITCH_DOUBLE();
00063 }
00064 /* }}} */