On Sep 2, 2010, at 12:35 PM, Andres Vahter wrote:
I would like to use Horner's method for fast multiplication on
MSP430f2234.
I found source files from:
http://focus.ti.com/general/docs/litabsmultiplefilelist.tsp?literatureNumber=slaa329
You need to read the app note associated with that code, which is here:
http://focus.ti.com/lit/an/slaa329/slaa329.pdf
It says, among other things:
"The memory requirement is much higher for Horner's method since, for
each multiplier or
divisor, the code is different. In cases where speed is of prime
concern, this is not a serious limitation."
That is, the multiplication algorithm they talk about (and the
performance improvement they get) is only suitable for a constant
multiplier.
If you need multiplication faster than that provided by the C
compiler, you probably have to give up some that the C compiler
assumes. It's not like the C compiler writers sit around going "Well,
we're a HLL, so we can make our multiply function needlessly
complex!" One possibility is a mixed-size multiplication. C
(probably) assumes a 16x16bit multiply, and if you KNOW your arguments
are always going to be less than 16 bits, you can write a
significantly faster multiply function.
BillW