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: Processor rounding modes


On 23 April 2006 23:34, Andrew Cheadle wrote:

> I'm trying to get a version of some software running under Cygwin
> and I'm having real problems in finding routines that directly interface
> to the floating point processor rounding modes. I have code for
> different architectures that use fpu_control.h, ieeefp.h, fenv.h and
> WIN32 float.h. However, for various reasons, I need cygwin's runtime
> library environment and can't use the native Win32 port nor the mingw
> runtime.

   Well, it's still not in cygwin yet, but in the meantime you could roll your
own pretty easy: just hack out the bits you need from glibc.  Get a copy of
fpu_control here:
http://sourceware.org/cgi-bin/cvsweb.cgi/libc/sysdeps/i386/fpu_control.h?cvsro
ot=glibc

  Find source files for fpXXXX functions here:
http://sourceware.org/cgi-bin/cvsweb.cgi/libc/sysdeps/i386/fpu/?cvsroot=glibc


> not implemented for Cygwin. Then I see that ieeefp.h has prototypes
> declarations for fpsetround and friends but there is no library to link
> with (AFAICT). Is this correct, 

  It is correct; the prototypes are there but the functions not implemented
yet.

> is there a way to do this under Cygwin 

  See above.  I found that just plonking a copy of fpu_control.h into
/usr/local/include was enough to allow me to use the
'set_math_double_precision()' bugfix to the testcase illustrated at
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=323

  I can imagine that fp exception handling stuff might not be complete, and
you'll need to find a bodge or workaround or substitute for the caps-detecting
stuff it uses in some functions to know if you have SSE or MMX or whatever
(eg. fpsetround), but if you're only after basic stuff it would be easy
enough.

> or is Gary Polhill's library (announced
> http://sourceware.org/ml/cygwin/2004-06/msg00037.html) still the only way?


<manuel> I-a-know-a-nothing! </manuel>

    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....


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


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