John C. Femiani a écrit :
> Did you mean to say 'index or pointer'?
Yes of course

> It seems like the trend in image
> processing is to avoid using indexes in the inner loop if at all possible.
Which is a non sensical way of doing stuff cause code using pointer arithmetic and "leet" stuff like *(ptr++ + x*width) makes code hard to decipher and to parallelize afterward.
I wish you a good deal of fun to block a pointer based IP code into SMP or SIMD :/
It's preferable to stick to indexes as it works fine on both side (parallelization and performances).

> Second, the results of the operation were never read, so the compiler
> removed the whole 'Pointers' test.
I always fall into this trap myself even after years ;)

I got similar result on my box too. But now, turn to fortran indexing and it gets worse even with indexes.

Side notes : a better metric than absolute time or cycles is cycle per element as it allows us to detect cache miss and to have performances which can be comapred through various architecture at the metric is independant of most of classic pitfall from other performances measures.