[9] RFR (L): JDK-8055903: Develop sanity tests on SPARC's SHA instructions support

Filipp Zhinkin filipp.zhinkin at oracle.com
Fri Aug 29 18:13:36 UTC 2014


On 29.08.2014 20:43, Vladimir Kozlov wrote:
> On 8/29/14 9:37 AM, Filipp Zhinkin wrote:
>> Vladimir,
>>
>> On 29.08.2014 20:32, Vladimir Kozlov wrote:
>>> So it is mostly verification that intrinsic is used.
>> Right.
>>> The code looks fine.
>>> But what about testing that intrinsic produce correct data?
>> It is done by compiler/intrinsics/sha/TestSHA.java test:
>> http://hg.openjdk.java.net/jdk9/hs-comp/hotspot/file/3a2d373abcab/test/compiler/intrinsics/sha/TestSHA.java#l104 
>>
>
> I know about this test but I though we may not cover all cases.
> Did you evaluate it? I am fine if you think that everything is covered.
Originally I was concerned by the fact that this test use messages of 
fixed size.
However, while the multi-block intrinsic (_digestBase_implCompressMB) 
will be used
to compute the digest for almost all blocks, a single block intrinsic 
(_sha*_implCompress)
still will be used to compute the digest of the final block, thus if one 
of this intrinsics
compute the digest incorrectly, then the overall result will be incorrect.

Sanity tests invoke TestSHA::testSHA, so it is covered with different 
combinations
of UseSHA & UseSHA*Intrinsics.

Also, there a lot of JDK tests which verify that different security 
algorithms which use SHA*
message digests work well.

And there is sun/security/provider/MessageDigest/DigestKAT.java test, 
which compares
message digest computed using SHA* algorithms with precomputed values.

So I believe that there is no need to develop additional tests.

Thanks,
Filipp.
>
> Thanks,
> Vladimir
>
>>
>> Thanks,
>> Filipp.
>>>
>>> Thanks,
>>> Vladimir
>>>
>>> On 8/29/14 7:45 AM, Filipp Zhinkin wrote:
>>>> Hi all,
>>>>
>>>> please review sanity tests on SHA intrinsics support.
>>>>
>>>> Tests verify that appropriate intrinsic is emitted whencorresponding
>>>> option is enabled and not emitted ifsuch option is disabled.
>>>>
>>>> In case when CPU does not support required instructions or
>>>> JVM configuration does not allow to use an intrinsic,
>>>> the test will expect that intrinsic will not be emitted.
>>>>
>>>> Bug id: https://bugs.openjdk.java.net/browse/JDK-8055903
>>>> Webrev: http://cr.openjdk.java.net/~fzhinkin/8055903/webrev.00/
>>>> Testing: manual, automated.
>>>>
>>>> Thanks,
>>>> Filipp.
>>



More information about the hotspot-compiler-dev mailing list