Build: x86-64 needs an explicit -msse4.1 for clang/GCC, since the generated code uses SSE4.1 intrinsics
メンテナーはふだん 5 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 88/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- cmake, cpp
- 領域
- build-system
調査の方向性
ルートのCMakeLists.txtを開き、if(PS2X_IS_ARM_TARGET)ブロックを見つけてください。ClangまたはGNUの場合に、issueのとおりadd_compile_options(-msse4.1)を呼び出すelseを追加してください(CMAKE_CXX_FLAGSは置き換えないでください)。x86-64上でclangまたはGCCを使って再ビルドしてください。SSE4.1 intrinsicのエラーがなくなり、プロジェクトが引き続きリンクできれば完了です。
索引モデルが issue の本文から書いたものです。
説明
What happens
The generated runner code emits SSE4.1 intrinsics -- _mm_blendv_ps (442 occurrences in our output), _mm_mullo_epi32, _mm_extract_epi32. The root CMakeLists.txt only sets an architecture flag for ARM targets (the if(PS2X_IS_ARM_TARGET) block); there is no else branch for x86, and no SSE4.1 handling anywhere in the tree at 75d729ce or on main.
MSVC has no notion of target features and accepts these intrinsics unconditionally on x64, so the defect is invisible when building with cl.exe. clang and GCC keep clang's semantics and refuse:
error: always_inline function '_mm_mullo_epi32' requires target feature 'sse4.1',
but would be inlined into function 'main' that is compiled without
support for 'sse4.1'
Measured on this host with clang-cl 22.1.3, flag by flag on a neutral file: without -msse4.1 the intrinsic is rejected; with -msse4.1, /clang:-msse4.1 or /arch:AVX it compiles, links and runs. cl.exe accepts it with no flag at all. On Linux with clang the build broke at unity_85_cxx.cxx.o.
Issue #166 shows another user's configure log containing -- x86 target detected, enabling SSE4.1 and -- SSE4.1 compiler flag enabled. Those strings appear nowhere in this repository's history, on any branch, so that was a local fix on their side rather than an upstream one.
Suggested fix
Give the if(PS2X_IS_ARM_TARGET) block an else branch, so the flag is added rather than left to the caller:
else()
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU")
message(STATUS "x86-64 Clang/GCC detected - adding -msse4.1")
add_compile_options(-msse4.1)
endif()
endif()
add_compile_options adds to the flag set. Worth preferring over telling users to pass -DCMAKE_CXX_FLAGS=-msse4.1, because that form replaces CMake's defaults (/DWIN32 /D_WINDOWS /EHsc) and silently disables exceptions -- which then fails ps2xRecomp with "cannot use 'throw' with exceptions disabled". That cost us a build cycle to diagnose.
Found while statically recompiling Ridge Racer V (NTSC-U, SLUS_200.02) with PS2Recomp.
Tested on commit 75d729ce; main was c5a9d02 at the time of writing, one README-only commit ahead.
Host: Windows 11 x64, clang-cl 22.1.3 + Ninja, MSVC toolset 14.51.36231, Windows SDK 10.0.26100.0, CMake 4.2.3.
None of these are specific to this game.
- 主要言語
- C++
- スター
- 3.3k
- フォーク
- 149
- 平均マージ
- 5日 10時間
- マージ済み PR(30日)
- 4
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
ran-j/PS2Recomp のほかの issue
-
VU0 macro VSQI / VSQD: address and source registers swapped in generated code対応中かも @yanm1103 が 1 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 5 日以内に返信
-
Runtime: SampleTexture casts unbounded or NaN texture coordinates to int, which is undefined behaviour対応中かも @luisbraganca が 7 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
ran-j/PS2Recomp#273 · コメント 2 件 ·
メンテナーはふだん 5 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 5 日以内に返信
-
Runtime: writes to D_ENABLEW (0x1000F590) are never visible at D_ENABLER (0x1000F520), hanging any game that suspends the DMAC対応中かも @luisbraganca が 6 日前に担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
ran-j/PS2Recomp#257 · コメント 1 件 ·
メンテナーはふだん 5 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
メンテナーはふだん 5 日以内に返信
ran-j/PS2Recomp の issue をすべて見る
似ている issue
-
Mac mini M6 (16 GB): Q2_0 streaming works - measured 11.7->27.2 tok/s + arena fix for sub-32 GB Macsオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
champion good first issue remake source/qq
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
metasequoiaime/msime-windows#1025 ·
メンテナーはふだん 1 日以内に返信
-
backlog bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
EchoTools/nevr-runtime#653 ·
メンテナーはふだん 1 日以内に返信
-
`--fail-require-skip` never fires: run_tests.py searches stdout, but the unittest binary writes the skip summary to stderr対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
InfiniTimeOrg/InfiniTime#2492 ·