RFR: 8264543: Cross modify fence optimization for x86 [v5]
David Holmes
dholmes at openjdk.java.net
Mon Aug 2 07:35:36 UTC 2021
On Mon, 2 Aug 2021 07:20:00 GMT, Xubo Zhang <github.com+58006833+xbzhang99 at openjdk.org> wrote:
>> Intel introduced a new instruction “serialize” which ensures that all modifications to flags, registers, and memory by previous instructions are completed and all buffered writes are drained to memory before the next instruction is fetched and executed. It is a serializing instruction and can be used to implement cross modify fence (OrderAccess::cross_modify_fence_impl) more efficiently than using “cpuid” on supported 32-bit and 64-bit x86 platforms.
>>
>> The availability of the SERIALIZE instruction is indicated by the presence of the CPUID feature flag SERIALIZE, bit 14 of the EDX register in sub-leaf CPUID:7H.0H.
>>
>> https://software.intel.com/content/www/us/en/develop/download/intel-architecture-instruction-set-extensions-programming-reference.html
>
> Xubo Zhang has updated the pull request incrementally with one additional commit since the last revision:
>
> fix _MSC_VER check
src/hotspot/os_cpu/windows_x86/orderAccess_windows_x86.hpp line 64:
> 62: #if _MSC_VER >= 1927
> 63: {
> 64: //_serialize() ntrinsic is supported starting from VS2019-16.7.2
16.7.2 is the earliest I could look at, but it could be supported earlier. Also _MSC_VER of 1927 would start with 16.7.0 so it wouldn't quite be right to test for that if it only come in with 16.7.2.
Typo: ntrinsic
src/hotspot/os_cpu/windows_x86/orderAccess_windows_x86.hpp line 66:
> 64: //_serialize() ntrinsic is supported starting from VS2019-16.7.2
> 65: if (VM_Version::supports_serialize()) {
> 66: _xxserialize();
_xx ???
-------------
PR: https://git.openjdk.java.net/jdk/pull/4848
More information about the hotspot-dev
mailing list