From c4e9651b587e1ebcf3e2de7a2d3d586c0cc3e0c4 Mon Sep 17 00:00:00 2001 From: Kalle Sommer Nielsen Date: Thu, 28 May 2015 16:54:02 +0200 Subject: [PATCH] Merge the fix for #69703 to 5.5 per request from Julien --- NEWS | 4 +++- Zend/zend_alloc.c | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index d7579e473d..7997ccfb85 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,4 @@ -PHP NEWS +PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? 2015, PHP 5.5.26 @@ -9,6 +9,8 @@ PHP NEWS (Julien) . Fixed bug #69628 (complex GLOB_BRACE fails on Windows). (Christoph M. Becker) + . Fixed bug #69703 (Use __builtin_clzl on PowerPC). + (dja at axtens dot net, Kalle) - GD: . Fixed bug #69479 (GD fails to build with newer libvpx). (Remi) diff --git a/Zend/zend_alloc.c b/Zend/zend_alloc.c index cd422e2d3e..7fe7ffbbd3 100644 --- a/Zend/zend_alloc.c +++ b/Zend/zend_alloc.c @@ -678,7 +678,7 @@ static inline unsigned int zend_mm_high_bit(size_t _size) __asm { bsr eax, _size } -#elif defined(__GNUC__) && (defined(__arm__) || defined(__aarch64__)) +#elif defined(__GNUC__) && (defined(__arm__) || defined(__aarch64__) || defined(__powerpc__)) return (8 * SIZEOF_SIZE_T - 1) - __builtin_clzl(_size); #else unsigned int n = 0; @@ -706,7 +706,7 @@ static inline unsigned int zend_mm_low_bit(size_t _size) __asm { bsf eax, _size } -#elif defined(__GNUC__) && (defined(__arm__) || defined(__aarch64__)) +#elif defined(__GNUC__) && (defined(__arm__) || defined(__aarch64__) || defined(__powerpc__)) return __builtin_ctzl(_size); #else static const int offset[16] = {4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0}; -- 2.40.0