Set the x86 SIMD baseline that the code already requires - #212
Open
Sinan-Karakaya wants to merge 1 commit into
Open
Set the x86 SIMD baseline that the code already requires#212Sinan-Karakaya wants to merge 1 commit into
Sinan-Karakaya wants to merge 1 commit into
Conversation
Sinan-Karakaya
force-pushed
the
fix/simd-baseline
branch
from
August 18, 2026 09:25
71e4771 to
06c35e0
Compare
ps2_runtime.h includes <smmintrin.h> unconditionally, and the recompiler emits SSE4.1-only intrinsics (_mm_blendv_ps and friends) for the COP2 and FPU select idioms. SSE4.1 is therefore a hard requirement of the codebase, not a tuning option. Nothing sets it for GCC or Clang. MSVC does not need it -- its intrinsics are not gated behind a target feature -- and the only place any x86 feature is named is /arch:AVX2 inside EnableFastReleaseMode, which is MSVC-only and applies to Release and RelWithDebInfo only. GCC and Clang default to the plain x86-64 baseline, which is SSE2, so on a stock Linux or macOS toolchain the affected translation units fail with "always_inline function ... requires target feature 'sse4.1'". Adds EnableX86SimdBaseline and applies it to ps2_runtime in every configuration rather than in EnableFastReleaseMode, since a Debug build needs it just as much. PUBLIC, so recompiled game code linking against ps2_runtime inherits it -- that code is where most of the SSE4.1 intrinsics actually are. Guarded on the target processor so ARM builds are unaffected. (cherry picked from commit 226bae250b285930da75accc7a7ee0045942d807)
Sinan-Karakaya
force-pushed
the
fix/simd-baseline
branch
from
August 18, 2026 20:26
06c35e0 to
dd44787
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ps2_runtime.hincludes<smmintrin.h>unconditionally, and the recompiler emits SSE4.1-only intrinsics (_mm_blendv_psand friends) for the COP2/FPU select idioms. SSE4.1 is a hard requirement of the codebase, not a tuning option.Nothing sets it for GCC or Clang. MSVC does not need it, its intrinsics are not gated behind a target feature; and the only place any x86 feature is named is
/arch:AVX2insideEnableFastReleaseMode, which is MSVC-only and only applied forRelease/RelWithDebInfo. GCC and Clang default to the plainx86-64baseline, which is SSE2, so on a stock Linux or macOS toolchain the affected translation units fail:Adds
EnableX86SimdBaseline()and applies it tops2_runtimein every configuration rather than from insideEnableFastReleaseMode; a Debug build needs it just as much.PUBLIC, so recompiled game code linking againstps2_runtimeinherits it; that code is where most of the SSE4.1 intrinsics actually are. Guarded onCMAKE_SYSTEM_PROCESSORso ARM builds are unaffected.Found while linking a fully recompiled retail binary (~11.5k translation units, ~160 of which use SSE4.1 intrinsics) against
ps2_runtimeon Fedora with clang.