From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111c93,61f58a8cf65e2602 X-Google-Attributes: gid111c93,public From: Janne Sinkkonen Subject: Re: Floating exceptions on Compaq XP1000 ev6 Date: 1999/10/26 Message-ID: #1/1 X-Deja-AN: 540880165 References: Content-Type: text/plain; charset=us-ascii Organization: Clinet, Espoo, Finland. Mime-Version: 1.0 User-Agent: Gnus/5.070097 (Pterodactyl Gnus v0.97) XEmacs/21.1 (20 Minutes to Nikko) Newsgroups: comp.os.linux.alpha NNTP-Posting-User: janne "Carl B. Quillen" writes: > Hi. I'm running Redhat 6.0 with a 2.2.12 kernel on a Compaq XP1000, > and there doesn't seem to be any way to turn off floating point > exceptions. The machine runs by default with them all turned on > (except maybe underflow). Playing around with the osf_getsysinfo() > and osf_setsysinfo() system calls, the machine claims that it is > running int the default IEEE mode (with everything off). But that's > not what happens in practice. I can change the reported state with > osf_setsysinfo(), but not the behavior. > > Anyone know what's going on? I'm in no way an expert in this (experts, please correct me if I'm wrong), but as a person who has 'been there': Maybe the exceptions can be turned off, maybe not, but without exceptions you need to use IEEE floating points, for otherwise you can get silently wrong results. Alpha doesn't directly support IEEE in the sense that an instruction would produce NaN or some such. Instead, kind of software emulation is used. You can turn it on at the compile time, for example with the -mieee option of gcc, but that kills performance (especially with gcc?), because the compiler puts trap instructions here and there, in the worst case after every floating point operation. Each trap waits for the pipelines to become empty. So, IEEE floating points and Alpha really doesn't fit well together. The best option would be to write code which does not generate exceptions, or, if you already has code too cumbersome to modify, compile only the problematic files with IEEE floats turned on. I have a feeling that you can also get floating point exceptions by reading floats from a text file produced by a Pentium (for example). Maybe that's because of the non-normalized floats which have zeros at the beginning of the mantissa (they are too small to be represented in the normalized form. Hopefully this helps, -- Janne