[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-libc-dev] fplib and MUL
From: |
Joerg Wunsch |
Subject: |
Re: [avr-libc-dev] fplib and MUL |
Date: |
Sun, 9 Oct 2005 21:40:36 +0200 |
User-agent: |
Mutt/1.4.2.1i |
As Peeter Vois wrote:
> 1) to use MUL commands for the CPU's that support it.
Sounds like a good idea.
> 2) to avoid division operations for log_2(x) calcultaion
This one, too...
> 3) Instead of division with constant to use multiplication for
> example by calculation of log_10(x),
...as well as this one.
> Some more ideas will come as I do this optimisation. My question now
> is that is someone doing something in this area?
Alas, that's the weak point. We currently lack a person actively
maintaining fplib. Almost all of the more serious open bug reports
affect fplib. We're still seeking a volunteer here...
As Björn Haase wrote:
> > As first I will go and try
> > to make the multiplication and look if the device groups avr-gcc
> > entirely have or have not MUL instruction available.
> ... Summing up: All of the avr5 devices are
> assumed to have hw multipliers.
Actually, avr4 and avr5 do have the hw multiplier. The difference
between both is that devices which only have/need RJMP/RCALL form
avr4, while those that need/have JUMP/CALL are avr5.
For preprocessor tests, the compiler sets the cpp macro __AVR_ARCH__
to the respective value, so the existence of a hardware multiplier can
(currently) be tested using
#if __AVR_ARCH__ >= 4
...
#endif
Note that the current scheme needs to be refined some day, as we
recently saw the first devices that don't fit anymore, and had to be
``downgraded'' into the next lower class: ATtiny13 and ATtiny2313.
Both have some features of avr4 cores (word instructions) yet don't
have a hardware multiplier, so they are effectively avr2.5 or
something like that... I guess the same will apply to all future
ATtiny devices that appear on the market. Currently, GCC cannot use
their ability to handle word instructions.
--
cheers, J"org .-.-. --... ...-- -.. . DL8DTL
http://www.sax.de/~joerg/ NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)