[M3commit] CVS Update: cm3
Mika Nystrom
mika at elego.de
Sun Apr 3 02:32:48 CEST 2011
CVSROOT: /usr/cvs
Changes by: mika at birch. 11/04/03 02:32:48
Added files:
cm3/m3-libs/m3core/src/float/C99/: FPU.i3 FPU.m3 FloatMode.i3
FloatMode.m3 FloatModeC.c
FloatModeC.i3 m3makefile
Log message:
This checkin provides Modula-3 bindings for C99 floating-point
environment control <fenv.h> for IEEE 754 floating-point numbers.
C99 provides almost all the features that are exported by Modula-3's FloatMode.i3.
The one shortcoming of C99 is that it does not provide a means of
setting actions on exceptions. Hence, SetBehavior and GetBehavior
are left unimplemented. GLIBC on Linux does provide features with
which these routines could be implemented but not all systems can
be depended on to have them. These routines should probably be provided
in another module, which could be linked on systems that have the features
in question. The C names of the necessary routines are as follows:
int feenableexcept(int excepts);
int fedisableexcept(int excepts);
int fegetexcept(void);
Not sure how this all interacts with threading at the moment. It
probably "just works" under pthreads, but more work may have to be
done for user threads, to potentially save and restore the floating
flags and modes on every thread switch.
So far the system has been tested (using the Modula-Scheme system) on
FreeBSD4 only.
More information about the M3commit
mailing list