From: Gupta, U. <Ush...@at...> - 2010-07-28 08:27:12
|
> > >From the above, it looks like the default library version would be > IEEE. > > Can you verify this? Remember that we're using a patched Newlib > > 1.16.0, not the latest version of Newlib. If we are using the IEEE > > version by default, then this would simplify implementation of the > > math library for avr32-libc. Does math library for avr32-libc need to be multi-standard compliant as Newlib?? > > > The versions of the library differ only in how errors are handled. This webpage gives information on Standards Compliance. Table E-1(Exceptional cases and libm functions) shows the exceptional input values for libm functions and their return values under different standards. http://docs.sun.com/source/806-3568/ncg_compliance.html This is how Newlib also handles exceptional input values. > -----Original Message----- > From: Gupta, Usha [mailto:Ush...@at...] > Sent: Tuesday, July 27, 2010 12:36 PM > To: Weddington, Eric; usha gupta; avr...@li... > Cc: Mainchain, Stephane > Subject: Re: [avr32-libc-devel] Summary of functions in > newlib'slibmandfloating point support in AVR32 > > > > > -----Original Message----- > > From: Weddington, Eric [mailto:Eri...@at...] > > Sent: Tuesday, July 27, 2010 2:51 AM > > To: usha gupta; avr...@li... > > Cc: Mainchain, Stephane > > Subject: Re: [avr32-libc-devel] Summary of functions in newlib's > > libmandfloating point support in AVR32 > > > > > > > > > > > -----Original Message----- > > > From: usha gupta [mailto:ush...@gm...] > > > Sent: Monday, July 26, 2010 6:24 AM > > > To: avr...@li... > > > Subject: [avr32-libc-devel] Summary of functions in newlib's > > > libm andfloating point support in AVR32 > > > > > > Hi All, > > > > > > I have been investigating newlib's libm and floating point > > > support in AVR32 .Here is the information that i have got so > > > far. I would like to discuss on implementation of libm for > > > avr32-libc. > > > > > > > <snip> > > > > > Newlib's libm > > > > > > > > > > > > There are four different versions of the math library > > > routines: IEEE, POSIX, X/Open, or SVID. The version may be > > > selected at runtime by setting the global variable > > > {_LIB_VERSION}, defined in {math.h}. It may be set to one of > > > the following constants defined in {math.h}: {_IEEE_}, > > > {_POSIX_}, {_XOPEN_}, or {_SVID_}. > > > > > > The versions of the library differ only in how errors are handled. > > > > > > Default version is X/Open. > > > > > > > I see that you got the above information from the Newlib manual (recent > > version online). However, compare that to what is found in the actual > > math.h that is being used for the AVR32: > > > > ============================================ > > > > /* Global control over fdlibm error handling. */ > > > > enum __fdlibm_version > > { > > __fdlibm_ieee = -1, > > __fdlibm_svid, > > __fdlibm_xopen, > > __fdlibm_posix > > }; > > > > #define _LIB_VERSION_TYPE enum __fdlibm_version > > #define _LIB_VERSION __fdlib_version > > > > extern __IMPORT _LIB_VERSION_TYPE _LIB_VERSION; > > > > #define _IEEE_ __fdlibm_ieee > > #define _SVID_ __fdlibm_svid > > #define _XOPEN_ __fdlibm_xopen > > #define _POSIX_ __fdlibm_posix > > > > ============================================ > > > > >From the above, it looks like the default library version would be > IEEE. > > Can you verify this? Remember that we're using a patched Newlib 1.16.0, > > not the latest version of Newlib. If we are using the IEEE version by > > default, then this would simplify implementation of the math library for > > avr32-libc. > > Looking at file "newlib-1.16.0/newlib/libm/common/s_lib_ver.c", the > default is _IEEE_ but it includes fdlibm.h which defines _XOPEN_MODE which > makes _XOPEN_ as default. > > ========================================================================== > == > /*s_lib_ver.c*/ > > #include "fdlibm.h" > > /* > * define and initialize _LIB_VERSION > */ > #ifdef _POSIX_MODE > _LIB_VERSION_TYPE _LIB_VERSION = _POSIX_; > #else > #ifdef _XOPEN_MODE > _LIB_VERSION_TYPE _LIB_VERSION = _XOPEN_; > #else > #ifdef _SVID3_MODE > _LIB_VERSION_TYPE _LIB_VERSION = _SVID_; > #else /* default _IEEE_MODE */ > _LIB_VERSION_TYPE _LIB_VERSION = _IEEE_; > #endif > #endif > #endif > ========================================================================== > == > ========================================================================== > == > /* fdlibm.h*/ > /* REDHAT LOCAL: Default to XOPEN_MODE. */ > #define _XOPEN_MODE > ========================================================================== > == > > All the functions in Newlib's libm includes "fdlibm.h". I have verified in > the patched version of Newlib for avr32. > > -------------------------------------------------------------------------- > ---- > The Palm PDK Hot Apps Program offers developers who use the > Plug-In Development Kit to bring their C/C++ apps to Palm for a share > of $1 Million in cash or HP Products. Visit us here for more details: > http://ad.doubleclick.net/clk;226879339;13503038;l? > http://clk.atdmt.com/CRS/go/247765532/direct/01/ > _______________________________________________ > avr32-libc-devel mailing list > avr...@li... > https://lists.sourceforge.net/lists/listinfo/avr32-libc-devel |