this is more then enough :) Thanks, I've committed your patch with additional limitation to GCC version.
Thanks. Dmitry. On Wed, Mar 18, 2015 at 1:49 PM, Caio Souza Oliveira < caio.olive...@eldorado.org.br> wrote: > Hello Dmitry! Sorry for my lack of details on my build process and > environment. > This time around, I'll try to be more descriptive about the subject. > > 1 - Environment > > I've compiled PHP, in both cases, using the following environment settings > and > running the following commands: > > export CC=/opt/at8.0/bin/gcc > export CXX=/opt/at8.0/bin/g++ > export CFLAGS="-g -O2 -fno-omit-frame-pointer -finline-limit=50000 > -mcpu=power8 -mtune=power8 -Wall" > export CXXFLAGS="-g -O2 -fno-omit-frame-pointer -finline-limit=50000 > -mcpu=power8 -mtune=power8 -Wall" > > rm -vf configure; ./buildconf --force; > > ./configure --disable-libxml --disable-simplexml --disable-xml > --disable-xmlreader --disable-xmlwriter > --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-shmop > --disable-dom --without-pear > --disable-phar --enable-bcmath --with-gmp --enable-pcntl > --prefix=/opt/interpreters > > make clean; make; > > make install > > 2 - GCC Version > > Both php sources (with and without the patch) have been compiled with: > > gcc (GCC) 4.9.2 20141013 (Advance-Toolchain-at8.0) [ibm/gcc-4_9-branch, > revision: 216164 merged from gcc-4_9-branch, revision 216151] > Copyright (C) 2014 Free Software Foundation, Inc. > > > 3 - make test results > > *** Before applying the proposed patch on ppc64le *** > > ===================================================================== > TEST RESULT SUMMARY > --------------------------------------------------------------------- > Exts skipped : 49 > Exts tested : 26 > --------------------------------------------------------------------- > > Number of tests : 13562 8305 > Tests skipped : 5257 ( 38.8%) -------- > Tests warned : 1 ( 0.0%) ( 0.0%) > Tests failed : 3 ( 0.0%) ( 0.0%) > Expected fail : 32 ( 0.2%) ( 0.4%) > Tests passed : 8269 ( 61.0%) ( 99.6%) > --------------------------------------------------------------------- > Time taken : 283 seconds > ===================================================================== > > *** After applying the proposed patch on ppc64le *** > > ===================================================================== > TEST RESULT SUMMARY > --------------------------------------------------------------------- > Exts skipped : 49 > Exts tested : 26 > --------------------------------------------------------------------- > > Number of tests : 13562 8305 > Tests skipped : 5257 ( 38.8%) -------- > Tests warned : 1 ( 0.0%) ( 0.0%) > Tests failed : 3 ( 0.0%) ( 0.0%) > Expected fail : 32 ( 0.2%) ( 0.4%) > Tests passed : 8269 ( 61.0%) ( 99.6%) > --------------------------------------------------------------------- > Time taken : 282 seconds > ===================================================================== > > > More details can be seen in [1]: > > [1] https://gist.github.com/caioso/9360bd95e829c4172446 > > Do you need any other information? > > Thank you very much! > Caio > > ------------ > > From: Dmitry Stogov [mailto:dmi...@zend.com] > Sent: terça-feira, 17 de março de 2015 20:22 > To: Caio Souza Oliveira > Cc: Albert Casademont Filella; Gustavo Frederico Temple Pedrosa; Ard > Biesheuvel; PHP Internals; Leonardo Bianconi > Subject: Re: [PHP-DEV] RE: [PHP-CVS] com php-src: Enable GCC global > register variables if available: Zend/Zend.m4 Zend/zend_execute.c > > Please also tell your GCC version. > We had problems with 4.6.3 and 4.7.0, so we disabled global variables for > GCC prior 4.8.0. > Thanks. Dmitry. > > On Wed, Mar 18, 2015 at 12:36 AM, Dmitry Stogov <dmi...@zend.com> wrote: > Hi Caio, > Could you please run "make test" with and without the patch and compare > the failed tests. > The patch must not add new failures. > Thanks. Dmitry. > > On Tue, Mar 17, 2015 at 10:15 PM, Caio Souza Oliveira < > caio.olive...@eldorado.org.br> wrote: > Hello guys! > I’ve included the optimization proposed in [1] on ppc64le machines and I > could get an outstanding performance improvement of about 69% when running > bench.php (from 2.394 sec to 1.640 sec in average). I’ve tested this on > POWER 8 machines. My patch can be seen at [2] > > Thank you! > Caio Souza Oliveira > > [1] > https://github.com/php/php-src/commit/fb4b7069842491eb66272587422a1f61d41eb869 > [2] https://github.com/php/php-src/pull/1181 > > ---------- > From: Albert Casademont Filella [mailto:albertcasadem...@gmail.com] > Sent: terça-feira, 17 de março de 2015 13:23 > To: Gustavo Frederico Temple Pedrosa > Cc: Dmitry Stogov; Ard Biesheuvel; PHP Internals; Leonardo Bianconi; Caio > Souza Oliveira > Subject: Re: [PHP-DEV] RE: [PHP-CVS] com php-src: Enable GCC global > register variables if available: Zend/Zend.m4 Zend/zend_execute.c > > Hi Dmitry, > I can confirm a ~10-11% reduction in execution time of the bench.php from > last month build (x64) to today's commit (from 1.154 sec to 1.010). Amazing > job! > Albert > > On Tue, Mar 17, 2015 at 1:39 PM, Gustavo Frederico Temple Pedrosa < > gustavo.pedr...@eldorado.org.br> wrote: > Hi, Dmitry. > > Thank you for contacting us. > > Leonardo and Caio (in CC), they will verify. > > Thank you very much. Temple. > > > > > > From: Dmitry Stogov [mailto:dmi...@zend.com] > Sent: terça-feira, 17 de março de 2015 08:01 > To: Ard Biesheuvel; Gustavo Frederico Temple Pedrosa > Cc: PHP Internals > Subject: Fwd: [PHP-CVS] com php-src: Enable GCC global register variables > if available: Zend/Zend.m4 Zend/zend_execute.c > > Hi, > Please consider possibility of using the same optimization for ARM, PPC > and may be other platforms. > On x86(_84) it makes 2-7% speedup. > Only the similar changes in zend_execute.c and Zend.m4 are required to > enable it. > Thanks. Dmitry. > > ---------- Forwarded message ---------- > From: Dmitry Stogov <dmi...@php.net> > Date: Tue, Mar 17, 2015 at 1:51 PM > Subject: [PHP-CVS] com php-src: Enable GCC global register variables if > available: Zend/Zend.m4 Zend/zend_execute.c > To: php-...@lists.php.net > > > Commit: fb4b7069842491eb66272587422a1f61d41eb869 > Author: Dmitry Stogov <dmi...@zend.com> Tue, 17 Mar 2015 > 13:51:02 +0300 > Parents: 92bf4566ea65042b8f84cae7840298ed151a4f7a > Branches: master > > Link: > http://git.php.net/?p=php-src.git;a=commitdiff;h=fb4b7069842491eb66272587422a1f61d41eb869 > > Log: > Enable GCC global register variables if available > > Changed paths: > M Zend/Zend.m4 > M Zend/zend_execute.c > > > Diff: > diff --git a/Zend/Zend.m4 b/Zend/Zend.m4 > index 16f2d5f..e12b00d 100644 > --- a/Zend/Zend.m4 > +++ b/Zend/Zend.m4 > @@ -409,3 +409,48 @@ else > AC_MSG_RESULT(no) > fi > fi > + > +AC_ARG_ENABLE(gcc-global-regs, > +[ --disable-gcc-global-regs > + whether to enable GCC global register > variables],[ > + ZEND_GCC_GLOBAL_REGS=$enableval > +],[ > + ZEND_GCC_GLOBAL_REGS=yes > +]) > +AC_MSG_CHECKING(for global register variables support) > +if test "$ZEND_GCC_GLOBAL_REGS" != "no"; then > + AC_TRY_COMPILE([ > + ],[ > +#if defined(__GNUC__) && defined(i386) > +# define ZEND_VM_FP_GLOBAL_REG "%esi" > +# define ZEND_VM_IP_GLOBAL_REG "%edi" > +#elif defined(__GNUC__) && defined(__x86_64__) > +# define ZEND_VM_FP_GLOBAL_REG "%r14" > +# define ZEND_VM_IP_GLOBAL_REG "%r15" > +#else > +# error "global register variables are not supported" > +#endif > +typedef int (*opcode_handler_t)(void); > +register void *FP __asm__(ZEND_VM_FP_GLOBAL_REG); > +register const opcode_handler_t *IP __asm__(ZEND_VM_IP_GLOBAL_REG); > +int emu(const opcode_handler_t *ip, void *fp) { > + const opcode_handler_t *orig_ip = IP; > + void *orig_fp = FP; > + IP = ip; > + FP = fp; > + while ((*ip)()); > + FP = orig_fp; > + IP = orig_ip; > +} > + ], [ > + ZEND_GCC_GLOBAL_REGS=yes > + ], [ > + ZEND_GCC_GLOBAL_REGS=no > + ]) > +fi > +if test "$ZEND_GCC_GLOBAL_REGS" = "yes"; then > + AC_DEFINE([HAVE_GCC_GLOBAL_REGS], 1, [Define if the target system has > support for global register variables]) > +else > + HAVE_GCC_GLOBAL_REGS=no > +fi > +AC_MSG_RESULT(ZEND_GCC_GLOBAL_REGS) > diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c > index b24218a..17e68dc 100644 > --- a/Zend/zend_execute.c > +++ b/Zend/zend_execute.c > @@ -2049,7 +2049,7 @@ static zend_always_inline void > zend_vm_stack_extend_call_frame(zend_execute_data > } > /* }}} */ > > -#if HAVE_GCC_GLOBAL_REGS > +#ifdef HAVE_GCC_GLOBAL_REGS > # if defined(__GNUC__) && defined(i386) > # define ZEND_VM_FP_GLOBAL_REG "%esi" > # define ZEND_VM_IP_GLOBAL_REG "%edi" > > > -- > PHP CVS Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > >