Re: Integer division

"robin" <>
Mon, 3 Jan 2011 02:29:59 +1100

          From comp.compilers

Related articles
Integer division (dz) (2010-12-27)
Re: Integer division (Derek M. Jones) (2010-12-29)
Re: Integer division (glen herrmannsfeldt) (2010-12-30)
Re: Integer division (robin) (2011-01-03)
| List of all articles for this month |

From: "robin" <>
Newsgroups: comp.compilers
Date: Mon, 3 Jan 2011 02:29:59 +1100
Organization: Compilers Central
References: 10-12-050 10-12-060
Keywords: arithmetic
Posted-Date: 02 Jan 2011 20:41:33 EST

From: "glen herrmannsfeldt" <>
Sent: Thursday, 30 December 2010 9:03 PM

> dz <> wrote:
>> I am looking for references on how to support general 32 bit
>> integer division (not just invariants) on hardware without dedicated
>> integer-division support and 64 bit floating point support.
> Well, there is always the shift/subtract loop generating
> one bit at a time. Either the restoring or non-restoring
> division algorithm should be easy to find. Many processors without
> hardware divide have instruction to make this easier, such as
> rotate and rotate through carry.

Whether restoring or not, rotate and rotate thru carry are not
required. All that is needed is shift and add/subtract.

Both methods have been used from the early days when computers did not
have an integer divide instruction. Even when the computer did have a
hardware instruction, one of the above methods was used to check that
the hardware divide instruction was working correctly.

Post a followup to this message

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