/src/php-src/Zend/zend_float.c
Line | Count | Source |
1 | | /* |
2 | | +----------------------------------------------------------------------+ |
3 | | | Zend Engine | |
4 | | +----------------------------------------------------------------------+ |
5 | | | Copyright © Zend Technologies Ltd., a subsidiary company of | |
6 | | | Perforce Software, Inc., and Contributors. | |
7 | | +----------------------------------------------------------------------+ |
8 | | | This source file is subject to the Modified BSD License that is | |
9 | | | bundled with this package in the file LICENSE, and is available | |
10 | | | through the World Wide Web at <https://www.php.net/license/>. | |
11 | | | | |
12 | | | SPDX-License-Identifier: BSD-3-Clause | |
13 | | +----------------------------------------------------------------------+ |
14 | | | Authors: Christian Seiler <chris_se@gmx.net> | |
15 | | +----------------------------------------------------------------------+ |
16 | | */ |
17 | | |
18 | | #include "zend.h" |
19 | | #include "zend_compile.h" |
20 | | #include "zend_float.h" |
21 | | |
22 | | ZEND_API void zend_init_fpu(void) /* {{{ */ |
23 | 33.5k | { |
24 | | #if XPFPA_HAVE_CW |
25 | | XPFPA_DECLARE |
26 | | |
27 | | if (!EG(saved_fpu_cw_ptr)) { |
28 | | EG(saved_fpu_cw_ptr) = (void*)&EG(saved_fpu_cw); |
29 | | } |
30 | | XPFPA_STORE_CW(EG(saved_fpu_cw_ptr)); |
31 | | XPFPA_SWITCH_DOUBLE(); |
32 | | #else |
33 | 33.5k | EG(saved_fpu_cw_ptr) = NULL; |
34 | 33.5k | #endif |
35 | 33.5k | } |
36 | | /* }}} */ |
37 | | |
38 | | ZEND_API void zend_shutdown_fpu(void) /* {{{ */ |
39 | 33.5k | { |
40 | | #if XPFPA_HAVE_CW |
41 | | if (EG(saved_fpu_cw_ptr)) { |
42 | | XPFPA_RESTORE_CW(EG(saved_fpu_cw_ptr)); |
43 | | } |
44 | | #endif |
45 | 33.5k | EG(saved_fpu_cw_ptr) = NULL; |
46 | 33.5k | } |
47 | | /* }}} */ |
48 | | |
49 | | ZEND_API void zend_ensure_fpu_mode(void) /* {{{ */ |
50 | 0 | { |
51 | 0 | XPFPA_DECLARE |
52 | |
|
53 | 0 | XPFPA_SWITCH_DOUBLE(); |
54 | 0 | } |
55 | | /* }}} */ |