[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Trouble with division

From: Neil Johnson
Subject: Re: [avr-gcc-list] Trouble with division
Date: Mon, 16 Jun 2003 21:26:27 +0100 (BST)

> Of course divison by a power of two is very fast because it is just a bit
> shift and not really a division. Other than that, is a division really
> that operand-dependend?

It depends on the implementation (since the AVR does not have hardware
divide this must be emulated in a software library).  The ones I've
implemented in assembler have been optimized quite heavily for speed, so
that dividing small numbers is faster than dividing large numbers.  It can
also depend on the number of 1's in the arguments as to whether you need
to do subtraction or not.

So, yes, it does depend.


Neil Johnson :: Computer Laboratory :: University of Cambridge ::
http://www.njohnson.co.uk          http://www.cl.cam.ac.uk/~nej22
----  IEE Cambridge Branch: http://www.iee-cambridge.org.uk  ----

reply via email to

[Prev in Thread] Current Thread [Next in Thread]