Re: Assembly output from JRuby 'fib'

2011-05-03 Thread Charles Oliver Nutter
Well, that's a good question. We would want it for any operation that could overflow. I do not know about such things...someone more familiar with machine/JVM overflow and checks for it would want to flesh out details. Perhaps something like Math.isCarry(long operand1, long operand2, long result

Re: Assembly output from JRuby 'fib'

2011-05-03 Thread Rémi Forax
On 05/03/2011 10:29 PM, Charles Oliver Nutter wrote: > An intrinsic was my first thought as well. It would seem quite appropriate to > have an operation or set of operations on java.lang.Math for example that we > all could use. > > Perhaps I should have asked this six months ago :) > > - Charlie

Re: Assembly output from JRuby 'fib'

2011-05-03 Thread Charles Oliver Nutter
An intrinsic was my first thought as well. It would seem quite appropriate to have an operation or set of operations on java.lang.Math for example that we all could use. Perhaps I should have asked this six months ago :) - Charlie (mobile) On May 3, 2011, at 11:44, Christian Thalinger wrote:

Re: Assembly output from JRuby 'fib'

2011-05-03 Thread Christian Thalinger
On May 3, 2011, at 5:06 PM, Rémi Forax wrote: > On 05/03/2011 03:59 PM, Christian Thalinger wrote: >> On May 2, 2011, at 9:55 PM, Charles Oliver Nutter wrote: >>> On Thu, Apr 28, 2011 at 11:18 AM, Rémi Forax wrote: Do you specialize the overflow check depending on the callsite ? for fib(

Re: Assembly output from JRuby 'fib'

2011-05-03 Thread Rémi Forax
On 05/03/2011 03:59 PM, Christian Thalinger wrote: > On May 2, 2011, at 9:55 PM, Charles Oliver Nutter wrote: >> On Thu, Apr 28, 2011 at 11:18 AM, Rémi Forax wrote: >>> Do you specialize the overflow check depending on the callsite ? >>> for fib(n - 1), you just have to check if n is different fro

Re: Assembly output from JRuby 'fib'

2011-05-03 Thread Rémi Forax
On 05/03/2011 03:59 PM, Christian Thalinger wrote: > On May 2, 2011, at 9:55 PM, Charles Oliver Nutter wrote: >> On Thu, Apr 28, 2011 at 11:18 AM, Rémi Forax wrote: >>> Do you specialize the overflow check depending on the callsite ? >>> for fib(n - 1), you just have to check if n is different fro

Re: Assembly output from JRuby 'fib'

2011-05-03 Thread Christian Thalinger
On May 2, 2011, at 9:55 PM, Charles Oliver Nutter wrote: > On Thu, Apr 28, 2011 at 11:18 AM, Rémi Forax wrote: >> Do you specialize the overflow check depending on the callsite ? >> for fib(n - 1), you just have to check if n is different from >> Integer.MIN_INT, >> for fib(n - 2), if n is <= to I

Re: Assembly output from JRuby 'fib'

2011-05-02 Thread Charles Oliver Nutter
On Thu, Apr 28, 2011 at 11:18 AM, Rémi Forax wrote: > Do you specialize the overflow check depending on the callsite ? > for fib(n - 1), you just have to check if n is different from > Integer.MIN_INT, > for fib(n - 2), if n is <= to Integer.MIN_INT - 1 > and for + use the double xor tricks. Here

Re: Assembly output from JRuby 'fib'

2011-05-02 Thread Christian Thalinger
On Apr 29, 2011, at 3:44 PM, Rémi Forax wrote: > On 04/29/2011 01:09 PM, Christian Thalinger wrote: >> On Apr 28, 2011, at 3:19 PM, Charles Oliver Nutter wrote: >>> On Thu, Apr 28, 2011 at 5:16 AM, Christian Thalinger >>> wrote: I took a look at it. I used 64-bit x86 since the code is a bit

Re: Assembly output from JRuby 'fib'

2011-05-01 Thread Mark Roos
bottom of the list. Without ASM I would not have seen this bug in the compiler so thanks mark From: Rémi Forax To: mlvm-dev@openjdk.java.net Date: 05/01/2011 08:44 AM Subject: Re: Assembly output from JRuby 'fib' Sent by: mlvm-dev-boun...@openjdk.java.net It's aston

Re: Assembly output from JRuby 'fib'

2011-05-01 Thread Rémi Forax
ad instructions did not seem to matter. mark From: Charles Oliver Nutter <mailto:head...@headius.com>> To: Da Vinci Machine Project <mailto:mlvm-dev@openjdk.java.net>> Date: 04/28/2011 11:17 AM Subject:Re: Assembly output from JRuby 'fib'

Re: Assembly output from JRuby 'fib'

2011-04-29 Thread Charles Nutter
gt; To: Da Vinci Machine Project > Date: 04/28/2011 11:17 AM > Subject: Re: Assembly output from JRuby 'fib' > Sent by: mlvm-dev-boun...@openjdk.java.net > > > > > On Thu, Apr 28, 2011 at 11:03 AM, Rémi Forax wrote: > > On 04/28/

Re: Assembly output from JRuby 'fib'

2011-04-29 Thread Mark Roos
went away. The other dead instructions did not seem to matter. mark From: Charles Oliver Nutter To: Da Vinci Machine Project Date: 04/28/2011 11:17 AM Subject: Re: Assembly output from JRuby 'fib' Sent by: mlvm-dev-boun...@openjdk.java.net On Thu, Apr 28, 2011 at 11:03 AM, Rémi Fo

Re: Assembly output from JRuby 'fib'

2011-04-29 Thread Rémi Forax
On 04/28/2011 08:28 PM, Charles Oliver Nutter wrote: [...] > * Fixnum overflow checks in + and - operations >> Do you specialize the overflow check depending on the callsite ? >> for fib(n - 1), you just have to check if n is different from >> Integer.MIN_INT, >> for fib(n - 2), if n is<= to

Re: Assembly output from JRuby 'fib'

2011-04-29 Thread Rémi Forax
On 04/29/2011 01:09 PM, Christian Thalinger wrote: > On Apr 28, 2011, at 3:19 PM, Charles Oliver Nutter wrote: >> On Thu, Apr 28, 2011 at 5:16 AM, Christian Thalinger >> wrote: >>> I took a look at it. I used 64-bit x86 since the code is a bit smaller >>> than with 32-bit. >>> >>> The code is a

Re: Assembly output from JRuby 'fib'

2011-04-29 Thread Christian Thalinger
On Apr 28, 2011, at 3:19 PM, Charles Oliver Nutter wrote: > On Thu, Apr 28, 2011 at 5:16 AM, Christian Thalinger > wrote: >> I took a look at it. I used 64-bit x86 since the code is a bit smaller than >> with 32-bit. >> >> The code is almost identical but three things popped into my eye (the ou

Re: Assembly output from JRuby 'fib'

2011-04-29 Thread Christian Thalinger
On Apr 28, 2011, at 4:50 PM, Charles Oliver Nutter wrote: > On Thu, Apr 28, 2011 at 9:17 AM, Christian Thalinger > wrote: >> I have now a patch that makes the command line switch tweaking superfluous >> and the default performance looks pretty good (see below, 32-bit x86). > > That's excellent!

Re: Assembly output from JRuby 'fib'

2011-04-28 Thread Rémi Forax
On 04/28/2011 08:15 PM, Charles Oliver Nutter wrote: > On Thu, Apr 28, 2011 at 11:03 AM, Rémi Forax wrote: >> On 04/28/2011 03:56 PM, Charles Oliver Nutter wrote: >>> stack map is invalid. Could be an ASM bug? >> yes. it could :) >> >> Also it could be a bug on your side because to calculate stack

Re: Assembly output from JRuby 'fib'

2011-04-28 Thread Charles Oliver Nutter
On Thu, Apr 28, 2011 at 11:18 AM, Rémi Forax wrote: >>> >  Any thoughts on how we can make this even faster? The bulk of the code >>> >  seems to be taken up by a few operations inherent to Fixnum math: >>> > >>> >  * Memory accesses relating to CallSite subclasses (LtCallSite and >>> > friends)

Re: Assembly output from JRuby 'fib'

2011-04-28 Thread Charles Oliver Nutter
On Thu, Apr 28, 2011 at 11:03 AM, Rémi Forax wrote: > On 04/28/2011 03:56 PM, Charles Oliver Nutter wrote: >> stack map is invalid. Could be an ASM bug? > > yes. it could :) > > Also it could be a bug on your side because to calculate stackmap > ASM needs to be able to find the common supertype of

Re: Assembly output from JRuby 'fib'

2011-04-28 Thread Rémi Forax
On 04/28/2011 04:27 PM, Christian Thalinger wrote: > On Apr 28, 2011, at 3:56 PM, Charles Oliver Nutter wrote: >> > On Thu, Apr 28, 2011 at 8:19 AM, Charles Oliver Nutter >> >wrote: >>> >> I've been trying to think of ways to reduce the guard cost, since the >>> >> perf without the JRuby gua

Re: Assembly output from JRuby 'fib'

2011-04-28 Thread Rémi Forax
On 04/28/2011 03:56 PM, Charles Oliver Nutter wrote: > BTW, a note on JRuby test failures running indy... (i.e. ATTN REMI) > > I'm having some trouble with JRuby's compiler and ASM failing to emit > valid stack maps. There are some compilation scenarios in JRuby that > may be exposing a bug in ASM'

Re: Assembly output from JRuby 'fib'

2011-04-28 Thread Charles Oliver Nutter
On Thu, Apr 28, 2011 at 9:17 AM, Christian Thalinger wrote: > I have now a patch that makes the command line switch tweaking superfluous > and the default performance looks pretty good (see below, 32-bit x86). That's excellent! I can't wait to see that land. A couple notes I haven't included in

Re: Assembly output from JRuby 'fib'

2011-04-28 Thread Christian Thalinger
On Apr 28, 2011, at 3:56 PM, Charles Oliver Nutter wrote: > On Thu, Apr 28, 2011 at 8:19 AM, Charles Oliver Nutter > wrote: >> I've been trying to think of ways to reduce the guard cost, since the >> perf without the JRuby guard is a fair bit better (0.79 versus 0.63s >> for fib(35)). The performa

Re: Assembly output from JRuby 'fib'

2011-04-28 Thread Christian Thalinger
On Apr 28, 2011, at 12:33 PM, Christian Thalinger wrote: > On Apr 28, 2011, at 12:16 PM, Christian Thalinger wrote: >> On Apr 27, 2011, at 5:54 AM, Charles Oliver Nutter wrote: >>> I prepared this for someone else, but I thought folks here might be >>> interested in it too. >>> >>> This gist conta

Re: Assembly output from JRuby 'fib'

2011-04-28 Thread Charles Oliver Nutter
On Thu, Apr 28, 2011 at 8:19 AM, Charles Oliver Nutter wrote: > I've been trying to think of ways to reduce the guard cost, since the > perf without the JRuby guard is a fair bit better (0.79 versus 0.63s > for fib(35)). The performance without guards is actually faster than > any other Ruby imple

Re: Assembly output from JRuby 'fib'

2011-04-28 Thread Charles Oliver Nutter
On Thu, Apr 28, 2011 at 5:16 AM, Christian Thalinger wrote: > I took a look at it.  I used 64-bit x86 since the code is a bit smaller than > with 32-bit. > > The code is almost identical but three things popped into my eye (the output > is from PrintOptoAssembly): > > 1. The obvious one:  the me

Re: Assembly output from JRuby 'fib'

2011-04-28 Thread Christian Thalinger
On Apr 28, 2011, at 12:16 PM, Christian Thalinger wrote: > On Apr 27, 2011, at 5:54 AM, Charles Oliver Nutter wrote: >> I prepared this for someone else, but I thought folks here might be >> interested in it too. >> >> This gist contains hotspot x86 (32-bit) assembly output for JRuby's >> dynopt m

Re: Assembly output from JRuby 'fib'

2011-04-28 Thread Christian Thalinger
On Apr 27, 2011, at 5:54 AM, Charles Oliver Nutter wrote: > I prepared this for someone else, but I thought folks here might be > interested in it too. > > This gist contains hotspot x86 (32-bit) assembly output for JRuby's > dynopt mode and invokedynamic (on a couple-week-old OS X OpenJDK > build

Re: Assembly output from JRuby 'fib'

2011-04-27 Thread Christian Thalinger
On Apr 27, 2011, at 5:54 AM, Charles Oliver Nutter wrote: > I prepared this for someone else, but I thought folks here might be > interested in it too. > > This gist contains hotspot x86 (32-bit) assembly output for JRuby's > dynopt mode and invokedynamic (on a couple-week-old OS X OpenJDK > build