6
6
dnl x87 floating point internal precision control checks
7
7
dnl See: http://wiki.php.net/rfc/rounding
8
8
dnl
9
- AC_DEFUN ( [ ZEND_CHECK_FLOAT_PRECISION] ,[
10
- AC_MSG_CHECKING ( [ for usable _FPU_SETCW] )
11
- AC_LINK_IFELSE ( [ AC_LANG_PROGRAM ( [ [
12
- #include <fpu_control.h>
13
- ] ] ,[ [
9
+ AC_DEFUN ( [ ZEND_CHECK_FLOAT_PRECISION] , [ dnl
10
+ AC_CACHE_CHECK ( [ for usable _FPU_SETCW] ,
11
+ [ php_cv_have__fpu_setcw] ,
12
+ [ AC_LINK_IFELSE ( [ AC_LANG_PROGRAM ( [ #include <fpu_control.h>] , [ dnl
14
13
fpu_control_t fpu_oldcw, fpu_cw;
15
14
volatile double result;
16
15
double a = 2877.0;
@@ -22,18 +21,16 @@ AC_DEFUN([ZEND_CHECK_FLOAT_PRECISION],[
22
21
result = a / b;
23
22
_FPU_SETCW(fpu_oldcw);
24
23
(void)result;
25
- ] ] ) ] ,[ ac_cfp_have__fpu_setcw=yes] ,[ ac_cfp_have__fpu_setcw=no] )
26
- if test "$ac_cfp_have__fpu_setcw" = "yes" ; then
27
- AC_DEFINE ( HAVE__FPU_SETCW , 1 , [ whether _FPU_SETCW is present and usable] )
28
- AC_MSG_RESULT ( yes )
29
- else
30
- AC_MSG_RESULT ( no )
31
- fi
32
-
33
- AC_MSG_CHECKING ( [ for usable fpsetprec] )
34
- AC_LINK_IFELSE ( [ AC_LANG_PROGRAM ( [ [
35
- #include <machine/ieeefp.h>
36
- ] ] ,[ [
24
+ ] ) ] ,
25
+ [ php_cv_have__fpu_setcw=yes] ,
26
+ [ php_cv_have__fpu_setcw=no] ) ] )
27
+ AS_VAR_IF ( [ php_cv_have__fpu_setcw] , [ yes] ,
28
+ [ AC_DEFINE ( [ HAVE__FPU_SETCW] , [ 1] ,
29
+ [ Define to 1 if _FPU_SETCW is present and usable.] ) ] )
30
+
31
+ AC_CACHE_CHECK ( [ for usable fpsetprec] ,
32
+ [ php_cv_have_fpsetprec] ,
33
+ [ AC_LINK_IFELSE ( [ AC_LANG_PROGRAM ( [ #include <machine/ieeefp.h>] , [ dnl
37
34
fp_prec_t fpu_oldprec;
38
35
volatile double result;
39
36
double a = 2877.0;
@@ -44,18 +41,16 @@ AC_DEFUN([ZEND_CHECK_FLOAT_PRECISION],[
44
41
result = a / b;
45
42
fpsetprec(fpu_oldprec);
46
43
(void)result;
47
- ] ] ) ] , [ ac_cfp_have_fpsetprec=yes] , [ ac_cfp_have_fpsetprec=no] )
48
- if test "$ac_cfp_have_fpsetprec" = "yes" ; then
49
- AC_DEFINE ( HAVE_FPSETPREC , 1 , [ whether fpsetprec is present and usable] )
50
- AC_MSG_RESULT ( yes )
51
- else
52
- AC_MSG_RESULT ( no )
53
- fi
54
-
55
- AC_MSG_CHECKING ( [ for usable _controlfp] )
56
- AC_LINK_IFELSE ( [ AC_LANG_PROGRAM ( [ [
57
- #include <float.h>
58
- ] ] ,[ [
44
+ ] ) ] ,
45
+ [ php_cv_have_fpsetprec=yes] ,
46
+ [ php_cv_have_fpsetprec=no] ) ] )
47
+ AS_VAR_IF ( [ php_cv_have_fpsetprec] , [ yes] ,
48
+ [ AC_DEFINE ( [ HAVE_FPSETPREC] , [ 1] ,
49
+ [ Define to 1 if fpsetprec is present and usable.] ) ] )
50
+
51
+ AC_CACHE_CHECK ( [ for usable _controlfp] ,
52
+ [ php_cv_have__controlfp] ,
53
+ [ AC_LINK_IFELSE ( [ AC_LANG_PROGRAM ( [ #include <float.h>] , [ dnl
59
54
unsigned int fpu_oldcw;
60
55
volatile double result;
61
56
double a = 2877.0;
@@ -66,18 +61,16 @@ AC_DEFUN([ZEND_CHECK_FLOAT_PRECISION],[
66
61
result = a / b;
67
62
_controlfp(fpu_oldcw, _MCW_PC);
68
63
(void)result;
69
- ] ] ) ] , [ ac_cfp_have__controlfp=yes] , [ ac_cfp_have__controlfp=no] )
70
- if test "$ac_cfp_have__controlfp" = "yes" ; then
71
- AC_DEFINE ( HAVE__CONTROLFP , 1 , [ whether _controlfp is present usable] )
72
- AC_MSG_RESULT ( yes )
73
- else
74
- AC_MSG_RESULT ( no )
75
- fi
76
-
77
- AC_MSG_CHECKING ( [ for usable _controlfp_s] )
78
- AC_LINK_IFELSE ( [ AC_LANG_PROGRAM ( [ [
79
- #include <float.h>
80
- ] ] ,[ [
64
+ ] ) ] ,
65
+ [ php_cv_have__controlfp=yes] ,
66
+ [ php_cv_have__controlfp=no] ) ] )
67
+ AS_VAR_IF ( [ php_cv_have__controlfp] , [ yes] ,
68
+ [ AC_DEFINE ( [ HAVE__CONTROLFP] , [ 1] ,
69
+ [ Define to 1 if _controlfp is present and usable.] ) ] )
70
+
71
+ AC_CACHE_CHECK ( [ for usable _controlfp_s] ,
72
+ [ php_cv_have__controlfp_s] ,
73
+ [ AC_LINK_IFELSE ( [ AC_LANG_PROGRAM ( [ #include <float.h>] , [ dnl
81
74
unsigned int fpu_oldcw, fpu_cw;
82
75
volatile double result;
83
76
double a = 2877.0;
@@ -89,18 +82,16 @@ AC_DEFUN([ZEND_CHECK_FLOAT_PRECISION],[
89
82
result = a / b;
90
83
_controlfp_s(&fpu_cw, fpu_oldcw, _MCW_PC);
91
84
(void)result;
92
- ] ] ) ] , [ ac_cfp_have__controlfp_s=yes] , [ ac_cfp_have__controlfp_s=no] )
93
- if test "$ac_cfp_have__controlfp_s" = "yes" ; then
94
- AC_DEFINE ( HAVE__CONTROLFP_S , 1 , [ whether _controlfp_s is present and usable] )
95
- AC_MSG_RESULT ( yes )
96
- else
97
- AC_MSG_RESULT ( no )
98
- fi
99
-
100
- AC_MSG_CHECKING ( [ whether FPU control word can be manipulated by inline assembler] )
101
- AC_LINK_IFELSE ( [ AC_LANG_PROGRAM ( [ [
102
- /* nothing */
103
- ] ] ,[ [
85
+ ] ) ] ,
86
+ [ php_cv_have__controlfp_s=yes] ,
87
+ [ php_cv_have__controlfp_s=no] ) ] )
88
+ AS_VAR_IF ( [ php_cv_have__controlfp_s] , [ yes] ,
89
+ [ AC_DEFINE ( [ HAVE__CONTROLFP_S] , [ 1] ,
90
+ [ Define to 1 if _controlfp_s is present and usable.] ) ] )
91
+
92
+ AC_CACHE_CHECK ( [ whether FPU control word can be manipulated by inline assembler] ,
93
+ [ php_cv_have_fpu_inline_asm_x86] ,
94
+ [ AC_LINK_IFELSE ( [ AC_LANG_PROGRAM ( [ ] , [ dnl
104
95
unsigned int oldcw, cw;
105
96
volatile double result;
106
97
double a = 2877.0;
@@ -112,13 +103,12 @@ AC_DEFUN([ZEND_CHECK_FLOAT_PRECISION],[
112
103
result = a / b;
113
104
__asm__ __volatile__ ("fldcw %0" : : "m" (*&oldcw));
114
105
(void)result;
115
- ] ] ) ] , [ ac_cfp_have_fpu_inline_asm_x86=yes] , [ ac_cfp_have_fpu_inline_asm_x86=no] )
116
- if test "$ac_cfp_have_fpu_inline_asm_x86" = "yes" ; then
117
- AC_DEFINE ( HAVE_FPU_INLINE_ASM_X86 , 1 , [ whether FPU control word can be manipulated by inline assembler] )
118
- AC_MSG_RESULT ( yes )
119
- else
120
- AC_MSG_RESULT ( no )
121
- fi
106
+ ] ) ] ,
107
+ [ php_cv_have_fpu_inline_asm_x86=yes] ,
108
+ [ php_cv_have_fpu_inline_asm_x86=no] ) ] )
109
+ AS_VAR_IF ( [ php_cv_have_fpu_inline_asm_x86] , [ yes] ,
110
+ [ AC_DEFINE ( [ HAVE_FPU_INLINE_ASM_X86] , [ 1] ,
111
+ [ Define to 1 if FPU control word can be manipulated by inline assembler.] ) ] )
122
112
] )
123
113
124
114
dnl
0 commit comments