Re: programmer optimizations?

cdg@nullstone.com (Christopher Glaeser)
Tue, 31 Jan 1995 18:59:30 GMT

          From comp.compilers

Related articles
[8 earlier articles]
Re: programmer optimizations? kerch@albion.camb.inmet.com (1995-01-12)
Re: programmer optimizations? monnier@di.epfl.ch (Stefan Monnier) (1995-01-21)
Re: programmer optimizations? synaptx!carambole!daveg@uunet.uu.net (Dave Gillespie) (1995-01-11)
Re: programmer optimizations? det@sw.stratus.com (David Toland) (1995-01-11)
Re: programmer optimizations? cdg@nullstone.com (1995-01-23)
Re: programmer optimizations? hbaker@netcom.com (1995-01-27)
Re: programmer optimizations? cdg@nullstone.com (1995-01-31)
Re: programmer optimizations? c1veeru@WATSON.IBM.COM (Virendra K. Mehta) (1995-02-02)
Re: programmer optimizations? hbaker@netcom.com (1995-02-01)
Re: programmer optimizations? bill@amber.ssd.csd.harris.com (1995-02-01)
Re: programmer optimizations? gnb@bby.com.au (1995-02-02)
Re: programmer optimizations? rfg@rahul.net (Ronald F. Guilmette) (1995-02-04)
| List of all articles for this month |

Newsgroups: comp.compilers
From: cdg@nullstone.com (Christopher Glaeser)
Keywords: optimize, design
Organization: Compilers Central
References: 95-01-083
Date: Tue, 31 Jan 1995 18:59:30 GMT

hbaker@netcom.com (Henry Baker) wrote:


> Before everyone gets too upset here, it is quite difficult--in
> general--for a compiler to keep track of whether a number is positive,
> negative or zero.
> When it comes to range information in which one or both ends of the range
> are a run-time variable, the complexity of static analysis skyrockets.


I was referring to the negative constant divisor, not variable dividend.
For example, consider the following expression.


foo / -8


All the power-of-two optimizations I listed in the previous message are
easy to implement (e.g. do not require flow information).


In early releases of Nullstone, we only tested a few combinations of
power-of-two optimizations, thinking that if a compiler optimized
(foo / (1 << 3)), that it probably optimized (foo / (1 << 15)).
Our analysis of twenty compilers on a variety of platforms revealed
that very few compilers generate efficient code for all combinations
of positive/negative signed/unsigned power-of-two multiply/divide/mod.


Regards,
Christopher Glaeser cdg@nullstone.com
Nullstone Corporation


--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.