This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Cygwin Perl and -Duselongdouble


On Apr 21 21:20, Reini Urban wrote:
> Yitzchak Scott-Thoennes schrieb:
> >On Thu, July 26, 2007 5:19 am, Corinna Vinschen wrote:
> >>On Jul 26 22:09, Sisyphus wrote:
> >>>I'd like to have a perl on Cygwin built with -Duselongdouble, so I tried
> >
> >>>*** You requested the use of long doubles but you do not seem to have
> >>>*** the following mathematical functions needed for long double support:
> >>>  ***     sqrtl modfl frexpl
> >>
> >>Long double functions are not supported by newlib so far.  There are a
> >>couple of C99 functions not available in newlib.  Volunteers implementing
> >>these functions in a license compatible way (BSD, not GPL) in newlib are
> >>always welcome.
> >
> >Note that changing perl to use long doubles is a binary incompatible change.
> >So if anyone is going to jump on this, it would be nice to have it happen
> >before the already incompatible 5.10 is out Septemberish.
> >
> >modfl isn't strictly necessary; perl will substitute aintl (a solaris
> >flavor of truncl) + copysignl.
> >And ilogbl + scalbnl can be used to emulate frexpl.
> 
> I think I'll bite the bullet for the upcoming perl-5.12.0, for which
> I already have an API change (-Uusemymalloc) so adding
> -Duselongdouble can be easily added.
> 
> I dissected long doubles for my parrot pbc_compat work last year so
> I believe I can do modfl and frexpl without looking at GPL infected
> code.
> http://code.google.com/p/cygwin-rurban/source/browse/trunk/release/parrot/patches/r36819-tt308-more-pf_items.patch
> 
> sqrtl is trivial in intel assembler:
> 
> long double sqrtl(long double ld) {
>   long double _result;
>   asm ("fsqrt" : "=t" (_result) : "0"(ld));
>   return _result;
> }

Adding real long double support to newlib would be extremly cool.
If you look into http://cygwin.com/cygwin-api/std-notimpl.html you'll
notice that the majority of the unimplemented functions are math
functions, and most of them are the long double and the complex number
functions.

Basically:

> These questions are for newlib later:
> Can I keep such a newlib code to 12-byte intel long doubles or must
> I add 16-byte long double support also?
> Our gcc has -m128bit-long-double and the bastard -m96bit-long-double.

It's ok to add 12 byte intel only for now.  It's much better than no
long double at all.

> Does newlib needs papers?

No.  Just add a liberal copyright notice to all your files, 2-clause BSD
or similar is fine.

> I see a comment about --enable-newlib-hw-fp in
> /usr/include/machine/ieeefp.h
> I have no idea what this should be. Is there some hidden prior art?

No idea, sorry.  Better ask on the newlib list.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]