Sun, 25 Oct 1992 17:41:42 GMT

Related articles |
---|

multiplication by constant - quick comparison of algorithms wu@sequent.com (Youfeng Wu) (1992-10-21) |

Re: multiplication by constant - quick comparison of algorithms preston@helena.cs.rice.edu (1992-10-21) |

Re: multiplication by constant - quick comparison of algorithms bgb@iexist.att.com (1992-10-25) |

Re: multiplication by constant - quick comparison of algorithms chased@rbbb.Eng.Sun.COM (1992-10-27) |

Re: multiplication by constant - quick comparison of algorithms joe@babel.ho.att.com (1992-10-28) |

Newsgroups: | comp.compilers |

From: | bgb@iexist.att.com (Brian G Beuning) |

Organization: | AT&T |

Date: | Sun, 25 Oct 1992 17:41:42 GMT |

References: | 92-10-079 |

Keywords: | arithmetic, optimize |

wu@sequent.com (Youfeng Wu):

*> For all numbers in [2, 10000], there is a total number of 64612 one's in*

*> their binary represenations, and the following compares the total number*

*> of add/sub/shift instructions used to perform all of the multiplications*

Isn't it a little dangerous to use sub? Won't it overflow sometimes when

the multiply would not.

I thought I would mention that this topic is covered in Knuth Volume 2,

section 4.6.3. There he is talking about reducing multiplications in

exponentiation but the techniques should also apply to reducing additions

in multiplication.

Brian Beuning

--

Post a followup to this message

Return to the
comp.compilers page.

Search the
comp.compilers archives again.