Re: [PATCH] Add native windows on arm64 support
Niyas Sait <niyas.sait@linaro.org>
From: Niyas Sait <niyas.sait@linaro.org>
To: Michael Paquier <michael@paquier.xyz>, Andres Freund <andres@anarazel.de>
Cc: Ian Lawrence Barwick <barwick@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>,
Thomas Munro <thomas.munro@gmail.com>, Julien Rouhaud <rjuju123@gmail.com>,
PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2022-12-01T17:20:20Z
Lists: pgsql-hackers
On 07/11/2022 06:58, Michael Paquier wrote:
>>> #if defined(_WIN64)
>>> static __forceinline void
>>> spin_delay(void)
>>> {
>>> +#ifdef _M_ARM64
>>> + /*
>>> + * arm64 way of hinting processor for spin loops optimisations
>>> + * ref: https://community.arm.com/support-forums/f/infrastructure-solutions-forum/48654/ssetoneon-faq
>>> + */
>>> + __isb(_ARM64_BARRIER_SY);
>>> +#else
>>> _mm_pause();
>>> +#endif
>>> }
>>> #else
>>> static __forceinline void
>>
>> I think we should just apply this, there seems very little risk of making
>> anything worse, given the gating to _WIN64 && _M_ARM64.
>
> Seems so. Hmm, where does _ARM64_BARRIER_SY come from? Perhaps it
> would be better to have a comment referring to it from a different
> place than the forums of arm, like some actual docs?
_ARM64_BARRIER_SY is defined in Microsoft Arm64 intrinsic documentation
-
https://learn.microsoft.com/en-us/cpp/intrinsics/arm64-intrinsics?view=msvc-170#BarrierRestrictions
I couldn't find something more official for the sse2neon library part.
--
Niyas
Commits
-
MSVC: Support building for AArch64.
- a516b3f00d74 19 (unreleased) landed
-
Remove "#ifdef WIN32" guards from src/port/win32*.c
- 09eb633e1baa 17.0 cited
-
Adjust XML test case to avoid unstable behavior.
- 4ea07e7cf3c6 16.0 landed
-
Enable RandomizedBaseAddress (ASLR) on Windows with MSVC builds
- 36389a060ca6 16.0 landed