RFR: 8283894: Intrinsify compress and expand bits on x86

John R Rose jrose at openjdk.java.net
Tue May 3 00:08:19 UTC 2022


On Mon, 2 May 2022 08:19:53 GMT, Jatin Bhateja <jbhateja at openjdk.org> wrote:

> Summary of changes:
> 
> - Patch intrinsifies following newly added Java SE APIs
>   - Integer.compress
>   - Integer.expand
>   - Long.compress
>   - Long.expand
>   
> - Adds C2 IR nodes and corresponding ideal transformations for new operations.
> - We see around ~10x performance speedup due to intrinsification over X86 target. 
> - Adds an IR framework based test to validate newly introduced IR transformations.
> 
> Kindly review and share your feedback.
> 
> Best Regards,
> Jatin

src/hotspot/share/opto/intrinsicnode.cpp line 155:

> 153:       return new AndLNode(compr, src->in(1));
> 154:     }
> 155:   }

I think a further rule for `compress(m, m)` could be in order.


compress(m, m) = m==-1 ? m : (1L << PopCount[IL](m))-1


This should be its own path through `Ideal`, not special logic at this particular point.

Don't use it unless `Matcher::match_rule_supported(Op_PopCount[IL])` is true.

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

PR: https://git.openjdk.java.net/jdk/pull/8498


More information about the hotspot-compiler-dev mailing list