bug-gsl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-gsl] gsl on mactel


From: Charles Ballard
Subject: Re: [Bug-gsl] gsl on mactel
Date: Fri, 17 Mar 2006 17:36:19 +0000

Hi Brian,

I wish things were so simple. The fpu.h seems to be an old redundant file. Everything compiles, but the GSL_IEEE_MODE tests do not have an effect. Using fenv.h and deriving from fp-gnuc99.h gives functional code for the rounding controls, unfortunately apple's fpe control functions do not work as advertised. The diff is against fp- gnuc99.c in gsl-1.7

Ta,

Charles

diff -C 2 fp-darwinx86.c fp-gnuc99.c
*** fp-darwinx86.c      Tue Mar 14 16:51:17 2006
--- fp-gnuc99.c Tue Mar 14 15:56:23 2006
***************
*** 1,3 ****
! /* ieee-utils/fp-darwinx86.c
   *
   * Copyright (C) 2003, 2004 Brian Gough
--- 1,3 ----
! /* ieee-utils/fp-gnuc99.c
   *
   * Copyright (C) 2003, 2004 Brian Gough
***************
*** 29,33 ****
  gsl_ieee_set_mode (int precision, int rounding, int exception_mask)
  {
!   fexcept_t mode;

    switch (precision)
--- 29,33 ----
  gsl_ieee_set_mode (int precision, int rounding, int exception_mask)
  {
!   int mode;

    switch (precision)
***************
*** 88,92 ****
    /* Turn on all the exceptions apart from 'inexact' */

!   fegetexceptflag(&mode, FE_ALL_EXCEPT);
  #ifdef FE_INVALID
    mode |= FE_INVALID;
--- 88,93 ----
    /* Turn on all the exceptions apart from 'inexact' */

!   mode = 0;
!
  #ifdef FE_INVALID
    mode |= FE_INVALID;
***************
*** 170,174 ****
      }

!   fesetexceptflag(&mode,FE_ALL_EXCEPT);

    return GSL_SUCCESS ;
--- 171,181 ----
      }

! #if HAVE_DECL_FEENABLEEXCEPT
!   feenableexcept (mode) ;
! #elif HAVE_DECL_FESETTRAPENABLE
!   fesettrapenable (mode);
! #else
!   GSL_ERROR ("unknown exception trap method", GSL_EUNSUP);
! #endif

    return GSL_SUCCESS ;

On 14 Mar 2006, at 15:21, Brian Gough wrote:

Charles Ballard writes:
gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -g -O2 -c fp.c  -fno-common -
DPIC -o .libs/fp.lo
fp-darwin.c: In function 'gsl_ieee_set_mode':
/usr/include/architecture/ppc/fp_regs.h:132: error: output constraint
0 must specify a single register
fp-darwin.c:95: confused by earlier errors, bailing out

Having a quick look in fpu.h there seems to be a fairly simple
relationship with the old fp-darwin.c.  make check run and passes all
tests (but I do not know if it is being tested properly)


Hello,
Thanks for the bug report.

Just to confirm what you did: you changed #include
<architecture/ppc/fp_regs.h> to #include <architecture/i386/fp_regs.h>
in fp-darwin.c and it compiled?

In the "IEEE" chapter of the GSL reference manual there are some
examples of usage of the GSL_IEEE_MODE environment variable -- if you
can try those out and confirm that everything works correctly I'll add
support for the intel mac.

--
Brian Gough

Network Theory Ltd,
Publishing Free Software Manuals --- http://www.network-theory.co.uk/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]