[vectorIntrinsics] RFR: 8285281: [x86] Add C2 mid-end and back-end implementation for COMPRESS_BITS and EXPAND_BITS operations [v2]
Xiaohong Gong
xgong at openjdk.java.net
Fri Apr 22 09:20:57 UTC 2022
On Thu, 21 Apr 2022 13:27:41 GMT, Jatin Bhateja <jbhateja at openjdk.org> wrote:
>> Summary of changes:
>> - Patch intrinsifies following newly added Java SE APIs
>> 1. Integer.compress
>> 2. Integer.expand
>> 3. Long.compress
>> 4. Long.expand
>> - Adds C2 IR nodes and corresponding ideal transformations for new operations.
>> - Inline expansion of new vector operations COMPRESS_BITS and EXPAND_BITS are performed using their scalar counterparts and lane insertion/extraction operations.
>> - Performance of JIT sequence generated using above approach vs directly vectorizing scalar algorithm using existing vector APIs is within in +/-%10 range depending on the width of the operation, since X86 offers direct instructions PEXT/PDEP for parallel bit extraction and deposition operations hence performance of scalar loop is always superior to corresponding vector operations.
>> - Adds an IR framework based test to validate newly introduced IR transformations.
>>
>> Kindly review and share your feedback.
>>
>> Best Regards,
>> Jatin
>
> Jatin Bhateja has updated the pull request incrementally with one additional commit since the last revision:
>
> 8285281: Removing CompressExpand.java since fallback implementation directly calls new [Integer/Long].[compress/expand] Java SE APIs
src/hotspot/share/opto/vectorIntrinsics.cpp line 225:
> 223: if (C->print_intrinsics()) {
> 224: tty->print_cr(" ** Rejected vector op (%s,%s,%d) because architecture does not support variable vector shifts",
> 225: NodeClassNames[sopc], type2name(type), num_elem);
The comment should be updated to "bitshuffle" related.
src/hotspot/share/opto/vectorIntrinsics.cpp line 349:
> 347: }
> 348:
> 349: Node* LibraryCallKit::gen_bitshuffle_operation(int voper, BasicType elem_bt, int num_elem, Node* opd1, Node* opd2) {
Could you please rename `voper` to `opc` ? The name looks like the opcode expected to be a vector type.
-------------
PR: https://git.openjdk.java.net/panama-vector/pull/195
More information about the panama-dev
mailing list