Both engines refused SHLD and SHRD (0F A4/A5, 0F AC/AD) as illegal
instructions. They are now declared in the x86 registry and run on the
shared semantics for 16-, 32- and 64-bit register and memory
destinations, with the count in an 8-bit immediate or in CL.
- instructions.toml, x86_table.rs (generated), generate_x86.py,
x86_decode.rs: the two operations and two operand encodings,
rm_reg_imm and rm_reg_cl (ModRM destination, reg source, count).
- x86_exec.rs: the destination is shifted with the vacated bits filled
from the source register. The count is masked to five bits (six for
64-bit operands), a masked count of zero changes nothing, CF takes the
last bit shifted out, ZF/SF/PF follow the result and OF is set only
for a count of one. A 16-bit count above 16 is undefined in the SDM;
the flags are kept and no test relies on the result.
- cpu_known_answers.rs: eight SDM-derived cases move from refused to
verified.
- tests/x86: 72 assembled SHLD and SHRD instructions, with a
bit-at-a-time reference in x86_integer.rs. A destination the
reference marks undefined now skips the memory operand check too.
- docs/cpu/instruction-registry.md, CHANGELOG.md.
Nothing is lowered to ARM64.
Signed-off-by: maridogolpeador <354308468+maridogolpeador@users.noreply.github.com>
The shared decoder already stopped before fetching a 16th byte, but it
reported the instruction as unsupported, so both engines exited with an
illegal instruction. It now returns DecodeError::TooLong, which maps to
ExitReason::GeneralProtection (Intel SDM Vol. 3A, 7.15). The DBT retries a
block that fails this way one instruction at a time, as it already does for
illegal instructions and fetch faults, so earlier instructions in the block
complete and the fault reports the overlong instruction's RIP.
The known answer recorded as a defect by #155 is enabled, with three more
cases, and two page-end tests check that no 16th byte is fetched.
Signed-off-by: Bartosz Szczepański <bartosz.szczepanski@hotmail.com>
The decoder refused FNINIT (DB E3), which the mingw-w64 C runtime runs
once before main. Guest state gains the x87 control, status and tag
words, and FNINIT sets them to the Intel SDM values 037F, 0 and FFFF.
Both engines run the shared semantics.
The registry gains a form key, rm, that pins a register-only form to one
ModRM byte: the other bytes of DB /4 are different instructions. No other
x87 instruction is added and CPUID still reports no FPU.
Part of Gate A2.
Signed-off-by: zachdoxsee <zachdoxsee36@gmail.com>
Address review feedback from zachdoxsee on PR #369: replace index-only XMM range loops with iterator-based loops so strict clippy passes on Rust 1.100.
Signed-off-by: Arthur Lacoste <arthurlacoste@users.noreply.github.com>
Covers byte to qword widths, SIB and displacement forms, imm32 sign extension, register forms and store faults. Both engines already agree.
Signed-off-by: Arths17 <Atharvranjan8@gmail.com>
Add dispatch and DBT-backed runtime service tests that verify Win64 callee entry alignment, caller-owned shadow space, return state, and preservation of nonvolatile GPRs/XMM registers across registered service calls.
AI-Assisted: Codex (GPT-5) helped draft the tests; I reviewed the diff and ran fmt/clippy(loader)/loader tests locally.
Signed-off-by: Arthur Lacoste <arthurlacoste@users.noreply.github.com>
Conflicts: CHANGELOG.md and the rejected-encodings list in
x86_integer.rs, where both sides are kept; the case list in
tests/x86/assemble.py, which now has the fences followed by MOVNTI; and
the generated x86_table.rs and tests/x86/integer.txt, rebuilt with
generate_x86.py and assemble.py from the merged sources.
Signed-off-by: zachdoxsee <zachdoxsee36@gmail.com>
Conflicts: CHANGELOG.md, where both entries are kept; the generated
crates/loader/src/x86_table.rs, rebuilt with generate_x86.py from the
merged instructions.toml; and one sentence of
docs/cpu/instruction-registry.md, where the list of rejected
instructions now drops both RCL/RCR (from #351) and the fences.
Signed-off-by: zachdoxsee <zachdoxsee36@gmail.com>
Conflicts in CHANGELOG.md, where both new entries are kept, and in the
generated crates/loader/src/x86_table.rs, which is rebuilt with
generate_x86.py from the merged instructions.toml.
Signed-off-by: zachdoxsee <zachdoxsee36@gmail.com>
Both engines refused MOVNTI (0F C3 /r) as an illegal instruction. It is
the SSE2 move still missing next to the XMM moves already implemented.
- instructions.toml, x86_table.rs (generated): MOVNTI for 32- and
64-bit operands with a memory destination only.
- x86_exec.rs: an ordinary store of the register, as the other
non-temporal stores already are.
- cpu_known_answers.rs: the SDM-derived case that ends in a MOVNTI
moves from refused to verified.
- tests/x86: four assembled instructions with the text-only reference;
the register form and the 66 prefix join the rejected encodings.
MASKMOVDQU stays rejected and SSE2 stays unreported by CPUID.
Signed-off-by: sahib453 <117431595+sahib453@users.noreply.github.com>
Flat DrawInstanced ignored InstanceCount, StartInstanceLocation and
StartVertexLocation, so a zero-instance draw still drew and a changed
start vertex drew the first triangle. Zero instances or fewer than three
vertices now draw nothing; other unsupported parameters fail with
GraphicsError::Unsupported. Vertex reads use the range-checked
read_resource, so a view past its buffer or an overflowing guest address
fails with IndexOutOfRange.
Add tests/repeated_frames.rs: repeated reset, record, close and execute
frames with hand-derived pixels on the software reference backend.
Signed-off-by: Swastickc <28708247+Swastickc@users.noreply.github.com>