Library — math16
Home under classic/newlib float trees (see libsrc/math/float/ math16 paths and
--math16 on zcc). Policy mirrors math32:
| Op | Algorithm |
|---|---|
div / asm_f16_div |
Restoring |
inv / asm_f16_inv |
Newton–Raphson |
Agent rules
- One major function per file; CPU copies under matching asm CPU dirs.
- 8085: stack-only; no EXX/IX/IY; legal
(de)stores only (a/hl/post-inc). - Classic TIMER benches for math16: use
z88dk-classic/*.c(parent sources may lack_Float16). - 8085 math16 often also needs
-lmath32_8085for higher helpers — match classic recipes. - Suite:
make -C test/suites/math test_math16.bin test_math16_8085.bin(and peers). Newlib:+rc2014 -clib=newwith-lmath16 -lmath32(mirror math32 rc2014 recipe). - Higher funcs layout:
c/z80/(sccz80 +new) andc/8085/.c/Makefileclean: only remove C-derivedz80/*.asmand8085/*.asm($(AFILES8085)); keep hand-writtencm16_sccz80_*.asminc/8085/.
Calling vs math32
Many half API symbols are plain defc sinf16 = _m16_sinf (true DEHL) even with
-D__CLASSIC — not the math32 stack-bridge trap. Still prefer map proof
(sinf16 / sqrtf16 / invsqrtf16) after link. Fair n-body: math16 may keep
invsqrtf16; math32 TIMER source should use 1.0/sqrt on both classic and newlib.
Related
library-math32,cpu-8085,methodology-measure,library-newlib(header regen)- Product readme: math16
README.mdunder the float tree