Re: [PATCH] Add fenv.h and support.

2010-09-11 Thread Dave Korn
On 11/09/2010 12:17, Corinna Vinschen wrote:
> On Sep 11 12:22, Dave Korn wrote:

>>   How's this look?
>>
>> winsup/doc/ChangeLog:
>>
>>  * new-features.sgml: Mention fenv support.
> 
> I would remove the opengroup link and just keep the gnu C lib one,
> but other than that it looks good.

  Sure thing.  Committed with that change.

cheers,
  DaveK



Re: [PATCH] Add fenv.h and support.

2010-09-11 Thread Corinna Vinschen
On Sep 11 12:22, Dave Korn wrote:
> On 11/09/2010 09:09, Corinna Vinschen wrote:
> > Hi Dave,
> 
>   Morning!
> 
> > On Sep 11 08:11, Dave Korn wrote:
> >> So, I ended up committing it like so:
> > 
> > Can you please add some words to doc/new-features.sgml?
> 
>   How's this look?
> 
> winsup/doc/ChangeLog:
> 
>   * new-features.sgml: Mention fenv support.

I would remove the opengroup link and just keep the gnu C lib one,
but other than that it looks good.


Thanks,
Corinna

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


Re: [PATCH] Add fenv.h and support.

2010-09-11 Thread Dave Korn
On 11/09/2010 09:09, Corinna Vinschen wrote:
> Hi Dave,

  Morning!

> On Sep 11 08:11, Dave Korn wrote:
>> So, I ended up committing it like so:
> 
> Can you please add some words to doc/new-features.sgml?

  How's this look?

winsup/doc/ChangeLog:

* new-features.sgml: Mention fenv support.

cheers,
  DaveK

Index: new-features.sgml
===
RCS file: /cvs/src/src/winsup/doc/new-features.sgml,v
retrieving revision 1.56
diff -p -u -r1.56 new-features.sgml
--- new-features.sgml	6 Sep 2010 14:42:30 -	1.56
+++ new-features.sgml	11 Sep 2010 10:57:56 -
@@ -5,6 +5,19 @@
 
 
 
+Cygwin now ships the C standard library fenv.h header file, and implements the
+related APIs (including GNU/glibc extensions): feclearexcept, fedisableexcept,
+feenableexcept, fegetenv, fegetexcept, fegetexceptflag, fegetprec, fegetround,
+feholdexcept, feraiseexcept, fesetenv, fesetexceptflag, fesetprec, fesetround,
+fetestexcept, feupdateenv, and predefines both default and no-mask FP
+environments.  See the 
+http://www.opengroup.org/onlinepubs/95399/basedefs/fenv.h.html";>
+Single Unix Specification and the
+http://www.gnu.org/software/libc/manual/html_node/Arithmetic.html";>
+GNU C Library manual for full details of this functionality.
+
+
+
 /proc/sys allows to access the native NT namespace.
 
 


Re: [PATCH] Add fenv.h and support.

2010-09-11 Thread Corinna Vinschen
Hi Dave,

On Sep 11 08:11, Dave Korn wrote:
> On 11/09/2010 06:10, Christopher Faylor wrote:
> > On Sat, Sep 11, 2010 at 01:42:49AM +0100, Dave Korn wrote:
> >> On 10/09/2010 22:43, Christopher Faylor wrote:
> >>
> >>> Looks nice to me with one HUGE caveat:  Please maintain the pseudo-sorted
> >>> order in cygwin.din.  Sorry to have to impose this burden on you.
> >>  No, that's fine; I've never been sure whether we need to care about the
> >> ordinal numbers or not in that file.  (AFAIK, we don't have any realistic
> >> scenarios where anyone would be linking against the Cygwin DLL by ordinal
> >> imports, but I hate making assumptions based only on my own limited 
> >> experience...)
> > 
> > It never even occurred to me about ordinal numbers but since I've been
> > reorganizing that file for years I guess it hasn't been a problem.
> 
>   I checked.  Something somewhere sorts all the exports it turns out, so they
> all get ordinals assigned in alphanumeric sort order anyway, regardless of
> cygwin.din order.  So, I ended up committing it like so:

Can you please add some words to doc/new-features.sgml?


Thanks,
Corinna

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


Re: [PATCH] Add fenv.h and support.

2010-09-10 Thread Dave Korn
On 11/09/2010 06:10, Christopher Faylor wrote:
> On Sat, Sep 11, 2010 at 01:42:49AM +0100, Dave Korn wrote:
>> On 10/09/2010 22:43, Christopher Faylor wrote:
>>
>>> Looks nice to me with one HUGE caveat:  Please maintain the pseudo-sorted
>>> order in cygwin.din.  Sorry to have to impose this burden on you.
>>  No, that's fine; I've never been sure whether we need to care about the
>> ordinal numbers or not in that file.  (AFAIK, we don't have any realistic
>> scenarios where anyone would be linking against the Cygwin DLL by ordinal
>> imports, but I hate making assumptions based only on my own limited 
>> experience...)
> 
> It never even occurred to me about ordinal numbers but since I've been
> reorganizing that file for years I guess it hasn't been a problem.

  I checked.  Something somewhere sorts all the exports it turns out, so they
all get ordinals assigned in alphanumeric sort order anyway, regardless of
cygwin.din order.  So, I ended up committing it like so:

> Index: winsup/cygwin/cygwin.din
> ===
> RCS file: /cvs/src/src/winsup/cygwin/cygwin.din,v
> retrieving revision 1.224
> diff -p -u -r1.224 cygwin.din
> --- winsup/cygwin/cygwin.din  19 Jul 2010 18:22:40 -  1.224
> +++ winsup/cygwin/cygwin.din  11 Sep 2010 06:44:11 -
> @@ -453,10 +453,29 @@ fdopen SIGFE
>  _fdopen = fdopen SIGFE
>  _fdopen64 = fdopen64 SIGFE
>  fdopendir SIGFE
> +_fe_dfl_env DATA
> +_fe_nomask_env DATA
> +feclearexcept NOSIGFE
> +fedisableexcept NOSIGFE
> +feenableexcept SIGFE
> +fegetenv NOSIGFE
> +fegetexcept NOSIGFE
> +fegetexceptflag NOSIGFE
> +fegetprec NOSIGFE
> +fegetround NOSIGFE
> +feholdexcept SIGFE
> +_feinitialise NOSIGFE
>  feof SIGFE
>  _feof = feof SIGFE
> +feraiseexcept SIGFE
>  ferror SIGFE
>  _ferror = ferror SIGFE
> +fesetenv SIGFE
> +fesetexceptflag SIGFE
> +fesetprec NOSIGFE
> +fesetround NOSIGFE
> +fetestexcept NOSIGFE
> +feupdateenv SIGFE
>  fexecve SIGFE
>  fflush SIGFE
>  _fflush = fflush SIGFE

  Otherwise, committed as posted.

cheers,
  DaveK



Re: [PATCH] Add fenv.h and support.

2010-09-10 Thread Christopher Faylor
On Sat, Sep 11, 2010 at 01:42:49AM +0100, Dave Korn wrote:
>On 10/09/2010 22:43, Christopher Faylor wrote:
>
>> Looks nice to me with one HUGE caveat:  Please maintain the pseudo-sorted
>> order in cygwin.din.  Sorry to have to impose this burden on you.
>
>  No, that's fine; I've never been sure whether we need to care about the
>ordinal numbers or not in that file.  (AFAIK, we don't have any realistic
>scenarios where anyone would be linking against the Cygwin DLL by ordinal
>imports, but I hate making assumptions based only on my own limited 
>experience...)

It never even occurred to me about ordinal numbers but since I've been
reorganizing that file for years I guess it hasn't been a problem.

cgf


Re: [PATCH] Add fenv.h and support.

2010-09-10 Thread Dave Korn
On 10/09/2010 22:43, Christopher Faylor wrote:

> Looks nice to me with one HUGE caveat:  Please maintain the pseudo-sorted
> order in cygwin.din.  Sorry to have to impose this burden on you.

  No, that's fine; I've never been sure whether we need to care about the
ordinal numbers or not in that file.  (AFAIK, we don't have any realistic
scenarios where anyone would be linking against the Cygwin DLL by ordinal
imports, but I hate making assumptions based only on my own limited 
experience...)

> Other than that, please check in and thanks for the patch.  It was obviously
> a lot of work.

  Heh, actually not all that much.  I had one of those in-the-zone moments and
did both this and the gnu ld plugin infrastructure in one ~20h no-sleep coding
binge, then spent another few hours tidying it up after I'd slept a bit!

  So, I'll fix the cygwin.din and check in shortly.  Thanks for reviewing.

  (BTW, the request for advice re: automated compliance checking stands; I
would really like to run some proper formal testsuites against this, even if
they don't fully work on Cygwin.  Eric, surely you've looked at this stuff?  I
was certainly hoping so, anyway!)

cheers,
  DaveK



Re: [PATCH] Add fenv.h and support.

2010-09-10 Thread Christopher Faylor
On Fri, Sep 10, 2010 at 09:53:28PM +0100, Dave Korn wrote:
>
>
>Hi folks,
>
>  This patch adds fenv.h and the related support routines in the Cygwin DLL.
>It's an entirely unencumbered implementation that I wrote from scratch using
>only the public docs for reference.  We've been missing this for a while, what
>with PR323 and all, and if we add it in we'll be able to switch on the new
>decimal-floating-point features in the compiler.  (Amongst I'm sure many other
>uses).
>
>winsup/cygwin/ChangeLog:
>
>   * Makefile.in (DLL_OFILES): Add new fenv.o module.
>   (fenv_CFLAGS): New flags definition for fenv.o compile.
>   * autoload.cc (std_dll_init): Use fenv.h functions instead of direct
>   manipulation of x87 FPU registers.
>   * crt0.c (mainCRTStartup): Likewise.
>   * cygwin.din (feclearexcept, fegetexceptflag, feraiseexcept,
>   fesetexceptflag, fetestexcept, fegetround, fesetround, fegetenv,
>   feholdexcept, fesetenv, feupdateenv, fegetprec, fesetprec,
>   feenableexcept, fedisableexcept, fegetexcept, _feinitialise,
>   _fe_dfl_env, _fe_nomask_env): Export new functions and data items.
>   * fenv.cc: New file.
>   * posix.sgml: Update status of newly-implemented APIs.
>   * include/fenv.h: Likewise related header.
>   * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
>
>  Testing: well, I'm running the GCC testsuite against it to verify it builds
>functioning decimal floating point code, and I've manually tested some of the
>simple functionality like setting the exceptions on and off.  That's all so
>far, but I think it's close enough (and given that it's new functionality) to
>check in and fix any bugs that crop up on HEAD.  (I'd like to also see if I
>can run some of the LSB or Posix verification testsuites against it, but I
>don't know what's involved in that yet; if anyone has any experience with any
>of that stuff, I'd appreciate being dropped a note off-list with a few 
>pointers.)

Looks nice to me with one HUGE caveat:  Please maintain the pseudo-sorted
order in cygwin.din.  Sorry to have to impose this burden on you.

Other than that, please check in and thanks for the patch.  It was obviously
a lot of work.

cgf