Commit graph

75 commits

Author SHA1 Message Date
Brooke Vibber c7e7129eb2 whoops missed a few cycs 2023-01-05 11:55:41 -08:00
Brooke Vibber 2340f8210e update round & sketch out the iter cycle count 2023-01-05 11:36:42 -08:00
Brooke Vibber 7f70f14fc2 one last round sketch
combining copy and round
2023-01-05 11:17:13 -08:00
Brooke Vibber 7ac0df0343 Added two version of 16-bit rounding
round16_incdec uses inc and dec
round16_addsub uses adc and sbc

the incdec version is the same when no rounding is needed
but saves about 8 cycles on the rounding cases, for an
average savings of 4.5 cycles for randomly distributed inputs

untested so far
2023-01-05 09:06:07 -08:00
Brooke Vibber 6edd2f71d9 whoops added wrong 2023-01-04 21:26:47 -08:00
Brooke Vibber 373e1441d3 comment tweaks 2023-01-04 21:09:45 -08:00
Brooke Vibber 3a0545b673 tyop 2023-01-04 21:04:53 -08:00
Brooke Vibber 1408855eed Note how many cycles loop unrolling saves
+4 cycles one-time setup

ldx #8 ; 2 cyc for first 8
ldx #8 ; 2 cyc for second 8 (different shift behavior)

-5 cycles/iter to get bit now

lsr arg + 1 ; 5 cyc
rol arg     ; 5 cyc

+10 cycles/iter to get the bit in a loop

dex ; 2 cyc
bne ; 2 cyc

4 cycles/iter for the loop

4 + (14 * 16) = 4 + 224 = 228
2023-01-04 21:02:18 -08:00
Brooke Vibber 519f8ad635 whoops 2023-01-04 20:57:07 -08:00
Brooke Vibber efd722eeb2 update cycle count for imul16 2023-01-04 20:37:16 -08:00
Brooke Vibber 41915cf122 save a few bytes by removing a dupe tail from two cases now 2023-01-04 20:33:42 -08:00
Brooke Vibber 38091e535f hmm 2023-01-04 20:31:39 -08:00
Brooke Vibber 58519381bf hmm 2023-01-04 20:12:34 -08:00
Brooke Vibber fa599be775 wip fix 2023-01-04 19:52:56 -08:00
Brooke Vibber 9682b4a6b3 readme 2023-01-04 19:15:26 -08:00
Brooke Vibber 5605cc4652 woo 2022-12-30 18:25:43 -08:00
Brooke Vibber 2d67cdc498 woo 2022-12-30 18:21:31 -08:00
Brooke Vibber 4b1001bfdc annotate cycle counts 2022-12-30 17:33:18 -08:00
Brooke Vibber 6583dc3680 wip 2022-12-30 01:05:52 -08:00
Brooke Vibber f50882a24d maybe 2022-12-30 00:55:48 -08:00
Brooke Vibber 27d046011e looks workable 2022-12-30 00:43:44 -08:00
Brooke Vibber fe9a35353b works for 3 * 5 = 15 2022-12-29 20:32:58 -08:00
Brooke Vibber b307f98760 nice 2022-12-29 20:18:21 -08:00
Brooke Vibber ca877ef44d hmm 2022-12-29 03:37:51 -08:00
Brooke Vibber e6c05d0f66 stuff 2022-12-28 21:08:16 -08:00