Re: Multiply by a constant --> shift-and-adds algorithm?

Christopher Glaeser <cdg@nullstone.com>
13 Nov 1997 23:41:56 -0500

          From comp.compilers

Related articles
Multiply by a constant --> shift-and-adds algorithm? Vincent.Lefevre@ens-lyon.fr (Vincent Lefevre) (1997-11-07)
Re: Multiply by a constant --> shift-and-adds algorithm? rweaver@ix.netcom.com (1997-11-09)
Re: Multiply by a constant --> shift-and-adds algorithm? preston@cs.rice.edu (1997-11-09)
Re: Multiply by a constant --> shift-and-adds algorithm? ssolyanik@icdc.com (Sergey Solyanik) (1997-11-09)
Multiply by a constant --> shift-and-adds algorithm? txr@alumni.caltech.edu (Tim Rentsch) (1997-11-09)
Re: Multiply by a constant --> shift-and-adds algorithm? n8tm@aol.com (1997-11-11)
Re: Multiply by a constant --> shift-and-adds algorithm? dube@brachio.IRO.UMontreal.CA (Danny Dube) (1997-11-11)
Re: Multiply by a constant --> shift-and-adds algorithm? cdg@nullstone.com (Christopher Glaeser) (1997-11-13)
Re: Multiply by a constant --> shift-and-adds algorithm? ssolyanik@icdc.com (Sergey Solyanik) (1997-11-14)
Re: Multiply by a constant --> shift-and-adds algorithm? shankar@powertelglobal.com (Shankar Unni) (1997-11-15)
Multiply by a constant --> shift-and-adds algorithm? preston@tera.tera.com (1997-11-16)
Re: Multiply by a constant --> shift-and-adds algorithm? cdg@nullstone.com (Christopher Glaeser) (1997-11-18)
const_int * (int / const_int) by shift adds? cef@geodesic.com (Charles Fiterman) (1997-11-20)
| List of all articles for this month |

From: Christopher Glaeser <cdg@nullstone.com>
Newsgroups: comp.compilers
Date: 13 Nov 1997 23:41:56 -0500
Organization: Compilers Central
References: 97-11-038
Keywords: arithmetic, optimize, performance

> [This has come up before. As I recall, it's not hard to invent
> heuristics that do pretty well, but it's extremely hard to generate
> optimal code. -John]


In addition to testing the run-time performance, be sure and test the
compile-time performance of the algorithm. When testing various
compilers with different repeating bit patterns, I have measured compile
times of several minutes per constant, and on rare occasion, have
measured compile times as high as one hour per constant.


Best regards,
Christopher Glaeser cdg@nullstone.com
Nullstone Corporation http://www.nullstone.com
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.