Home | Contact | Projects | Post Mortem | Publications | Pictures | Private | Blog


Low Footprint 64bit Arithmetics


Software:uint64_ops.h, version 2010-08-08
License:GPL V2, more permissive upon request

Atmel's microcontroller series (especially the ATtiny ones) have very little flash, so the generic 64 bit routines from libgcc are typically too big, and also not optimized. I required (few) 64bit operations in my reciprocal frequency meter, thus I implemented C and assembler routines.

Unfortunately, gcc's asm() doesn't allow to allocate 64bit registers yet (%[EFGH]0 is replaced by %A0 instead of the registers for the upper 32bit). Thus gcc's calling convention must be used, which makes the routines a bit fragile to compiler changes (I wouldn't worry too much, though). Also, the routines would require more validation. They seem to work fine so far, but no guarantees!

Available operations so far: