RFR: 8290034: Auto vectorize reverse bit operations. [v2]

John R Rose jrose at openjdk.org
Fri Aug 19 06:43:41 UTC 2022


On Wed, 27 Jul 2022 15:55:11 GMT, Jatin Bhateja <jbhateja at openjdk.org> wrote:

>> Summary of changes:
>> - Intrinsify scalar bit reverse APIs to emit efficient instruction sequence for X86 targets with and w/o GFNI feature.
>> - Handle auto-vectorization of Integer/Long.reverse bit operations.
>> - Backend implementation for these were added with 4th incubation of VectorAPIs.
>> 
>> Following are performance number for newly added JMH mocro benchmarks:-
>> 
>> 
>> No-GFNI(CLX):
>> =============
>> Baseline:
>> Benchmark         (size)  Mode  Cnt  Score   Error  Units
>> Integers.reverse     500  avgt    2  1.085          us/op
>> Longs.reverse        500  avgt    2  1.236          us/op
>> WithOpt:
>> Benchmark         (size)  Mode  Cnt  Score   Error  Units
>> Integers.reverse     500  avgt    2  0.104          us/op
>> Longs.reverse        500  avgt    2  0.255          us/op
>> 
>> With-GFNI(ICX):
>> ===============
>> Baseline:
>> Benchmark         (size)  Mode  Cnt  Score   Error  Units
>> Integers.reverse     500  avgt    2  0.887          us/op
>> Longs.reverse        500  avgt    2  1.095          us/op
>> 
>> Without:
>> Benchmark         (size)  Mode  Cnt  Score   Error  Units
>> Integers.reverse     500  avgt    2  0.037          us/op
>> Longs.reverse        500  avgt    2  0.145          us/op
>> 
>> 
>> Kindly review and share feedback.
>> 
>> Best Regards,
>> Jatin
>
> Jatin Bhateja has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision:
> 
>  - Merge branch 'master' of http://github.com/openjdk/jdk into JDK-8290034
>  - 8290034: Styling comments resolved.
>  - 8290034: Adding descriptive comments.
>  - 8290034: Auto vectorize reverse bit operations.

src/hotspot/share/opto/subnode.cpp line 1903:

> 1901: }
> 1902: 
> 1903: static jlong reverse_bits(jlong val) {

This function is wrong and/or misnamed.
It should be called reverse_bits_in_bytes.

-------------

PR: https://git.openjdk.org/jdk/pull/9535


More information about the hotspot-compiler-dev mailing list