Re: Integer division

"robin" <robin51@dodo.com.au>
Mon, 3 Jan 2011 02:29:59 +1100

          From comp.compilers

Related articles
Integer division drizzle76@gmail.com (dz) (2010-12-27)
Re: Integer division derek@_NOSPAM_knosof.co.uk (Derek M. Jones) (2010-12-29)
Re: Integer division gah@ugcs.caltech.edu (glen herrmannsfeldt) (2010-12-30)
Re: Integer division robin51@dodo.com.au (robin) (2011-01-03)
| List of all articles for this month |

From: "robin" <robin51@dodo.com.au>
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" <gah@ugcs.caltech.edu>
Sent: Thursday, 30 December 2010 9:03 PM


> dz <drizzle76@gmail.com> 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.