feat(asm): encode the amd64 x87 family

The x87 stack controls, the D8/DC arithmetic pair, the conditional moves,
the register compares, FADDDP, the memory loads and the FXSAVE pair, each
pinned byte for byte against go tool asm through every corpus line the
toolchain's own amd64enc.s carries for the family (78 lines).

Assisted-by: GLM 5.3 Flash
This commit is contained in:
petrbalvin committed 2026-10-06 23:59:47 +02:00
1 parent 1040739fbb
commit f0b08ccea0
5 files changed
+401

No files matched your search

+7
View File
@@ -70,6 +70,13 @@ type encPatch struct {
func (e *enc) encode(mnem string, ops []Operand) error {
upper := strings.ToUpper(mnem)
// The corpus families (x87, the system and string controls, XSAVE)
// dispatch on the full name from the amd64 family files before the
// fixed-name switch, the way their tables spell the mnemonics out.
if handled, err := e.encodeAmd64Family(upper, ops); handled {
return err
}
// Fixed-name instructions (no size suffix).
switch {
case upper == "RET":