[php-src] jit-arm64: Make bit helpers to be inline

From: Date: Mon, 26 Apr 2021 10:29:05 +0000
Subject: [php-src] jit-arm64: Make bit helpers to be inline
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-115817@lists.php.net to get a copy of this message
Author: Dmitry Stogov (dstogov) Date: 2021-04-26T13:28:53+03:00 Commit: https://github.com/php/php-src/commit/15cd939ecb333f519b29ef3ed7a84d8515ae2aa9 Raw diff: https://github.com/php/php-src/commit/15cd939ecb333f519b29ef3ed7a84d8515ae2aa9.diff Make bit helpers to be inline Changed paths: M ext/opcache/jit/zend_jit_internal.h Diff: diff --git a/ext/opcache/jit/zend_jit_internal.h b/ext/opcache/jit/zend_jit_internal.h index 29eab0491949..23c6cb3409c1 100644 --- a/ext/opcache/jit/zend_jit_internal.h +++ b/ext/opcache/jit/zend_jit_internal.h @@ -740,19 +740,19 @@ static zend_always_inline bool zend_jit_may_be_polymorphic_call(const zend_op *o /* bit helpers */ -static bool zend_long_is_power_of_two(zend_long x) +static zend_always_inline bool zend_long_is_power_of_two(zend_long x) { return (x > 0) && !(x & (x - 1)); } -static uint32_t zend_long_floor_log2(uint64_t x) +static zend_always_inline uint32_t zend_long_floor_log2(uint64_t x) { ZEND_ASSERT(zend_long_is_power_of_two(x)); return __builtin_ctzll(x); } /* from http://aggregate.org/MAGIC/ */ -static uint32_t ones32(uint32_t x) +static zend_always_inline uint32_t ones32(uint32_t x) { x -= ((x >> 1) & 0x55555555); x = (((x >> 2) & 0x33333333) + (x & 0x33333333)); @@ -762,7 +762,7 @@ static uint32_t ones32(uint32_t x) return x & 0x0000003f; } -static uint32_t floor_log2(uint32_t x) +static zend_always_inline uint32_t floor_log2(uint32_t x) { ZEND_ASSERT(x != 0); x |= (x >> 1); @@ -773,22 +773,22 @@ static uint32_t floor_log2(uint32_t x) return ones32(x) - 1; } -static bool is_power_of_two(uint32_t x) +static zend_always_inline bool is_power_of_two(uint32_t x) { return !(x & (x - 1)) && x != 0; } -static bool has_concrete_type(uint32_t value_type) +static zend_always_inline bool has_concrete_type(uint32_t value_type) { return is_power_of_two (value_type & (MAY_BE_ANY|MAY_BE_UNDEF)); } -static uint32_t concrete_type(uint32_t value_type) +static zend_always_inline uint32_t concrete_type(uint32_t value_type) { return floor_log2(value_type & (MAY_BE_ANY|MAY_BE_UNDEF)); } -static inline bool is_signed(double d) +static zend_always_inline bool is_signed(double d) { return (((unsigned char*)&d)[sizeof(double)-1] & 0x80) != 0; }

« previous php.cvs (#115817) next »