From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1094ba,8c7a8a6d3aa8a2fd X-Google-Attributes: gid1094ba,public X-Google-Thread: 111c93,b67c4e519d5d17d9,start X-Google-Attributes: gid111c93,public From: "G. Hugh SONG" Subject: FP interrupt (was Re: Wait on DVF6) Date: 1998/10/27 Message-ID: <713fhi$d1n$1@news.kjist.ac.kr>#1/1 X-Deja-AN: 405426574 Content-Transfer-Encoding: 7bit References: <36351890.3DF6@ipa.net> Content-Type: text/plain; charset=us-ascii Organization: KJIST, KwangJu, KOREA Mime-Version: 1.0 Newsgroups: comp.lang.fortran,comp.os.linux.alpha Donald L. Baker wrote: > Anyone considering buying DEC Visual Fortran 6 to develop numerical > code should wait until DEC publicly demonstrates two things: > 1) That the DVF6 debugger can catch the numerical errors in the > program below and point to the proper line of source code - on > all machine architectures, (DVF5d can't on Alpha) and > 2) Why anyone should be forced to buy an upgrade when other compiler > products have been catching these errors for most of a decade. > > program never > > implicit real*8(a-h,o-z) > > a = 0.d0 > x = dlog(a) > a = -1.d0 > x = a**2.d0 > a = 0.d0 > x = 2.d0/a > > end > > Don Baker > Aquarius Engineering > don.baker@aquarien.com I did some experiment with the first two executable lines which is basically "x = dlog(0.d0) ". Program Never implicit real*8 (a-h,o-z) call FPUSETDEF a = 0.d0 x = dlog(a) stop end Then, the following C routine works as desired with Intel/Linux: /* * Set the floating point control to fault on divide by zero etc... * instead of returning a NaN. This is *not* IEEE compliant but is much * easier to use when debugging. */ #include void fpusetdef_(void) { __setfpucw(0x1372); } However, the above C-routine does not work with Alpha/Linux. Can someone correctly point out the right floating point interrupt address (instead of 0x1372 for Intel)? In /usr/include/fpu_control.h, there is a bunch of important messages which I don't understand. If Steve Lionel cannot help us, then the problem must be some hardware limitation (or design choice) of Alpha. BTW, I think I can understand Don Baker's frustration. Above C-routine for Intel/Linux was provided by David Klein. When I was working with DECstation 3000 running MIPS FORTRAN, a similar C-routine was provided by one of DEC insiders. When DEC released DEC FORTRAN for MIPS, the interrupt handler became unnecessary. With no such tools provided, Alpha/Linux/NT cannot be considered as a machine for numerical code developments, IMHO. So I am using K6-2/Linux and Alpha/Linux side by side. Best regards, -- G. Hugh Song PS: Please remove "Spamspoiler" when replying for spam extractors, FCC Commisioners' email addresses are: wkennard@fcc.gov,sness@fcc.gov,pmisener@fcc.gov,mpowell@fcc.gov