ruby-changes:42071
From: nobu <ko1@a...>
Date: Thu, 17 Mar 2016 17:15:00 +0900 (JST)
Subject: [ruby-changes:42071] nobu:r54145 (trunk): gc.c: tick for POWER arch
nobu 2016-03-17 17:14:53 +0900 (Thu, 17 Mar 2016) New Revision: 54145 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=54145 Log: gc.c: tick for POWER arch * gc.c (tick): Use __builtin_ppc_get_timebase for POWER arch. [Fix GH-1291] This gives a little performance improvement user system total real Before: 20.870000 0.000000 20.870000 ( 20.893959) After: 20.720000 0.000000 20.720000 ( 20.733970) Modified files: trunk/ChangeLog trunk/gc.c Index: gc.c =================================================================== --- gc.c (revision 54144) +++ gc.c (revision 54145) @@ -935,6 +935,18 @@ tick(void) https://github.com/ruby/ruby/blob/trunk/gc.c#L935 return ((unsigned long long)lo)|( ((unsigned long long)hi)<<32); } +#elif defined(__powerpc64__) && \ + ( __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) +typedef unsigned long long tick_t; +#define PRItick "llu" + +static __inline__ tick_t +tick(void) +{ + unsigned long long val = __builtin_ppc_get_timebase(); + return val; +} + #elif defined(_WIN32) && defined(_MSC_VER) #include <intrin.h> typedef unsigned __int64 tick_t; Index: ChangeLog =================================================================== --- ChangeLog (revision 54144) +++ ChangeLog (revision 54145) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Thu Mar 17 17:14:51 2016 Dinar Valeev <dvaleev@s...> + + * gc.c (tick): Use __builtin_ppc_get_timebase for POWER arch. + [Fix GH-1291] + Thu Mar 17 11:51:48 2016 NARUSE, Yui <naruse@r...> * lib/securerandom.rb (gen_random): to avoid blocking on Windows. -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/