Files
TeslaRel410/emulator/firmware-decomp/emu860c/build.sh
T
CydandClaude Opus 4.8 be8f72e731 M4a: emu860c -- the i860 step-core in C, 351x, checkpoint-perfect
Full mechanical port of emu860.py's validated semantics: paged memory,
integer ISA, control flow with delayed branches + bc.t/bnc.t annul, DIM
tracking, and the complete FP model (pipes with per-entry result precision,
PFAM/PFMAM dual-op routing, fdest bypass, raw-retire fix/ftrunc, K/T loads).
Python keeps the hooks via a shim; the C loop returns at hook pcs.

Differential result vs the hook-aligned reference trace (ref_trace2):
  139.7M steps/s (Python: 398K/s = 351x), 35.8M steps, 2195 hooks,
  43/43 checkpoints matched (pc + step count + full reg CRC).
The original i860 ran ~40 MIPS: real-time geometry is cleared 3.5x over --
M4's gate (GPU-RETARGET.md) is open.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-19 13:24:43 -05:00

6 lines
338 B
Bash

#!/bin/sh
# build emu860c.pyd (MSYS2 MINGW64: pacman -S mingw-w64-x86_64-gcc + python)
PYINC=$(python -c "import sysconfig; print(sysconfig.get_paths()['include'])")
PYVER=$(python -c "import sys; print('%d.%d' % sys.version_info[:2])")
exec gcc -O2 -shared -o emu860c.pyd emu860c.c -I"$PYINC" -LC:/msys64/mingw64/lib -lpython${PYVER/./}