On Thu, Apr 28, 2011 at 11:18 AM, Rémi Forax <fo...@univ-mlv.fr> 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's a related question. Is there a way we can structure the double xor trick to get Hotspot to intrinsify it as a jc instruction or similar? As I posted earlier, we use the "double xor" trick, which I would expect JVM could recognize as a carry check and do the right thing. Or perhaps there's an intrinsic somewhere in JVM/JDK we could call? I did a couple comparisons, and it seems like for math-heavy logic the current overflow check adds about 10% overhead...much more than I'd like :( - Charlie _______________________________________________ mlvm-dev mailing list mlvm-dev@openjdk.java.net http://mail.openjdk.java.net/mailman/listinfo/mlvm-dev