[Top][All Lists]

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

Re: [avr-libc-dev] Interested in 64-bit printf support?

From: Georg-Johann Lay
Subject: Re: [avr-libc-dev] Interested in 64-bit printf support?
Date: Wed, 07 Dec 2016 22:48:27 +0100
User-agent: Thunderbird (Windows/20100228)

George Spelvin a écrit:
The developers of the TICC time interval counter are having
a problem printing 64-bit integers:

As an aside, attached is an AVR asm code (needs MUL) that
transforms uint64_t to decimal string.

Despite most algorithms, it starts with the highest digit
and need no string reversion, and it doesn't need div or mod.

The show stopper is presumably the code size because of the
multiplication by 10:  The value to convert is passed in regs
as of

extern void put64 (uint64_t val, char *buf);

The algo is rather slow because it always iterates over all
digits, i.e. it won't run faster for small numbers.

Have fun!

Code size is ~140 bytes.


X bitmap

reply via email to

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