Mon, 13 Sep 2010 01:03:18 -0400

Related articles |
---|

Divide-by-multiply algorithm reference needed newcomer@flounder.com (Joseph M. Newcomer) (2010-09-13) |

Re: Divide-by-multiply algorithm reference needed rsc@swtch.com (Russ Cox) (2010-09-13) |

Re: Divide-by-multiply algorithm reference needed gah@ugcs.caltech.edu (glen herrmannsfeldt) (2010-09-14) |

Re: Divide-by-multiply algorithm reference needed newcomer@flounder.com (Joseph M. Newcomer) (2010-09-14) |

Re: Divide-by-multiply algorithm reference needed newcomer@flounder.com (Joseph M. Newcomer) (2010-09-14) |

Re: Divide-by-multiply algorithm reference needed pvk@pvk.ca (Paul Khuong) (2010-09-14) |

Re: Divide-by-multiply algorithm reference needed gah@ugcs.caltech.edu (glen herrmannsfeldt) (2010-09-15) |

From: | "Joseph M. Newcomer" <newcomer@flounder.com> |

Newsgroups: | comp.compilers |

Date: | Mon, 13 Sep 2010 01:03:18 -0400 |

Organization: | NewsGuy - Unlimited Usenet $19.95 |

Keywords: | arithmetic, question |

Posted-Date: | 13 Sep 2010 21:02:58 EDT |

Division can be approximated with multiprecision multiplication, e.g.,

32-bit division can be done by producing the appropriate 64-bit

product and using the high order 32 bits.

My problem is I am trying to find the algorithm by which I can

generate the 32-bit multiplier and the shift amount, given a specific

constant divisor. I am unable to find any references via google. Any

recommendations? No, I really don't want to read the gcc source (even

if it does this) unless someone knows the specific subroutine name I

should be looking at.

joe

Joseph M. Newcomer [MVP]

email: newcomer@flounder.com

Web: http://www.flounder.com

MVP Tips: http://www.flounder.com/mvp_tips.htm

Post a followup to this message

Return to the
comp.compilers page.

Search the
comp.compilers archives again.