RFR: 8254231: Implementation of Foreign Linker API (Incubator) [v18]

Jorn Vernee jvernee at openjdk.java.net
Wed Nov 11 14:48:04 UTC 2020


On Wed, 11 Nov 2020 14:17:20 GMT, Vladimir Ivanov <vlivanov at openjdk.org> wrote:

>> Maurizio Cimadamore has updated the pull request incrementally with 10 additional commits since the last revision:
>> 
>>  - Merge pull request #7 from JornVernee/Additional_Review_Comments
>>    
>>    Additional review comments
>>  - Revert System.java changes
>>  - Set copyright year for added files to 2020
>>  - Check result of AttachCurrentThread
>>  - Sort includes alphabetically
>>  - Relax ret_addr_offset() assert
>>  - Extra space after if
>>  - remove excessive asserts in ProgrammableInvoker::invoke_native
>>  - Remove os::is_MP() check
>>  - remove blank line in thread.hpp
>
> src/hotspot/cpu/x86/universalNativeInvoker_x86.cpp line 77:
> 
>> 75:     XMMRegister reg = _abi->_vector_argument_registers.at(i);
>> 76:     size_t offs = _layout->arguments_vector + i * sizeof(VectorRegister);
>> 77:     if (UseAVX >= 3) {
> 
> Assuming worst-case scenario (w.r.t. value size) is sub-optimal. Considering FP values are handled as vectors you end up operating on 32-bit/64-bit values as if they were 512-bit in size. And, in addition to wasted memory bandwidth, EVEX-encoded instructions may trigger CPU frequency scaling which will penalize cases when AVX512 is not used. So, it is worth considering annotating vector values with their actual sizes and taking the size into account when operating on vectors.

Yes, more cleanup is needed here. We don't support vectors at all right now, so I'd rather remove this code and only operate on XMM registers instead.

In the future this could be handled using separate VMStorage types for different vector sizes.

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

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


More information about the core-libs-dev mailing list