Commit Graph
12 Commits
Author SHA1 Message Date
Brendan RobertandClaude 3ae9404419 Add .gitignore for build artifacts
Ignore compiled objects (.a, .o, .sym), executables, and build directories
to keep the repository clean.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-25 00:00:32 -06:00
Brendan Robert a59b9b02e4 Remove binary artifacts 2026-01-24 21:12:57 -06:00
Brendan Robert 1c8e2c28d7 Remove binary artifacts 2026-01-24 21:11:15 -06:00
Brendan Robert 736c29687a Fixed complilation issues, centralized commonly used FP constants 2026-01-24 20:12:18 -06:00
Brendan Robert 7106d8f826 Moved docs to the right place 2026-01-24 18:06:58 -06:00
Brendan RobertandClaude 3d359f0a0e Add hardware acceleration for scalb, compXY, and annuityXY functions
Implemented hardware-accelerated versions of three additional functions:

- scalb(x, n): Binary scale operation (x * 2^n) using pow2X and mul
- compXY(rate, periods): Compound interest ((1+rate)^periods) using powXY
- annuityXY(rate, periods): Annuity calculation using powXY

This brings the total hardware-accelerated functions from 28 to 31 out of
40 total SANE operations (78% coverage). These functions leverage the
existing hardware-accelerated powXY implementation, combined with
mathematical identities to avoid SANE fallback.

All functions maintain full API compatibility and automatically fall back
to SANE if MegaFlash hardware is not available.

Updated documentation to reflect new accelerated function count and
reorganized function categories.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-24 18:01:02 -06:00
Brendan Robert 6839f068ab Extend hardware acceleration to all log/exp functions using properties
Implemented all remaining logarithm and exponential functions using
properties of logarithms and hardware acceleration:

New Hardware-Accelerated Functions:
- ln1X (ln(1+x)) = ln(1 + x) using hardware ln
- log21X (log2(1+x)) = ln(1+x) / ln(2)
- pow21X (2^x - 1) = e^(x*ln(2)) - 1
- powE1X (e^x - 1) = exp(x) - 1
- powE21X (e^(2x) - 1) = exp(2x) - 1
- powXInt (x^n) = e^(n * ln(x))
- powXY (x^y) = e^(y * ln(x))

Now have **28 total hardware-accelerated functions**:
- 9 direct from MegaFlash FPU
- 19 via mathematical identities

Only 9 functions still use SANE fallback:
- add, sub, rem, type, cmp, trunc, round, logb, scalb
- compXY, annuityXY, randNum (financial/random)

This dramatically expands hardware acceleration coverage while
maintaining full API compatibility and precision.
2026-01-24 17:54:20 -06:00
Brendan Robert 2db2129806 Implement additional hardware-accelerated functions using trig identities
Extended hardware acceleration to more functions by using mathematical
identities with the base MegaFlash FPU operations:

New Functions (all hardware-accelerated):
- neg(x) = x * -1 (preserves precision vs sign flip)
- abs(x) = sign check + neg if needed
- log2(x) = ln(x) / ln(2)
- pow2(x) = e^(x * ln(2))
- asin(x) = atan(x / sqrt(1 - x²))
- acos(x) = π/2 - asin(x)
- sinh(x) = (e^x - e^-x) / 2
- cosh(x) = (e^x + e^-x) / 2
- tanh(x) = sinh(x) / cosh(x)
- sec(x) = 1 / cos(x)
- csc(x) = 1 / sin(x)
- cot(x) = 1 / tan(x)

All functions use hardware mul, div, sqrt, sin, cos, tan, atan, ln, and exp
operations from MegaFlash, providing significant speedup over software
implementations.

Updated documentation to reflect extended hardware acceleration coverage.
2026-01-24 17:49:32 -06:00
Brendan Robert a4fa5a162a Fix spelling: Thomas Fok (not Tomas) 2026-01-24 17:42:43 -06:00
Brendan Robert 680a1c032b Update MegaFlash repository link to https://github.com/ThomasFok/MegaFlash 2026-01-24 17:41:56 -06:00
Brendan Robert 9555036473 Fix attribution: MegaFlash hardware by Tomas Fok 2026-01-24 17:41:28 -06:00
Brendan Robert 3103d44635 Add MegaFlash hardware-accelerated FPU library (fpu_mf)
This commit adds optional hardware floating-point acceleration for PLASMA
programs running on Apple IIc/IIc+ systems with MegaFlash storage devices.

New Features:
- fpu_mf.pla: Drop-in replacement for fpu.pla with hardware acceleration
- API-compatible with existing fpu.pla library
- Automatic hardware detection and transparent SANE fallback
- 10-100x speedup for transcendental functions (sin, cos, tan, log, exp)
- 3-5x speedup for multiplication and division

New Files:
- src/inc/megaflash.plh: MegaFlash hardware constants
- src/libsrc/fpu_mf.pla: Hardware-accelerated FPU library
- src/libsrc/README_fpu_mf.md: Library documentation
- src/samplesrc/fptest_mf.pla: Comprehensive test program
- MEGAFLASH_FPU.md: Integration overview and PR documentation

Usage:
Users can switch from 'import fpu' to 'import fpu_mf' with no other
code changes required. Programs work on all systems (with or without
MegaFlash hardware).

Backwards Compatibility:
- No changes to existing PLASMA code
- Opt-in only - existing programs unchanged
- Works on all Apple II systems (fallback to SANE if no hardware)

Technical Details:
- Automatic format conversion (SANE Extended <-> MBF)
- Hardware operations: mul, div, sqrt, sin, cos, tan, atan, ln, exp
- SANE fallback for unsupported operations
- MegaFlash detection via ID register ()

See MEGAFLASH_FPU.md for complete documentation.
2026-01-24 17:36:30 -06:00