Migrating from -march=nocona -msahf to -march=x86-64-v2
#29999
Replies: 59 comments
-
|
That baseline was based on Windows 10 not 8.1, According to microsoft requirements in https://learn.microsoft.com/en-us/windows-hardware/design/minimum/minimum-hardware-requirements-overview#download-minimum-hardware-requirements
|
Beta Was this translation helpful? Give feedback.
-
|
Well, actually all CPUs in Supported AMD Processors and Supported Intel Processors supports |
Beta Was this translation helpful? Give feedback.
-
|
@dragon-archer What would say to someone running Windows 10 on an old CPU that satisfy the requirments I cited above, If they report that MSYS binaries stop working on Their PCs? |
Beta Was this translation helpful? Give feedback.
-
|
I think these situations would be very rare. From here we can find that most CPUs since 2013 and all CPUs since 2015 have supported x86-64-v2, which is at least 11 years till now, a very long time even older than Windows 10 itself. I do think we could add "x86_64-v2+ CPU" as an extra requirement for MSYS2. |
Beta Was this translation helpful? Give feedback.
-
|
If windows 10 doesn't have those hardware requirements, why should we impose them? |
Beta Was this translation helpful? Give feedback.
-
Now, that is a statement that fails spectacularly at raising my confidence 😆 Do we have any statistics how many users MSYS2 has? If it has, say, 10 million (which I would consider conservative, as Git for Windows alone has these kinds of download numbers occasionally, and Git for Windows users are implicitly MSYS2 users), then even a fraction of 0.1% would translate into ten thousand users being bitten by a change like this. Note: I am not against this change per se, I am against any ill-executed/ill-considered deprecation plan that is based on thought experiments alone rather than hard numbers and proper communication/timelines. |
Beta Was this translation helpful? Give feedback.
-
|
Windows 11 required SSE4.2 and POPCNT, and Windows 10 is also soon to reach EOL. |
Beta Was this translation helpful? Give feedback.
-
|
I think we could first migrate clang64 to x86-64-v2 and keep nocona for ucrt64. If MSYS2 decided to drop support for Windows 10 in the future, we could then migrate ucrt64 to x86-64-v2 as well. AFAIK users who prioritize compatibility always stick with ucrt64 or even mingw64. |
Beta Was this translation helpful? Give feedback.
-
I agree we need statistics, though I think it would be difficult for MSYS2 to do this. May be we could use data from Steam Hardware Survey for reference. (I can't find more relevant survery including ISA 🙅). The latest survey (April 2026) with
We couldn't cover all users all the time, fraction is much more meaningful than absolute couunt.
I'm not asking for a sudden deprecation, but I think we should first draft a deprecation plan. For example, start from clang64 as @Andarwinux suggests. |
Beta Was this translation helpful? Give feedback.
-
We could not use Gamers statistics as a reference, Gamers use Powerful new HW in General. |
Beta Was this translation helpful? Give feedback.
-
|
@dragon-archer I really think you're jumping the gun here and are a little too eager to make this change. You haven't provided evidence of how much perf difference it makes. Your claims are packed with assumptions. |
Beta Was this translation helpful? Give feedback.
-
|
So I suggest we start by testing clang64 to be able to gather feedback including performance and whether it causes real users to complain that it doesn’t work. |
Beta Was this translation helpful? Give feedback.
-
|
benchmarks suggest that x86_64-v2 has not a significant increase in performance, while x86_64-v3 has, because of AVX+AVX2+FMT which help many apps that rely on computing. |
Beta Was this translation helpful? Give feedback.
-
|
Well, personally I prefer x86-64-v3 as well, but since even x86-64-v2 has faced so much opposition, I don’t hold out much hope for it. |
Beta Was this translation helpful? Give feedback.
-
|
Indeed, x86-64-v2 doesn't gain a significant performance increase, while x86-64-v3 has (for example, doubled performance from However, jump to x86-64-v3 is obviously more difficult, so I propose to switch to x86-64-v2 (may be gradully) first. |
Beta Was this translation helpful? Give feedback.
-
How? Windows/COFF even doesn't support hwcap. |
Beta Was this translation helpful? Give feedback.
-
Via downstream implementations like https://doc.rust-lang.org/core/arch/index.html#dynamic-cpu-feature-detection |
Beta Was this translation helpful? Give feedback.
-
|
AFAICT there are two main ways to use SSE/AVX:
For 1 there's likely no benefit, unless
|
Beta Was this translation helpful? Give feedback.
-
|
I've got a new idea. Maybe we do not have to provide a complete new environment UCRT64v3. Instead, we can make it an opt-in upper layer of UCRT64. To be specific, every UCRT64v3 package ( The reason this can be done is that mixing UCRT64v3 packages and UCRT64 packages are DEFINITELY SAFE as long as your CPU supports There might need some change to I'm currently more focused on having a x86-64-v3 varient than upgrading the base to x86-64-v2, not sure whether I should open a new thread, or keep everything here? |
Beta Was this translation helpful? Give feedback.
-
Safe, but mixing SSE instructions with AVX will result in a transition penalty. |
Beta Was this translation helpful? Give feedback.
-
If a program/library is heavly using SSE instructions, most likely it'll gain to be rebuilt with AVX2, so I don't think this will be a real problem. And even if it really occurs, a simple rebuild of relevant package can solve it. |
Beta Was this translation helpful? Give feedback.
-
System libraries do use SSE2, but they can't be rebuilt. You probably need The performance penalty of SSE-AVX transitions varies between micro-architectures; see https://johnk.dev/articles/vex-transition-penalties.html. |
Beta Was this translation helpful? Give feedback.
-
This is enabled by default for |
Beta Was this translation helpful? Give feedback.
-
|
Is it even relevant? You don't call one-off AVX instructions by yourself in the mentioned case. Even if you use SSE/AVX types in the API and mix one library built for SSE (libfoo) with other built for AVX2 CPU (libbar), the API must remain stable. While you shouldn't mix different, incompatible instruction sets within hot code section (for example inside a loop), I don't see how it would be applicable to the libraries. |
Beta Was this translation helpful? Give feedback.
-
|
The benefit of whole-system x86-64-v3 is to eliminate unnecessary vzeroupper with -mno-vzeroupper, although this is not actually applicable on Windows since system libraries only use SSE anyway. (This is primarily useful for clang, because gcc can use VEX tricks to avoid unnecessary vzeroupper as much as possible, whereas clang cannot) -mno-vzeroupper also enable the use of vectorcall calling conventions everywhere, but currently this is meaningless as no compiler provides function call (VFABI) automatic vectorization. |
Beta Was this translation helpful? Give feedback.
-
|
I've seen a few not fully correct statements in this thread so I'd like to clarify a few things:
Probably the most useful part to require from x86-64-v2 are the variable indices shuffle instructions from SSSE3, as in x86-64-v1 shuffles require constant indices. Additionally, both the Windows system libraries and the CRT do use AVX, AVX2 and even AVX512 in their code, but always under runtime availability checks. For the AVX-SSE transition penalty topic, AFAIR it's always basically minimal if the compiler guarantees emitting There's also need to consider that Windows Server versions based on Windows 10 that do not require x86-64-v2 are going to be supported for a few years still and likely to use MSYS2 for CI purposes. As such, I'd say that only x86-64-v2 can be okay to hard require and any code that wants to use stuff newer than it should use runtime checks for availability. |
Beta Was this translation helpful? Give feedback.
-
If people were able to buy AVX2-capable CPUs with same price but not, then the problem is their own stupidity.
That's their problem.
Why should MSYS2 support older wine? If users refuse to upgrade, that’s their problem.
MSYS2 provides clangarm64. if users choose to use x86-64 envs, that's their problem.
There are no GitHub Action runners which don't support AVX2.
https://uops.info/html-instr/VZEROUPPER.html AMD Zen 2 |
Beta Was this translation helpful? Give feedback.
-
|
A recent benchmark from Phoronix of Ubuntu amd64 (x86_64) vs amd64v3 (x86_64-v3) https://www.phoronix.com/review/ubuntu-2610-amd64v3 |
Beta Was this translation helpful? Give feedback.
-
Can I summarize it as 'the performance differences are usually negligible'? |
Beta Was this translation helpful? Give feedback.
-
I would go a step further. The Java/R/POV-Ray penalties (where the changes hurt instead of benefit) suggest that the benchmarks I asked for (by the people who are so in love with making this breaking change) should probably be a mandatory prerequisite to even consider any further steps. It the net result is as mixed as in that article, it might be a really bad idea to even consider spending any more effort on this. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Since support for Windows 8.1 have been dropped, the minimum supported system for MSYS2 have become Windows 10.
All CPUs supported by Windows 10 supports features required by
x86-64-v2, so it should be safe to do this migration.As a reference, RHEL 9 has been using
x86-64-v2since 2021, and RHEL 10 usesx86-64-v3since 2024Beta Was this translation helpful? Give feedback.
All reactions