Related articles |
---|
eliminating array bounds checking overhead mayur_naik@my-deja.com (2000-04-26) |
Re: eliminating array bounds checking overhead stephan@pcrm.win.tue.nl (2000-04-27) |
Re: eliminating array bounds checking overhead vugluskr@unicorn.math.spbu.ru (2000-04-27) |
Re: eliminating array bounds checking overhead jprice@scdt.intel.com (2000-04-27) |
Re: eliminating array bounds checking overhead blaak@infomatch.com (Ray Blaak) (2000-04-27) |
Re: eliminating array bounds checking overhead Sid-Ahmed-Ali.TOUATI@inria.fr (Sid Ahmed Ali TOUATI) (2000-04-27) |
Re: eliminating array bounds checking overhead rhyde@shoe-size.com (Randall Hyde) (2000-04-27) |
Re: eliminating array bounds checking overhead nr@labrador.eecs.harvard.edu (2000-04-27) |
Re: eliminating array bounds checking overhead terryg@uswest.net (Terry Greyzck) (2000-04-27) |
Re: eliminating array bounds checking overhead fjscipio@rochester.rr.com (Fred J. Scipione) (2000-04-27) |
Re: eliminating array bounds checking overhead sandeep@ddi.com (Sandeep Dutta) (2000-04-29) |
Re: eliminating array bounds checking overhead tej@melbpc.org.au (Tim Josling) (2000-04-30) |
Re: eliminating array bounds checking overhead markw65@my-deja.com (Mark Williams) (2000-04-30) |
Re: eliminating array bounds checking overhead d95josef@dtek.chalmers.se (2000-04-30) |
[9 later articles] |
From: | nr@labrador.eecs.harvard.edu (Norman Ramsey) |
Newsgroups: | comp.compilers |
Date: | 27 Apr 2000 10:52:26 -0400 |
Organization: | Harvard University |
References: | 00-04-194 |
Keywords: | optimize |
<mayur_naik@my-deja.com> wrote:
>if (i > lo && i < hi)
> printf("%d", A[i]);
>else
> printf("index out of bounds");
>
>... I want to eliminate the overhead of the 2 less-than tests
Bonus trick, which I learned from Andrew Appel:
((unsigned)(i-(lo+1)) < hi)
Beware fencepost errors.
--
Norman Ramsey
http://www.eecs.harvard.edu/~nr
Return to the
comp.compilers page.
Search the
comp.compilers archives again.