Author: Bo Persson
Date: 04:41:01 09/28/03
Go up one level in this thread
On September 27, 2003 at 12:26:00, Russell Reagan wrote:
>On September 27, 2003 at 10:32:53, Omid David Tabibi wrote:
>
>>For example, x[0] and x[2] cannot possibly refer to the same
>>memory location, while *p and *q could. It is highly
>>recommended to use the array style, as significant performance
>>advantages can be achieved with most compilers.
>
>First, this seems like a compiler specific issue rather than something that
>should be in the AMD optimization guide, unless AMD has a compiler I don't know
>about.
>
>Second, does this only apply to code that makes use of multiple pointers in the
>same code? For instance, if I loop through an array using a local pointer, but
>don't make use of any other pointers in the same function, there should be no
>pointer conflict. I know that MSVC has an option "assume no aliasing". I've
>never had a speed boost from "assume no aliasing", and I use a single pointer in
>some places, but almost never multiple pointers together.
It only helps in places where the compiler cannot itself determine whether there
is any possible aliasing. This mainly applies for several parameters pointing to
elements of the same type.
void f(int* x, int* y, int* z)
{
*x = 5; // has *y or *z also changed??
Bo Persson
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.