Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!ll-xn!cit-vax!mangler From: mangler@cit-vax.Caltech.Edu (System Mangler) Newsgroups: comp.unix.wizards,comp.arch Subject: Re: brk's zero-fill behavior on VAXen (useful undefined checks) Message-ID: <1185@cit-vax.Caltech.Edu> Date: Sat, 15-Nov-86 04:28:01 EST Article-I.D.: cit-vax.1185 Posted: Sat Nov 15 04:28:01 1986 Date-Received: Sat, 15-Nov-86 23:53:30 EST References: <7208@elsie.UUCP> <5142@brl-smoke.ARPA> <2447@hcr.UUCP> <160@haddock.UUCP> Organization: California Institute of Technology Lines: 12 Summary: MOVD checks for NaN Xref: mnetor comp.unix.wizards:72 comp.arch:21 In article <160@haddock.UUCP>, karl@haddock.UUCP (Karl Heuer) writes: > P.S. I like the way VAXen do this with floating point (the result of some > operation is NaN, which triggers an FPE on the *next* usage, giving the user > a chance to test for it first). I inherited an interpreter that uses this trick. Checking for a NaN was done by a call-by-reference assembly language routine; when I rewrote it as a call-by-value C routine, I got floating point exceptions. Why? The MOVD instruction that pushes the value on the stack will raise an FPE if asked to push a NaN! You have to be very careful how you look at those... Don Speck speck@vlsi.caltech.edu {seismo,rutgers,ames}!cit-vax!speck