disabling libm
J. Johnston
jjohnstn@redhat.com
Wed Jun 4 21:27:00 GMT 2003
Joel Sherrill wrote:
>
> "J. Johnston" wrote:
>
>>Joel Sherrill wrote:
>>
>>>Hi,
>>>
>>>I am trying to update my tic4x toolset. The tic4x does not
>>>use IEEE FP. The last time I looked into this, the newlib libm
>>>was very IEEE FP format dependent. It would be easier to not
>>>have newlib's libm for now. Is it possible to completely disable
>>>it for a target?
>>>
>>
>>It is definitely "possible" via configuration; the question is whether
>>it is warranted. Does the build fail or do any of the libm files
>>placed in libc cause problems? I assume you are already just linking
>>in your own libm stuff anyway.
>
>
> I have managed to get a build to complete at this point with libm.
> Speaking without doing an up to date analysis, this libm is heavily
> dependent on IEEE floating point format. The tic4x target is not
> IEEE so very little if anything works even if it compiles.
>
> I have a hacked together libm substitute that is far from optimal
> but tries to be portable. But really I would like to see newlib
> work better with non-IEEE FPUs. Any ideas?
>
Well, the mathfp stuff uses a number of floating-point algorithms
that should work for the platform. So, for starters. try
--enable-newlib-hw-fp to configure. There are still some IEEE-isms
found there, but a lot of basics are provided (e.g. sin/cos) in
float algorithms.
You will need to replace a number of the routines in libm/common.
For this, there is the libm/machine directory. Add a tic4x directory
and start adding stuff in there. With the stuff in common replaced,
you should have a good basic math set. Finally, you can replace any
other remaining routines in mathfp that are IEEE dependent.
-- Jeff J.
More information about the Newlib
mailing list