8038953,Add sanity tests for BMI1 and LZCNT instructions

Vladimir Kozlov vladimir.kozlov at oracle.com
Tue Apr 1 19:56:40 UTC 2014


Okay, I see that you do use code from Filipp's changes (for example, 
TestAndnI.AndnIExpr).

I think subdir name 'sanity' is not accurate and too general.
Something like 'verifycode' or similar is more reasonable.

Why you not bailing out (skip test) in main() (or in test()) when 
intrinsic is not used?

An asm instruction could be used without intrinsic. It all depends on 
mach instructions matching rules in implementation in .ad file. So your 
  AssertionError "Unexpected CPU instructions found: " could be 
triggered. Also what if C1 also generate such code? I don't know why you 
have this assert.

I think you need to add WB API to get info if a particular intrinsic was 
really used. Even if you pass UseCountTrailingZerosInstruction flag it 
could be overwritten by InlineNatives flag. There could be other legit 
reasons we don't use an intrinsic.

On 4/1/14 10:51 AM, Anton Ivanov wrote:
> Hi Vladimir,
>
> They test different things,
> Fillip's tests - verify results to be the same for compiler and
> interpreter (but imagine compiler do not use intrinsic at all, test will
> pass too, because they will do exactly the same operations)

It is not true. Even when it is not intrinsic JIT still generates 
assembler code which could be problematic.

Thanks,
Vladimir

> My tests verify only that certain asm instructions are presented in
> native code emitted by compiler (but do not verify the correctness of
> execution)
> Combination of these 2 sets of tests makes sure that new instructions
> are really used, and used correctly.
> It also was not easy to modify Fillip's tests because they were
> developed in parallel
>
>
> combination of these 2 sets give us
>
> On 01.04.2014 21:03, Vladimir Kozlov wrote:
>> I mean why do you need to create separate tests and not use (add new
>> code) existing one?
>> For example, you added bmi/sanity/AddnTestI.java when there is already
>> bmi/TestAndnI.java.
>>
>> Thanks,
>> Vladimir
>>
>> On 4/1/14 9:57 AM, Vladimir Kozlov wrote:
>>> Anton,
>>>
>>> How your changes relate to Filipp's?:
>>>
>>> http://hg.openjdk.java.net/jdk9/hs-comp/hotspot/rev/15d507abfc7a
>>>
>>> Thanks,
>>> Vladimir
>>>
>>> On 4/1/14 9:40 AM, Anton Ivanov wrote:
>>>> Hi all,
>>>>
>>>> Please review the patch
>>>>
>>>> New tests for using of blsi,blsr,andn,blsmsk,lzcnt,tzcnt
>>>> instructions were developed.
>>>> They verify that instructions above are really presented in emitted
>>>> native code on supported hardware
>>>>
>>>> webrev:
>>>> http://cr.openjdk.java.net/~iignatyev/aaivanov/8038953/webrev.00
>>>> jbs: https://bugs.openjdk.java.net/browse/JDK-8038953
>>>> testing: test/compiler/intrinsics/bmi/sanity
>>>>
>


More information about the hotspot-compiler-dev mailing list