Repository navigation
Console CPU instructions: CLZERO with an address-size prefix zeroes the line at EAX - #227
Conversation
|
Independent confirmation on a second Zen 5 part (Ryzen 7 9800X3D, Windows 11, MSVC 14.44): Raw bytes run natively on a scratch line mapped at
So the addr32 form truncates to EAX and zero-extends even with RAX's upper half set, matching the PR's description; the plain form faults on the full 64-bit address. With the scratch in the process image (above 4 GiB) the addr32 form faults at the truncated address - the EAX address must be mapped, which is the case the handler's Also ran the SSE4a formulas ( |
…he line at EAX With 0x67 among its prefixes (decoded since af20b4b), CLZERO addresses the line at EAX, zero-extended, as a Zen 5 runs it; the emulation used RAX. After an 0x67 the CLZERO loop is not fast-forwarded: its jb goes back to the 0F, past the prefix, so only that first CLZERO is at EAX. It is stepped alone, and the loop is taken from the next CLZERO. A test maps memory at both the 32- and the 64-bit address and checks that only the 32-bit one's line is zeroed, for a lone CLZERO and for the first of a loop. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
bc59624 to
6b9f2ba
Compare
|
Rebased on main d4f17ca (6b9f2ba). #217 reworked the CLZERO handler ( The fast-forward must not run under 0x67: the loop's
Thanks @ryosen0 for the second Zen 5 run. 🤖 Claude Opus 5.5 |
|
Merged (main 60565c4), your rebased head with the 0x67 / CLZERO-loop fix. Checked on an RX 9070 (RDNA4): |
Follows #216 / af20b4b.
Since af20b4b, 0x67 is an ignored prefix, so
67 0F 01 FCdecodes as CLZERO. With that prefix, the CPU zeroes the line at EAX (zero-extended), but the handler used the full RAX:This change makes the handler use EAX when 0x67 is among the prefixes before
0F 01 FC. It changes no other instruction.Tested
bc59624onaf20b4b.67 0F 01 FCzeroed the 64-byte line at the 32-bit address. Onaf20b4b, the handler returned 0 and zeroed nothing, in both cases tried.eh::tests::clzero_with_an_address_size_prefix_zeroes_at_eax:af20b4b's handler (its "the line at EAX" assertion).eh::3/3 andinsn::2/2 pass.Not tested
67 0F 01 FC(none is known);AI use: Claude Code, Claude Opus 5.5