1 Commits
Author SHA1 Message Date
Claude a3eedbfa4c runtime: 68000 assembly soft float for single precision
Replace compiler-rt's float helpers in the 68k libmacrt.a with
hand-written 68000 assembly (runtime/softfloat-m68k.S): add, subtract,
multiply, divide, the comparisons, __fixsfsi and __floatsisf. The
results are IEEE 754 binary32, round to nearest even, with subnormals.

runtime/softfloat.c is the C reference. tests/softfloat.c checks it
against the host's IEEE arithmetic and writes test vectors;
tests/softfloat68k.c checks the assembly against them in sim68k as a
68000 and a 68020. tests/run.sh runs both.

Estimated 68000 cycles per operation, compiler-rt -> assembly:
add 910 -> 709, mul 2107 -> 939, div 10471 -> 1330,
(int) 670 -> 156, (float) 687 -> 382.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRU62KVV5DyZprjraEt
2026-11-26 05:02:45 +00:00