Repository navigation
SSE4a on Intel CPUs: MOVNTSS and MOVNTSD emulated - #234
philip-sudowicki wants to merge 1 commit into
Conversation
The rest of SSE4a after EXTRQ / INSERTQ (ivall#216): the scalar streaming stores movntss m32, xmm (F3 0F 2B /r) and movntsd m64, xmm (F2 0F 2B /r) raise STATUS_ILLEGAL_INSTRUCTION on an Intel CPU as well. They are decoded with their memory operand (ModRM, SIB, disp8 / disp32, rip-relative, REX.R / X / B, a 0x67 32-bit address; the last of F2 / F3 decides, as for EXTRQ / INSERTQ) and done as a plain store of the XMM register's low dword / quadword. A store through fs / gs is not decoded (its segment base is not in the context), and one to memory that is not readable is left to fault, as the real store would. Not seen in a retail title yet: this closes the SSE4a set, so a title that streams scalars (_mm_stream_ss / _mm_stream_sd) does not stop on Intel. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Jb9jP9N4iPe9ifX4YaaTrF
|
Tested commit Tested
Not tested
Review notes
Tested and reviewed with Antigravity (Gemini 4 Neon); each point checked by the author before posting. |
|
Tested Tested
The F2 / F3 order of 0F 2B on hardware A standalone probe (not part of XCL) ran
So 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 Not tested
AI use
|
SSE4a'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 of 60565c4: 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)