RFA: Add implementation of cabsl()

Corinna Vinschen vinschen@redhat.com
Fri Feb 6 16:14:00 GMT 2015


On Feb  6 12:36, Nick Clifton wrote:
> Hi Guys,
> 
>   Attached is a patch that adds an implementation of the cabsl()
>   function to newlib.  I foolishly thought that adding a function that
>   just computes an absolute value would be easy, but boy was I wrong.
>   It turns out that I had to add a whole lot of supporting functions,
>   including a long double square root (sqrtl) and a long double
>   hypotenuse (hypotl) function, as well as definitions of IEEE long
>   double formats for a whole variety of architectures.  So the patch is
>   actually quite large.  The good news is that (if the patch is
>   acceptable) adding further long double math functions should be easier
>   now that most of the architectural support is in place.
> 
>   One thing that might prove problematic is that the sqrtl() function
>   currently only rounds up to the nearest bit, rather than trying to
>   figure out the rounding mode currently in use and then applying that.
>   My hope is that if this is considered to be a problem, it could be
>   fixed by a follow up patch.  (Preferably written by someone who is more
>   familiar with this kind of math than I am).
> 
>   Another problem I had was testing the patch.  I used an aarch64
>   toolchain to test compiling code that used the functions, but the
>   simulator I have is unable to run the code properly.  (This is due to
>   problems with the simulator, which is currently under development).
> 
>   I tried to build an x86_64-pc-cygwin toolchain, but no matter what I
>   did I could not get one to compile.  If I had more time I would look
>   into this, but I need to get back to other work.
> 
>   In the end I build an x86_64-pc-elf toolchain, extracted the maths
>   library from that and linked it into a test binary built natively on a
>   x86_64 Linux host.  Cumbersome, but it worked, and the code tests
>   alright, at least for the limited testing I performed.
>   
>   OK to apply ?

This looks like an excellent start into the wonderful world of long
double function support.  Yes, please apply.

So, if I want to export the functions from Cygwin, which new functions
are now supported?  AFAICs, the list is

  cabsl, cimagl, creall, finitel, hypotl, sqrtl

That's it?  Funny enough, finitel is accidentally not on the list
of missing long double functions I sent to you a while ago :)


Thanks,
Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/newlib/attachments/20150206/c0b5d35c/attachment.sig>


More information about the Newlib mailing list