Search found 12 matches

by malcontent
Tue Feb 23, 2016 11:28 pm
Forum: Programming
Topic: CBM (C64) floating point improvement
Replies: 44
Views: 14735

Re: CBM (C64) floating point improvement

I am in contact... just received permission to post a version of his routine on the wiki. Actually he developed it for the same reason I'm interested in it, speeding up an orbit simulation.
by malcontent
Tue Feb 23, 2016 6:06 pm
Forum: Programming
Topic: CBM (C64) floating point improvement
Replies: 44
Views: 14735

Re: CBM (C64) floating point improvement

Well that applesoft routine absolutely blazes compared to the built-in one, and beats the one I had by quite fair margin too since it avoids calling the kernal divide. I can't quite follow the bit level math, but it does seem to be doing some flavor of Newton (subtraction and division(shifts)). A ...
by malcontent
Sun Feb 21, 2016 3:47 pm
Forum: Programming
Topic: CBM (C64) floating point improvement
Replies: 44
Views: 14735

Re: CBM (C64) floating point improvement

Nice find, I have not seen that. Looks pretty speedy as it doesn't use any kernal math like the version I've got now.
by malcontent
Sun Feb 07, 2016 3:40 pm
Forum: Programming
Topic: CBM (C64) floating point improvement
Replies: 44
Views: 14735

Re: CBM (C64) floating point improvement

Good catch on the carry propagation, White Flame. It also occurs to me that we'll only be keeping 32-bits of the product, meaning that we might be able to get away with rounding the inputs to just above 16 significant bits.

I was thinking of this, but you do loose quite a bit of precision that ...
by malcontent
Thu Feb 04, 2016 7:43 pm
Forum: Programming
Topic: CBM (C64) floating point improvement
Replies: 44
Views: 14735

Re: CBM (C64) floating point improvement

Here is what i have so far, seems to do a little over 1500 cycles. Uses the fast multiply from codebase, it's about a 800 cycle improvement over the built in one, though perhaps it could be optimized for multiplying zero bytes. Table generation and test code not included:

;Fast Floating Point ...
by malcontent
Tue Feb 02, 2016 6:51 am
Forum: Programming
Topic: CBM (C64) floating point improvement
Replies: 44
Views: 14735

Re: CBM (C64) floating point improvement

Just tried to implement above posted algorithm, but haven't been able to get a correct result yet. But with all the steps implemented, it's taking about the same amount of time as the built-in version. I'm using the smaller table-based fast multiply from codebase, maybe the 2k table version would be ...
by malcontent
Mon Feb 01, 2016 7:21 pm
Forum: Programming
Topic: CBM (C64) floating point improvement
Replies: 44
Views: 14735

Re: CBM (C64) floating point improvement

Actually I stumbled upon something like it, Vedic Multiplication: http://www.cse.usf.edu/~hthapliy/Papers/v2-57.pdf

Still byte-byte multiplication still seems to involve 16 shifts so I'm confused where your 8 shift number comes from.
by malcontent
Mon Feb 01, 2016 2:54 am
Forum: Programming
Topic: CBM (C64) floating point improvement
Replies: 44
Views: 14735

Re: CBM (C64) floating point improvement

Hey white flame, your input is greatly appreciated (and you're codebase work I have often cribbed, so thanks for that)

Basically I am having trouble with conceptualising your suggestion. My understanding of the built-in routine is that it calculates 8 bytes of mantissa (n byte multiplication = n*2 ...
by malcontent
Sat Jan 30, 2016 8:12 am
Forum: Programming
Topic: CBM (C64) floating point improvement
Replies: 44
Views: 14735

Re: CBM (C64) floating point improvement

how to wedge it into all the existing MS code which calls $BA28

At least for the "real-time" rendering of the simulator and the screen, multiply is only called directly in the main loop. The exception is when I want to display other information, I.E. Velocity, Altitude, etc. Which must call the ...
by malcontent
Fri Jan 29, 2016 7:24 am
Forum: Programming
Topic: CBM (C64) floating point improvement
Replies: 44
Views: 14735

Re: CBM (C64) floating point improvement

I did see your math package, but am I wrong when I see that just one of the required tables is 256k? No way this would help with legacy computers. Unless staight BCD is still faster even without tables. While this is ostensibly about making my simulator for c64, it's more about improving methods on ...
by malcontent
Fri Jan 29, 2016 12:50 am
Forum: Programming
Topic: CBM (C64) floating point improvement
Replies: 44
Views: 14735

Re: CBM (C64) floating point improvement

I did try to use the Woz FP routines for the simulator, but the nature of integration (quick and dirty Euler especially) is error prone, and the limited accuracy compounded that, given that the scale of the system is similar to the real world, the amount of acceleration change in some instances is ...
by malcontent
Thu Jan 28, 2016 11:47 pm
Forum: Programming
Topic: CBM (C64) floating point improvement
Replies: 44
Views: 14735

CBM (C64) floating point improvement

Hello forum! I've been writing an entry for codebase64 about the built-in FP routines on the C64. Much of this knowledge was obtained in the quest to write a space simulator, but I've mostly put that project on the back-burner. It did however, lead to quest to find alternate routines to speed-up the ...