SSE4a on Intel CPUs: MOVNTSS and MOVNTSD emulated #234
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!234
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-234"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@philip-sudowicki on GitHub · 2026-11-23 21:41 UTC · original
philip-sudowicki:sse4a-movnts→main· +200 −5 · 3 files · 1 commits · openSSE4a's scalar streaming stores,
movntss m32, xmm(F3 0F 2B /r) andmovntsd m64, xmm(F2 0F 2B /r), are emulated like EXTRQ / INSERTQ (#216,0cd0a53/af20b4b): on an Intel CPU they raise STATUS_ILLEGAL_INSTRUCTION too, and they were the part of SSE4a still missing. One commit onmain60565c4. No retail title is known to use them yet; this closes the set so a title that streams scalars (_mm_stream_ss/_mm_stream_sd) does not stop on Intel.What is in it
crates/xcl/src/insn.rs:ConsoleOnly::Movnts { bytes, src, mem }and a memory-operand decoder (Mem,mem_operand,address): ModRM / SIB, disp8 / disp32, rip-relative, REX.R / X / B, 0x67 (32-bit address). The last of F2 / F3 decides, as for EXTRQ / INSERTQ; 0F 2B without them (movntps) or with 66 alone (movntpd) is not decoded, nor a register operand, nor a store through fs / gs (its segment base is not in the context).crates/xcl/src/eh.rs: the store of the XMM register's low dword / quadword at the computed address; memory that is not readable is left to fault, as the real store would. End-to-end testsse4a_streaming_stores_run_in_a_title_image: real movntsd / movntss / rip-relative movntsd in a registered title page, through the vectored handler (on an AMD CPU they run natively, same results).HANDOFF.md: the SSE4a sentence in "Console CPU instructions the PC lacks".Tested
Movnts { .. } in …+0x5 – a console CPU instruction this CPU lacks: emulated)x86_64-pc-windows-gnu(mingw-w64 13.2), Rust 1.97.0, debug; run under Wine 9.0xcl-*.exe insn:: eh::on top of60565c4: 8 passed, 0 failed (the newdecodes_the_sse4a_streaming_stores,memory_operand_addresses,sse4a_streaming_stores_run_in_a_title_image, and the existinginsn/ehtests,clzero_with_an_address_size_prefix_zeroes_at_eaxincluded)cargo check --workspace --all-targets --target x86_64-pc-windows-gnu: no warningsNot tested
scripts/test.ps1/ the full suite (the D3D12 and audio tests cannot run under Wine on this machine)af20b4b)@AlpPesen on GitHub · 2026-11-23 22:14 UTC · original
Tested commit
099f1abe0fc8430f94fe8c1543a3e43bd5f19c17natively on Windows 11 (MSVC) + Intel Core i9-9900K (Coffee Lake, no SSE4a) + AMD Radeon RX 6800 (driver32.0.21045.29003, DXC1.9.2602.17,rustc 1.100.0, debug).Tested
XCL_REQUIRE_GPU=wave64,mesh+.\scripts\test.ps1: 654 passed, 0 failed, 40 ignored, 0 GPU skipped (xcllib: 614 passed / 20 ignored; integration/e2e: 40 passed / 20 ignored;XCL_SAMPLE_*unset).eh::tests::sse4a_streaming_stores_run_in_a_title_imagetriggers the real#UDVEH trap (Movnts ... emulated (logged once)) and passes, alongsideinsn::tests::decodes_the_sse4a_streaming_storesandinsn::tests::memory_operand_addresses.Not tested
scripts/smoke.ps1).Review notes
crates/xcl/src/eh.rs(ConsoleOnly::Movnts): the write guard currently callscrate::gpu::shader::readable(at, bytes as usize)instead ofis_writable(at, bytes as usize)(already used right above forClzero/ClzeroLoop). For aPAGE_READONLY/PAGE_EXECUTE_READtarget,readable()returnstrueandwrite_unalignedwill fault inside the VEH instead of cleanly returning0.HANDOFF.md: now thatCONTRIBUTING.mdis merged, feature PRs should leaveHANDOFF.mduntouched for the maintainer.main(especially around0x67handling ininsn.rsafter #227).Tested and reviewed with Antigravity (Gemini 4 Neon); each point checked by the author before posting.
@ersinhf on GitHub · 2026-11-23 23:26 UTC · original
Tested
099f1abe0fc8430f94fe8c1543a3e43bd5f19c17on an AMD CPU with SSE4a (the native path this PR lists under Not tested), clean tree.Tested
stable-x86_64-pc-windows-msvc, debug; DXC 1.9.2602.17 (SDK 10.0.26100.0); noXCL_SAMPLE_*set.\scripts\test.ps1: 654 passed, 0 failed, 40 ignored;SKIPPED2 (no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardwareeh::tests::sse4a_streaming_stores_run_in_a_title_image,insn::tests::decodes_the_sse4a_streaming_storesandinsn::tests::sse4a_bit_fieldspass. On this CPU the first one runs the stores natively, so the expected memory contents it asserts are what the hardware writes.The F2 / F3 order of 0F 2B on hardware
A standalone probe (not part of XCL) ran
movq xmm0, rdx; <prefixes> 0F 2B 01; retnatively on the 7500F into a 0xAA-filled buffer and counted the bytes written:F3 0F 2BF2 0F 2BF2 F3 0F 2BF3 F2 0F 2B66 F2 0F 2B/F2 66 0F 2B66 F3 0F 2B/F3 66 0F 2BSo on Zen 4 the last of F2 / F3 decides and a 66 next to them does not matter, the same rule as for EXTRQ / INSERTQ. That is what
decodedoes and whatdecodes_the_sse4a_streaming_storesasserts (F2 F3→ 4 bytes,66 F2→ 8 bytes).Not tested
[rcx]only)scripts/smoke.ps1AI use
@SlopTart on GitHub · 2026-11-24 06:01 UTC · original
AMD-native-path and full-suite datapoints — the two axes your row lists as not tested.
Machine: Ryzen 9 9900X (SSE4a native: MOVNTSS/MOVNTSD decode and execute in hardware), RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Wine = Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust 1.100.0 cross
x86_64-pc-windows-gnu. Release profile,XCL_NETWORK=0. (Same rig as my Linux rows in #42 / #718.)Merged state: your head
099f1abe0onto maind5442d2— one conflict, only at the tail ofmod testsineh.rs(both sides append tests; kept both). Everything else auto-merged.Targeted,
cargo test -p xcl --lib -- sse4a: 3/3 pass —insn::tests::decodes_the_sse4a_streaming_storeseh::tests::sse4a_streaming_stores_run_in_a_title_imageinsn::tests::sse4a_bit_fieldsOn this CPU the stores never raise
STATUS_ILLEGAL_INSTRUCTION, sosse4a_streaming_stores_run_in_a_title_imagepassing here means the handler stays out of the way and the native stores land the same values (the test is written to hold on either path, which it does).Full suite on the merged head,
cargo test --workspace --release --no-fail-fast -- --test-threads=4: 697 passed, 10 failed, 41 ignored (17 suites) — vs 697 / 7 / 41 on plaind5442d2on this rig. The 7 are this rig's stable Wine-lane failures (listed in my #42 row); the 3 extra wereplaced_title_textures_share_vram_and_preserve_pixels,transitions_apply_when_their_list_is_submittedandd32s8_targets_take_their_own_size_of_video_memory— the known #718 flaky trio, which has hit ~2 of 5 full-suite runs here regardless of PRs. Nothing in the failure set touches SSE4a, and no new failures.Not tested: Windows, retail titles, an Intel box under these exact conditions (an Intel Xeon + Wine 9.0 row is already in your own testing notes above).
Counts only, no game data.
AI use: Hermes agent (local Qwen-class) ran the tests and drafted this; I checked it before posting.
@DavidM1911 on GitHub · 2026-11-25 15:19 UTC · original
Verification on RTX 3060 Ti (Windows 11): merge conflict with current
main— needs a rebase before it can be tested.View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.