Open tanksdude opened 2 weeks ago
We still support MSVC 2019 (and outdated MSVC 2022) for now, so I wouldn't use the new flag until a new MSVC version comes out (at which point it's reasonable to drop MSVC 2019 support).
It seems I could have explained that part better: MSVC 2019 does support /arch:SSE4.2
, according to the official docs (I did not test that myself), however versions of Visual Studio (2019, 2022, and apparently 2015 & 2017) before November 2024 do not.
Describe the project you are working on
Godot's build system
Describe the problem or limitation you are having in your project
As of godotengine/godot#59595 and 4.5-dev-5, the SCons build system sets the x86_64 instruction level to SSE4.2. However, on MSVC this is done using the undocumented
/d2archSSE42
flag, while there exists an official/arch:SSE4.2
flag./d2archSSE42
is mainly known through this StackOverflow post, and is not documented in Microsoft Learn./arch:SSE4.2
has been documented since around December 2024 (according to the Internet Archive), and added/known since November 2024.Describe the feature / enhancement and how it helps to overcome the problem or limitation
Pros:
/arch:SSE4.2
is officially documented./arch:SSE4.2
will likely see further development as Windows 11 24H2 raised its minimum to SSE4.2./d2archSSE42
has an unknown future... but will probably work just fine.Cons:
/arch:SSE4.2
was only added in November 2024, Visual Studio versions before that cannot use this option. I confirmed this on an old version of Visual Studio./d2archSSE42
has probably received more testing due to being around for longer./d2archSSE42
and/arch:SSE4.2
have identical outputs from elfx86exts. Surprisingly, they do output slightly different binaries. Using Windows'sfc
, here are the differences (built on 48f361a on latest MSVC):Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
In
SConstruct
, change this:To this:
(Note that the comment leads to the Visual Studio 2019 help page, instead of 2022, as Godot's minimum is 2019.)
If this enhancement will not be used often, can it be worked around with a few lines of script?
No
Is there a reason why this should be core and not an add-on in the asset library?
Buildsystem