base:fastest_multiplication_2023
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
base:fastest_multiplication_2023 [2024-02-13 07:55] – Published the routine repose | base:fastest_multiplication_2023 [2024-02-13 08:07] – repose | ||
---|---|---|---|
Line 1: | Line 1: | ||
The research continues in 2023 and the fastest multiply got faster! | The research continues in 2023 and the fastest multiply got faster! | ||
- | Thanks to a 6502 simulator written in C and the analyzing of statistics in the program branches and boundary crossings, the exact speed of routines are now known. This analysis has inspired new optimizations! The new routine executes in a blazing 187.1 cycles on average (a 6% speedup or 11.5 cycles faster from my original code which was 198.6), with inputs in zero page and outputs in zero page plus two registers, not including caller setup or RTS. \\ | + | Thanks to a 6502 simulator written in C and the analyzing of statistics in the program branches and boundary crossings, the exact speed of routines are now known. This analysis has inspired new optimizations! The new routine executes in a blazing 187.1 cycles on average (a 6% speedup or 11.5 cycles faster from my original code which was 198.6), with inputs in zero page and outputs in zero page plus two registers, not including caller setup or RTS. 14 bytes of zp, 2044 in tables, 112 bytes of code. The claim to " |
Code in ACME assembly format. Please adjust addresses to be usable for your situation. | Code in ACME assembly format. Please adjust addresses to be usable for your situation. | ||
< | < | ||
- | ; from 6502.org, by Repose: http:// | + | ; World' |
; | ; | ||
; 16 bit x 16 bit unsigned multiply, 32 bit result | ; 16 bit x 16 bit unsigned multiply, 32 bit result | ||
- | ; Average cycles: 193.07 | + | ; Average cycles: 193.07 |
; 2170 bytes | ; 2170 bytes | ||
Line 33: | Line 33: | ||
; Align tables to start of page | ; Align tables to start of page | ||
+ | ; Note - the last byte of each table is never referenced, as a+b<=510 | ||
sqrlo | sqrlo | ||
!for i, 0, 511 { | !for i, 0, 511 { |
base/fastest_multiplication_2023.txt · Last modified: 2024-02-13 08:11 by repose