Related articles |
---|
Q: division vs multiplication t.hulek@imperial.ac.uk (1995-03-24) |
Re: Q: division vs multiplication kptben@aol.com (1995-04-02) |
Re: Q: division vs multiplication Terje.Mathisen@hda.hydro.com (1995-04-02) |
Re: Q: division vs multiplication mikeq@primenet.com (1995-04-02) |
Re: Q: division vs multiplication hbaker@netcom.com (1995-04-03) |
Re: Q: division vs multiplication davidm@Rational.COM (1995-04-03) |
Re: Q: division vs multiplication brandis@inf.ethz.ch (1995-04-04) |
Re: Q: division vs multiplication Terje.Mathisen@hda.hydro.com (1995-04-06) |
Re: Q: division vs multiplication meissner@cygnus.com (Mike Meissner) (1995-04-16) |
Re: Q: division vs multiplication martens@cis.ohio-state.edu (1995-04-16) |
Re: Q: division vs multiplication jmccarty@spdmail.spd.dsccc.com (1995-04-18) |
[8 later articles] |
Newsgroups: | comp.compilers |
From: | hbaker@netcom.com (Henry Baker) |
Keywords: | arithmetic, optimize |
Organization: | nil |
References: | 95-04-003 |
Date: | Mon, 3 Apr 1995 20:12:08 GMT |
t.hulek@imperial.ac.uk (Mr Tomas Hulek) wrote:
[Can one optimize floating division by powers of two into something like a
shift?]
The problem isn't in the compiler optimization phase, but in the compiler
input phase. There are some compiler input phases that don't properly
read decimal constants, resulting in mangled constants. If you contact
the compiler vendor, they usually don't consider that a 'bug'. However,
if you provide an _integer_ and the compiler input phase mangles it, then
you can usually convince the compiler vendor to fix it.
For this reason, I have found a/1048576 to be more robust/portable than
multiplying by its inverse.
Sigh.....
(See also ftp://ftp.netcom.com/pub/hb/hbaker/AB-mod-N.html (also .ps.Z))
--
www/ftp directory:
ftp://ftp.netcom.com/pub/hb/hbaker/home.html
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.