bench.php worked with 4.7.0 worked fine foe me, but I saw crash on "make
pharcmd" and few tests related to assert().
Travis had similar crash on "make pharcmd" with 4.6.3.

For now I limited usage of global register variables by 4.8.0 and above.

Thanks. Dmitry.

On Wed, Mar 18, 2015 at 1:16 PM, Albert Casademont <
albertcasadem...@gmail.com> wrote:

> Hi Dmitry,
>
> I compiled it with gcc 4.7.2 and the bench.php performed well. Where did
> you find the errors?
>
> Albert
>
> On Wed, Mar 18, 2015 at 12:22 AM, Dmitry Stogov <dmi...@zend.com> wrote:
>
>> 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
>>>>
>>>>
>>>
>>
>

Reply via email to