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

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

[avr-libc-dev] fixed point math library


From: Sean D'Epagnier
Subject: [avr-libc-dev] fixed point math library
Date: Wed, 21 Jan 2009 09:23:48 -0500

Hello,

I have recently implemented a fixed point math library in assembly for
avrs.  I am hoping that it can be a part of avr-libc so it will be
available to many developers.  Also I welcome anyone who might be able
to optimize or extend its support.  It uses the fixed point support
built into gcc for avrs (patch for this also attached), and the math
library uses the s15.16 fixed point type.  Other fixed point types are
supported by avr-gcc, but not for trig operations yet.

The library is considerably smaller than the floating point library,
and faster for most operations (especially faster on avrs without a
multiplier) however because of the limited number of bits (only 16
fractional bits) it is not as precise.

In the avr-libc patch, I have put support in configure.ac to detect if
avr-gcc supports fixed point, and does not attempt to build libfixm.a
unless avr-gcc can handle these types.

I have a thread on avrfreaks forums:
http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=73345

Initially I would like any feedback on this patch.  There are various
ways to improve it, but they would require work.  I would appreciate
it if someone could attempt to build gcc and avr-libc with these
patches.

I also would like to know how the statistics for ram, flash usage and
cycle count is calculated for the other library functions so they can
be calculated for fixed point math operations for a comparison.

Thanks,
Sean

Attachment: avr-libc-fixmath-1-21-09.patch
Description: Text Data

Attachment: gcc-avr-fixedpoint-1-21-09.patch
Description: Text Data


reply via email to

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