+1 Consider checking in your exhaustive test in such a way that it doesn't get run automatically in exhaustive mode by jtreg, perhaps controlled by a system property.
On Fri, May 18, 2018 at 2:44 PM, Ivan Gerasimov <[email protected]> wrote: > I vote for this variant. > > With kind regards, > > Ivan > > > > On 5/18/18 12:05 PM, Claes Redestad wrote: > >> >> >> On 2018-05-18 20:23, Ivan Gerasimov wrote: >> >>> Another approach may be to just delegate to >>> Integer.numberOfLeadingZeros() like this: >>> >>> public static int numberOfLeadingZeros(long i) { >>> int x = (int)(i >>> 32); >>> return x == 0 ? 32 + Integer.numberOfLeadingZeros((int)i) >>> : Integer.numberOfLeadingZeros(x); >>> } >>> >> >> I'm partial to the simplicity of this solution - whether or not there are >> platforms where 64-bit >> lz instruction is missing. It's very slightly slower than baseline for >> -Xint, but markedly faster >> when C1-compiled, which I think weighs heavier. >> >> http://cr.openjdk.java.net/~redestad/8203352/open.01/ >> >> /Claes >> >> > -- > With kind regards, > Ivan Gerasimov > >
