avr-libc-dev
[Top][All Lists]
Advanced

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

Re: [avr-libc-dev] [bug #12739] Gcc assumes that target libc provides ff


From: Joerg Wunsch
Subject: Re: [avr-libc-dev] [bug #12739] Gcc assumes that target libc provides ffs function
Date: Thu, 21 Apr 2005 22:34:06 +0200
User-agent: Mutt/1.4.2.1i

As Dmitry K. wrote:

> > This makes 6 clocks per cycle, so up to ~ 100 clocks max.

> Misprint: 7 clocks per cycle (rjmp).

OK, I've confused that with the number of code words.

> > I'm interested in seeing Dmitry's code...
> 
> I have use byte-width shift:
> 
>    #define val_lo  r24
>    #define val_hi  r25
>    #define cntr    r30
>         ...
>    ffs:
>         ldi     cntr, 1
>         tst     val_lo
>         brne    2f
>         or      val_lo, val_hi
>         breq    9f
>         ldi     cntr, 8
>    1:   inc     cntr
>    2:   ror     val_lo
>         brcc    1b
>         mov     r24, cntr
>         clr     r25
>    9:   ret

Oh, I see.

The only thing I'm not too keen on is to have more assembler files in
the tree.  But the code is for sure excellent. ;-)

-- 
cheers, J"org               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/                        NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)




reply via email to

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