RFR: 8162865 Implementation of SPARC lzcnt

Trevor Watson trevor.d.watson at oracle.com
Wed Nov 30 15:29:50 UTC 2016

Hi Vladimir,

Thanks for the review. Comments inline below...

On 22/11/16 20:04, Vladimir Kozlov wrote:
> Do you have performance numbers?

I've spent a lot of time looking at performance and it's proving verify 
difficult to precisely quantify either on a T5 or an S7. However, 
overall, it would appear that using the native lzcnt instruction is 
around 10% quicker than the current implementation which uses POPC.

> UseVIS is too wide flag to control only these instructions generation.
> To be consistent with x86 code please add
> UseCountLeadingZerosInstruction flag to globals_sparc.hpp and its
> setting in vm_version_sparc.cpp (based on has_vis3()) similar to what is
> done for x86.

I've done this and it actually proved useful in testing as I was able to 
turn off lzcnt and use popc and vice-versa :)

> May be name new instructions *ZerosIvis instead of *ZerosI1 to be clear
> that VIS is used.


> Indention in the new test is all over place. Please, fix.

I've fixed it (I hope) and broken the test up into separate Integer and 
Long tests to be consistent with the rest of the BMI tests in that 

I've run the jtreg bmi tests on Solaris 12 SPARC and x86 and am awaiting 
the results of a jprt (hotspot) run on all platforms.

The code review is in the same place as before:
>> http://cr.openjdk.java.net/~alanbur/8162865/


More information about the hotspot-dev mailing list