Article View: comp.arch
Article #10554Re: Compilers, architecture, and efficiency
From: Jim Patterson
Date: Thu, 02 May 1991 13:38
Date: Thu, 02 May 1991 13:38
23 lines
1556 bytes
1556 bytes
In article <WK=A6.G@xds13.ferranti.com> peter@ficc.ferranti.com (peter da silva) writes:
>If you want to specify a boolean operation on a float, do the following:
>
> f * 2.0
>
>It's up to the compiler to determine if this multiplication by a constant
>two can be handled by incrementing the exponent or if you have to do a real
>floating multiply (say, for example, that it's m * e ^ 16).
The problem with this is that the compiler rarely has enough
information to determine if it's "safe" to just bump the exponent.
Therefore it's left with the choice of doing a number of runtime
checks (is f equal to zero? Is exponent already at upper limit?), or
just punting and generating the naive "multiply by 2.0" instruction.
I suspect most compilers will do the latter because it's ultimately
more important to get the right answer.
--
Jim Patterson Cognos Incorporated
UUCP:uunet!mitel!cunews!cognos!jimp P.O. BOX 9707
PHONE:(613)738-1440 x6112 3755 Riverside Drive
Ottawa, Ont K1G 3Z4
Technical Details
Message-ID:
<9596@cognos.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!cunews!cognos!jimpReferences:
<1991Apr28.154603.8003@rice.edu> <1991Apr29.155945.29907@rice.edu> <41279@genrad.UUCP> <WK=A6.G@xds13.ferranti.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!cunews!cognos!jimp From: jimp@cognos.UUCP (Jim Patterson) Newsgroups: comp.arch Subject: Re: Compilers, architecture, and efficiency Message-ID: <9596@cognos.UUCP> Date: 2 May 91 13:38:19 GMT References: <1991Apr28.154603.8003@rice.edu> <1991Apr29.155945.29907@rice.edu> <41279@genrad.UUCP> <WK=A6.G@xds13.ferranti.com> Reply-To: jimp@cognos.UUCP (Jim Patterson) Organization: Cognos Inc., Ottawa, Canada Lines: 23