This is the mail archive of the
newlib@sources.redhat.com
mailing list for the newlib project.
Re: c4x - TMS320C30-40
- From: Joel Sherrill <joel dot sherrill at OARcorp dot com>
- To: Peter Lambert <plambert at qa dot com dot au>
- Cc: newlib at sources dot redhat dot com
- Date: Thu, 06 Feb 2003 17:40:38 -0600
- Subject: Re: c4x - TMS320C30-40
- Organization: OAR Corporation
- References: <006701c2ce37$9c0d36b0$0200a8c0@quantum>
Peter Lambert wrote:
>
> I'm about to use the c4x-gcc compiler and have installed and compiled
> newlib. There were bits of code in the some of the configuration scripts
> but needed bits added in others. Is there anyone using or actively working
> on the c4x newlib code ?
When we ported RTEMS to the TI C3x/C4x, we had pretty good luck with
the libc portion. But (at that time) newlib's libm was pretty IEEE
dependent. We fought it for a while but decided that there was a
need for an alternative libm which wasn't IEEE dependent. The end
result was what we called plibm. We never got it to the point of
submission
but it is available at:
ftp::/ftp.oarcorp.com/pub/plibm
The implementation philosophy was very simple.
+ Implement a CORDIC function at the bottom (found on the net
so it is probably correct :)
+ For every routine possible provide float, double, and long
double variants via macro compilation that invoked the
appropriate CORDIC routine (float, double, or long double).
+ CORDIC routines give you the primitives for the trigonometric
functions so use that as a baseline combined with what you
learned in algebra to get the routine in the public API.
+ Put each API entry in a separate file so it could be overridden
by a single CPU specific implementation. We did this for the c3x
and have this much code:
bash-2.05$ ls ../machine/c3x/
cordic_.h expf.c frexpld.c math_internal.h
_sqrt.S
cos.c expld.c log.c sin.c
tan.c
cosf.c _exp.S logf.c sinf.c
tanf.c
cosld.c float_setup.h logld.c sinld.c
tanld.c
_cos.S floor.c _log.S _sin.S
CVS _fpinv.S long_double_setup.h sqrt.c
double_setup.h frexp.c machine.h sqrtf.c
exp.c frexpf.c Makefile sqrtld.c
> If not, there is a little bit of stuff that will need to be done, I'll do it
> on the way and will contribute.
Take a look at this code and see if it helps the libm situation any.
My biggest warning is that no one on our team was a mathmetician
and that scared us all into not trusting it enouguh to submit it.
I would love to see this code resurrected and merged into newlib as
an alternative to the IEEE implementation. If it is worthy.
> Peter Lambert.
--
Joel Sherrill, Ph.D. Director of Research & Development
joel@OARcorp.com On-Line Applications Research
Ask me about RTEMS: a free RTOS Huntsville AL 35805
Support Available (256) 722-9985