diff options
author | Anton Blanchard <anton@samba.org> | 2015-05-26 23:41:42 +1000 |
---|---|---|
committer | Remi Collet <remi@php.net> | 2015-07-29 09:22:38 +0200 |
commit | fd8fb17be8773a34989347140ce4cb25867f720f (patch) | |
tree | 4561ba14423088a2225a497e31aa471d3444851f /ext/pgsql/php_pgsql.h | |
parent | 32e9b744c06edbfcb4907266c35b7b4b8b3bb9d3 (diff) | |
download | php-git-fd8fb17be8773a34989347140ce4cb25867f720f.tar.gz |
Improve performance of PowerPC64 fast_long_add_function
Detecting overflow with the XER is slow, partially because we have to
clear it before use.
PHP already has a fast way of detecting overflow in its fallback
c implementation. Overflow only occurs if the signs of the two
operands are the same and the sign of the result is different.
Furthermore, leaving it in c allows gcc to schedule the instructions
better.
This is 9% faster on a POWER8 running a simple testcase:
<?php
function testcase($count = 100000000) {
$x = 1;
for ($i = 0; $i < $count; $i++) {
$x = $x + 1;
$x = $x + 1;
$x = $x + 1;
$x = $x + 1;
$x = $x + 1;
}
}
testcase();
?>
Diffstat (limited to 'ext/pgsql/php_pgsql.h')
0 files changed, 0 insertions, 0 deletions