Use SSE 4.2 as a baseline when compiling Godot

This lets the compiler do more optimizations, leading to increased
performance for demanding CPU tasks.
This commit is contained in:
Hugo Locurcio
2022-03-10 01:40:31 +01:00
parent b89c47bb85
commit be1f9a878b
2 changed files with 26 additions and 5 deletions

View File

@ -80,9 +80,16 @@ if env["builtin_embree"]:
env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
# Set x86 CPU instruction sets to use when building Embree's own intrinsics.
# Keep this in sync with Godot's main SConstruct file.
# This is only needed on MSVC, as GCC/Clang will set those defines automatically
# according to compiler instruction set flags.
if env["arch"] != "x86_64" or env.msvc:
# Embree needs those, it will automatically use SSE2NEON in ARM
env_thirdparty.Append(CPPDEFINES=["__SSE2__", "__SSE__"])
# Embree needs those; it will automatically use SSE2NEON in ARM.
env_thirdparty.Append(CPPDEFINES=["__SSE__", "__SSE2__"])
if env["arch"] == "x86_64" and env.msvc:
env_thirdparty.Append(CPPDEFINES=["__SSE3__", "__SSSE3__", "__SSE4_1__", "__SSE4_2__"])
if env["platform"] == "web":
env_thirdparty.Append(CXXFLAGS=["-msimd128"])