RFR (L): 8035857: Add tests to verify correctness of operations with BMI1 and LZCNT instructions
Filipp Zhinkin
filipp.zhinkin at oracle.com
Fri Mar 21 14:11:33 UTC 2014
Hi,
I've fixed issues in Asserts.java and made all CPUInfo methods static.
Updated webrev:
http://cr.openjdk.java.net/~iignatyev/fzhinkin/8035857/webrev.01/
Thanks,
Filipp.
On 03/21/2014 12:12 PM, Filipp Zhinkin wrote:
> Hi Vladimir,
>
> thank you for looking at it.
>
> On 03/21/2014 06:13 AM, Vladimir Kozlov wrote:
>> Filipp,
>>
>> 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.
> I'll fix it.
>>
>> Can you pass WB into CPUInfo() constructor instead of
>> wb.getCPUFeatures() to shorter expression?:
>>
>> new CPUInfo(wb).hasFeature("bmi1")
>>
>> Or it is difficult?
> I'll fix it too.
>
> Thanks,
> Filipp.
>>
>> Thanks,
>> Vladimir
>>
>> 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