Gmail ate my attachment the 1st time, trying Thunderbird instead ...
diff --git a/Zend/zend_multiply.h b/Zend/zend_multiply.h
index c3c9657..3053f8b 100644
--- a/Zend/zend_multiply.h
+++ b/Zend/zend_multiply.h
@@ -13,7 +13,7 @@
| [email protected] so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Sascha Schumann <[email protected]> |
- | Ard Biesheuvel <[email protected]> |
+ | Ard Biesheuvel <[email protected]> |
+----------------------------------------------------------------------+
*/
@@ -43,6 +43,31 @@
else (lval) = __tmpvar; \
} while (0)
+#elif defined(__arm__) && defined(__GNUC__)
+
+#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \
+ long __tmpvar; \
+ __asm__("smull %0, %1, %2, %3\n" \
+ "sub %1, %1, %0, asr #31\n" \
+ : "=r"(__tmpvar), "=r"(usedval) \
+ : "r"(a), "r"(b)); \
+ if (usedval) (dval) = (double) (a) * (double) (b); \
+ else (lval) = __tmpvar; \
+} while (0)
+
+#elif defined(__aarch64__) && defined(__GNUC__)
+
+#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \
+ long __tmpvar; \
+ __asm__("mul %0, %2, %3\n" \
+ "smulh %1, %2, %3\n" \
+ "sub %1, %1, %0, asr #63\n" \
+ : "=X"(__tmpvar), "=X"(usedval) \
+ : "X"(a), "X"(b)); \
+ if (usedval) (dval) = (double) (a) * (double) (b); \
+ else (lval) = __tmpvar; \
+} while (0)
+
#elif SIZEOF_LONG == 4 && defined(HAVE_ZEND_LONG64)
#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php