Request for reviews (L): 6823354: Add intrinsics for{Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()

Vladimir Kozlov Vladimir.Kozlov at Sun.COM
Wed Apr 22 18:33:47 PDT 2009

On sparc:

Why do you use different registers for popc() in countTrailingZeros
and in countLeadingZerosL?
You can use the same register (as you do in countLeadingZerosI)
and avoid using tmp register in countTrailingZeros and tmp2 in

Use the next code to avoid using tmp register on x86:

     bsrl    $dst, $src
     jnz     skip
     movl    $dst, -1
     negl    $dst
     addl    $dst, 31

 > Also why you keep default 'false' values for Count flags?

   I understand now why it is 'false'.


Vladimir Kozlov wrote:
> Christian,
> About compiler changes:
> I think you can add a new common ideal node super class (CountBits ?)
> since all new ideal nodes and PopCount have the same bottom_type and 
> ideal_req
> instead of repeating the same declarations.
> Also why you keep default 'false' values for Count flags?
> I will look on assembler next.
> Vladimir
> Christian Thalinger wrote:

More information about the hotspot-compiler-dev mailing list