]> git.pld-linux.org Git - packages/php.git/blame - zend_operators_from_5.5.patch
fix php(dblib) -> php(pdo_dblib) provide
[packages/php.git] / zend_operators_from_5.5.patch
CommitLineData
6dac47d5
WF
1--- php-5.4.41/Zend/zend_operators.h 2015-05-12 19:38:38.000000000 +0000
2+++ php-5.5.25/Zend/zend_operators.h 2015-05-14 00:02:08.000000000 +0000
3@@ -2,7 +2,7 @@
4 +----------------------------------------------------------------------+
5 | Zend Engine |
6 +----------------------------------------------------------------------+
7- | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) |
8+ | Copyright (c) 1998-2015 Zend Technologies Ltd. (http://www.zend.com) |
9 +----------------------------------------------------------------------+
10 | This source file is subject to version 2.00 of the Zend license, |
11 | that is bundled with this package in the file LICENSE, and is |
12@@ -26,6 +26,10 @@
13 #include <math.h>
14 #include <assert.h>
15
16+#ifdef __GNUC__
17+#include <stddef.h>
18+#endif
19+
20 #ifdef HAVE_IEEEFP_H
21 #include <ieeefp.h>
22 #endif
6dac47d5
WF
23@@ -474,6 +499,10 @@
24 #define zend_update_current_locale()
25 #endif
26
27+/* The offset in bytes between the value and type fields of a zval */
28+#define ZVAL_OFFSETOF_TYPE \
29+ (offsetof(zval,type) - offsetof(zval,value))
30+
31 static zend_always_inline int fast_increment_function(zval *op1)
32 {
33 if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) {
34@@ -483,20 +512,26 @@
35 "jno 0f\n\t"
36 "movl $0x0, (%0)\n\t"
37 "movl $0x41e00000, 0x4(%0)\n\t"
38- "movb $0x2,0xc(%0)\n"
39+ "movb %1, %c2(%0)\n"
40 "0:"
41 :
42- : "r"(op1));
43+ : "r"(&op1->value),
44+ "n"(IS_DOUBLE),
45+ "n"(ZVAL_OFFSETOF_TYPE)
46+ : "cc");
47 #elif defined(__GNUC__) && defined(__x86_64__)
48 __asm__(
49 "incq (%0)\n\t"
50 "jno 0f\n\t"
51 "movl $0x0, (%0)\n\t"
52 "movl $0x43e00000, 0x4(%0)\n\t"
53- "movb $0x2,0x14(%0)\n"
54+ "movb %1, %c2(%0)\n"
55 "0:"
56 :
57- : "r"(op1));
58+ : "r"(&op1->value),
59+ "n"(IS_DOUBLE),
60+ "n"(ZVAL_OFFSETOF_TYPE)
61+ : "cc");
62 #else
63 if (UNEXPECTED(Z_LVAL_P(op1) == LONG_MAX)) {
64 /* switch to double */
65@@ -520,20 +555,26 @@
66 "jno 0f\n\t"
67 "movl $0x00200000, (%0)\n\t"
68 "movl $0xc1e00000, 0x4(%0)\n\t"
69- "movb $0x2,0xc(%0)\n"
70+ "movb %1,%c2(%0)\n"
71 "0:"
72 :
73- : "r"(op1));
74+ : "r"(&op1->value),
75+ "n"(IS_DOUBLE),
76+ "n"(ZVAL_OFFSETOF_TYPE)
77+ : "cc");
78 #elif defined(__GNUC__) && defined(__x86_64__)
79 __asm__(
80 "decq (%0)\n\t"
81 "jno 0f\n\t"
82 "movl $0x00000000, (%0)\n\t"
83 "movl $0xc3e00000, 0x4(%0)\n\t"
84- "movb $0x2,0x14(%0)\n"
85+ "movb %1,%c2(%0)\n"
86 "0:"
87 :
88- : "r"(op1));
89+ : "r"(&op1->value),
90+ "n"(IS_DOUBLE),
91+ "n"(ZVAL_OFFSETOF_TYPE)
92+ : "cc");
93 #else
94 if (UNEXPECTED(Z_LVAL_P(op1) == LONG_MIN)) {
95 /* switch to double */
96@@ -558,40 +599,46 @@
97 "addl (%2), %%eax\n\t"
98 "jo 0f\n\t"
99 "movl %%eax, (%0)\n\t"
100- "movb $0x1,0xc(%0)\n\t"
101+ "movb %3, %c5(%0)\n\t"
102 "jmp 1f\n"
103 "0:\n\t"
104 "fildl (%1)\n\t"
105 "fildl (%2)\n\t"
106 "faddp %%st, %%st(1)\n\t"
107- "movb $0x2,0xc(%0)\n\t"
108+ "movb %4, %c5(%0)\n\t"
109 "fstpl (%0)\n"
110 "1:"
111 :
112- : "r"(result),
113- "r"(op1),
114- "r"(op2)
115- : "eax");
116+ : "r"(&result->value),
117+ "r"(&op1->value),
118+ "r"(&op2->value),
119+ "n"(IS_LONG),
120+ "n"(IS_DOUBLE),
121+ "n"(ZVAL_OFFSETOF_TYPE)
122+ : "eax","cc");
123 #elif defined(__GNUC__) && defined(__x86_64__)
124 __asm__(
125 "movq (%1), %%rax\n\t"
126 "addq (%2), %%rax\n\t"
127 "jo 0f\n\t"
128 "movq %%rax, (%0)\n\t"
129- "movb $0x1,0x14(%0)\n\t"
130+ "movb %3, %c5(%0)\n\t"
131 "jmp 1f\n"
132 "0:\n\t"
133 "fildq (%1)\n\t"
134 "fildq (%2)\n\t"
135 "faddp %%st, %%st(1)\n\t"
136- "movb $0x2,0x14(%0)\n\t"
137+ "movb %4, %c5(%0)\n\t"
138 "fstpl (%0)\n"
139 "1:"
140 :
141- : "r"(result),
142- "r"(op1),
143- "r"(op2)
144- : "rax");
145+ : "r"(&result->value),
146+ "r"(&op1->value),
147+ "r"(&op2->value),
148+ "n"(IS_LONG),
149+ "n"(IS_DOUBLE),
150+ "n"(ZVAL_OFFSETOF_TYPE)
151+ : "rax","cc");
152 #else
153 /*
154 * 'result' may alias with op1 or op2, so we need to
155@@ -638,7 +685,7 @@
156 "subl (%2), %%eax\n\t"
157 "jo 0f\n\t"
158 "movl %%eax, (%0)\n\t"
159- "movb $0x1,0xc(%0)\n\t"
160+ "movb %3, %c5(%0)\n\t"
161 "jmp 1f\n"
162 "0:\n\t"
163 "fildl (%2)\n\t"
164@@ -648,21 +695,24 @@
165 #else
166 "fsubp %%st, %%st(1)\n\t"
167 #endif
168- "movb $0x2,0xc(%0)\n\t"
169+ "movb %4, %c5(%0)\n\t"
170 "fstpl (%0)\n"
171 "1:"
172 :
173- : "r"(result),
174- "r"(op1),
175- "r"(op2)
176- : "eax");
177+ : "r"(&result->value),
178+ "r"(&op1->value),
179+ "r"(&op2->value),
180+ "n"(IS_LONG),
181+ "n"(IS_DOUBLE),
182+ "n"(ZVAL_OFFSETOF_TYPE)
183+ : "eax","cc");
184 #elif defined(__GNUC__) && defined(__x86_64__)
185 __asm__(
186 "movq (%1), %%rax\n\t"
187 "subq (%2), %%rax\n\t"
188 "jo 0f\n\t"
189 "movq %%rax, (%0)\n\t"
190- "movb $0x1,0x14(%0)\n\t"
191+ "movb %3, %c5(%0)\n\t"
192 "jmp 1f\n"
193 "0:\n\t"
194 "fildq (%2)\n\t"
195@@ -672,14 +722,17 @@
196 #else
197 "fsubp %%st, %%st(1)\n\t"
198 #endif
199- "movb $0x2,0x14(%0)\n\t"
200+ "movb %4, %c5(%0)\n\t"
201 "fstpl (%0)\n"
202 "1:"
203 :
204- : "r"(result),
205- "r"(op1),
206- "r"(op2)
207- : "rax");
208+ : "r"(&result->value),
209+ "r"(&op1->value),
210+ "r"(&op2->value),
211+ "n"(IS_LONG),
212+ "n"(IS_DOUBLE),
213+ "n"(ZVAL_OFFSETOF_TYPE)
214+ : "rax","cc");
215 #else
216 Z_LVAL_P(result) = Z_LVAL_P(op1) - Z_LVAL_P(op2);
217
This page took 0.051378 seconds and 4 git commands to generate.