A86: a pretty fast multiply method...


[Prev][Next][Index][Thread]

A86: a pretty fast multiply method...




After trying and trying, I have found a really fast way to multiply two
8-bit numbers and get a 16-bit result. The problem is we want to find A * B.

Well it just so happens that A * B = (A+B)(A+B)/4 - (A-B)(A-B)/4
If you inspect this for a minute, you'll see something really cool... in
order to do multiplication all we need is a table of squares (actually a
table of squares divided by four) and two lookups into the table.

I'm working on perfecting my routine right now, and I'll release it pretty
soon. Here's the current possibilites:
[A] ~140 t-states w/ a 1024-byte lookup table
[B] ~120 t-states w/ a 2048-byte lookup table

On an 86, both table sizes are usually easy things to satisfy by sticking
the tables on page 1! Also, if you use the 2048-byte version, it will do
signed multiplication. I'm really excited that fast 3D might finally be
possible... Now we just need a fast line clipping routine and/or polygon
routine...

     Kirk



Follow-Ups: