From: | Sergey Solyanik <ssolyanik@icdc.com> |
Newsgroups: | comp.compilers |
Date: | 9 Nov 1997 12:06:15 -0500 |
Organization: | Bentley Systems, Inc. |
References: | 97-11-038 |
Keywords: | arithmetic, optimize |
Vincent Lefevre wrote:
>
> Some compilers (including gcc) are able to convert a "multiply by a
> constant" operation into a sequence of shifts and adds/subtracts.
The method I am using for our JIT compiler is memoizing dynamic
algorithm that uses a dag of best match sequences. I cannot share the
source code because it is commercial product, but I've put algorithm
description and compiled program (win32) that uses it at:
http://w3.icdc.com/~solyanik/decomp.html
This algorithm is a "smart brute force" (as any dynamic algorithm),
but it seems to work and it turned out to be fast enough for JIT
environment.
I would be very interested to seem smarter implementation.
Regards -
Sergey Solyanik
Software Developer
Bentley Systems, Inc
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.