RFR (L): 8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions

Vladimir Kozlov vladimir.kozlov at oracle.com
Fri Mar 21 02:13:49 UTC 2014


In Asserts.java (line < longestStringLines.length) condition is strange. 
First, you don't brake the loop, so iterates until line == minLength. So 
the condition can simply check (minLength < longestStringLines.length) 
and you can put 'int line' inside for(). Keep loop index variable 
outside loop is bad practice.

Can you pass WB into CPUInfo() constructor instead of 
wb.getCPUFeatures() to shorter expression?:

new CPUInfo(wb).hasFeature("bmi1")

Or it is difficult?


On 3/20/14 12:12 PM, Filipp Zhinkin wrote:
> Hi all,
> I'd like to add new tests that verifies correctness of code that
> use BMI1 and LZCNT instructions.
> Tests executed in two JVM processes - one started in Xint mode
> and other in Xcomp. Results obtained from these processes compared
> and tests pass only if results are equal.
> Despite the fact that there is a test on
> {Integer,Long}::{numberOfLeadingZeros,numberOfTrailingZeros} intrinsics
> (compiler/6823354/Test6823354.java), I've added test cases to cover it
> too in order to verify that everything works fine with explicitly specified
> +UseCountTrailingZerosInstruction and +UseCountLeadingZerosInstruction.
> Test execution will be skipped if CPU on test box does not support
> required features. In order to check supported features new WB method
> was added. WhiteBox::getCPUFeatures() return VM_Version::cpu_features()
> string, which is parsed in order to gather CPU features.
> Webrev: http://cr.openjdk.java.net/~iignatyev/fzhinkin/8035857/webrev.00/
> Testing: JPRT, manual, automated.
> Thanks,
> Filipp.

More information about the hotspot-compiler-dev mailing list