File: zend_float.c

package info (click to toggle)
php5 5.3.3-7%2Bsqueeze19
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 122,836 kB
  • ctags: 55,742
  • sloc: ansic: 633,963; php: 19,620; sh: 11,344; xml: 5,816; cpp: 2,400; yacc: 1,745; exp: 1,514; makefile: 1,019; pascal: 623; awk: 537; sql: 22
file content (64 lines) | stat: -rw-r--r-- 1,969 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
   +----------------------------------------------------------------------+
   | Zend Engine                                                          |
   +----------------------------------------------------------------------+
   | Copyright (c) 1998-2010 Zend Technologies Ltd. (http://www.zend.com) |
   +----------------------------------------------------------------------+
   | This source file is subject to version 2.00 of the Zend license,     |
   | that is bundled with this package in the file LICENSE, and is        | 
   | available through the world-wide-web at the following url:           |
   | http://www.zend.com/license/2_00.txt.                                |
   | If you did not receive a copy of the Zend license and are unable to  |
   | obtain it through the world-wide-web, please send a note to          |
   | license@zend.com so we can mail you a copy immediately.              |
   +----------------------------------------------------------------------+
   | Authors: Christian Seiler <chris_se@gmx.net>                         |
   +----------------------------------------------------------------------+
*/

/* $Id: zend_float.c 293155 2010-01-05 20:46:53Z sebastian $ */

#include "zend.h"
#include "zend_compile.h"
#include "zend_float.h"

ZEND_API void zend_init_fpu(TSRMLS_D) /* {{{ */
{
#if XPFPA_HAVE_CW
	XPFPA_DECLARE
	
	if (!EG(saved_fpu_cw)) {
		EG(saved_fpu_cw) = emalloc(sizeof(XPFPA_CW_DATATYPE));
	}
	XPFPA_STORE_CW(EG(saved_fpu_cw));
	XPFPA_SWITCH_DOUBLE();
#else
	if (EG(saved_fpu_cw)) {
		efree(EG(saved_fpu_cw));
	}
	EG(saved_fpu_cw) = NULL;
#endif
}
/* }}} */

ZEND_API void zend_shutdown_fpu(TSRMLS_D) /* {{{ */
{
#if XPFPA_HAVE_CW
	if (EG(saved_fpu_cw)) {
		XPFPA_RESTORE_CW(EG(saved_fpu_cw));
	}
#endif
	if (EG(saved_fpu_cw)) {
		efree(EG(saved_fpu_cw));
		EG(saved_fpu_cw) = NULL;
	}
}
/* }}} */

ZEND_API void zend_ensure_fpu_mode(TSRMLS_D) /* {{{ */
{
	XPFPA_DECLARE
	
	XPFPA_SWITCH_DOUBLE();
}
/* }}} */