Usenet comp.os.linux.alpha (1997-2013)
 help / color / mirror / Atom feed
From: andi@complang.tuwien.ac.at (Andreas Krall)
Subject: Re: DU <--> Linux FP exceptions with DU binaries
Date: 1999/01/19	[thread overview]
Message-ID: <782mmd$jci$1@news.tuwien.ac.at> (raw)
In-Reply-To: 781meq$12mi@rzurs10.unizh.ch

In article <781meq$12mi@rzurs10.unizh.ch>,
	noe@physik.unizh.ch (Norbert Paschedag) writes:
> Hi, 
> 
> I have a question for the more experienced Fortran users : 
> 
> We're trying to run DU binaries (Dec F90) on our Linux machines. Under both
> Digital UNIX and Linux we experience floating point exceptions which 
> appear due to FP underflows etc.

In my C-source code I use under Linux and Digital Unix I use the
following:



#ifdef __osf__

void init_exceptions(void)
{

#else /* Linux */

/* Linux on Digital Alpha needs an initialisation of the ieee floating point
	control for IEEE compliant arithmetic (option -mieee of GCC). Under
	Digital Unix this is done automatically.
*/

#include <asm/fpu.h>

extern unsigned long ieee_get_fp_control();
extern void ieee_set_fp_control(unsigned long fp_control);

void init_exceptions(void)
{
/* initialize floating point control */

ieee_set_fp_control(ieee_get_fp_control()
                    & ~IEEE_TRAP_ENABLE_INV
                    & ~IEEE_TRAP_ENABLE_DZE
/*                  & ~IEEE_TRAP_ENABLE_UNF   we dont want underflow */
                    & ~IEEE_TRAP_ENABLE_OVF);
#endif
}

Try a similar initialisation using the FORTRAN equivalent.

Andi

-- 
andi@complang.tuwien.ac.at               Andreas Krall
http://www.complang.tuwien.ac.at/andi/   Inst. f. Computersprachen, TU Wien
tel: (+431) 58801/18511                  Argentinierstr. 8/4/1851
fax: (+431) 58801/18598                  A-1040 Wien     AUSTRIA     EUROPE



  parent reply	other threads:[~1999-01-19  5:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-01-19  5:00 DU <--> Linux FP exceptions with DU binaries Norbert Paschedag
1999-01-19  5:00 ` Greg Lindahl
1999-01-19  5:00   ` Norbert Paschedag
1999-01-19  5:00 ` Andreas Krall [this message]
1999-01-20  5:00   ` Michal Jaegermann
1999-01-20  5:00   ` Norbert Paschedag
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox