From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111c93,84278579ba085c08 X-Google-Attributes: gid111c93,public From: andi@complang.tuwien.ac.at (Andreas Krall) Subject: Re: FP exceptions on redhat 5.1 Date: 1998/09/17 Message-ID: <6tr6pa$r3t$1@news.tuwien.ac.at>#1/1 X-Deja-AN: 392061659 References: <35F9BAB0.5DDE@wizard.com> <6totkh$7pj$1@news.tuwien.ac.at> Content-Type: text/plain; charset=us-ascii Organization: Vienna University of Technology, Austria Mime-Version: 1.0 Newsgroups: comp.os.linux.alpha In article , Robert Harley writes: > > andi@complang.tuwien.ac.at (Andreas Krall) writes: >> I have the problem that these compiler options do not work under >> Linux(ALpha). I wrote the following small test program: >> >>[...] >> I compiled this program using gcc with -mieee, egcs with -mieee and the >> Digital cc with -ieee. The programs works correct (printing NaN's and >> Inf's) under Digital Unix, but does not work under Linux. Under Linux >> it just throws an exception. [...] > > The difference is that in Digital Unix, no traps are enabled by > default. Whereas on Linux, traps for invalid ops, division by zero > and overflow are enabled by default. > > > You should do something like this: > > #include > extern unsigned long ieee_get_fp_control(); > extern void ieee_set_fp_control(unsigned long fp_control); > > ieee_set_fp_control( ieee_get_fp_control() > & ~IEEE_TRAP_ENABLE_INV > & ~IEEE_TRAP_ENABLE_DZE > & ~IEEE_TRAP_ENABLE_OVF > ); > > at the beginning of your thread... Thanks, no it works. -- 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) 5057838 A-1040 Wien AUSTRIA EUROPE