Adapting to a specific processor

downs default_357-line at yahoo.de
Thu May 1 04:10:41 PDT 2008


Manfred Nowak wrote:
> AMD recommends some coding styles like:
> 
> - favor conditional execution instructions over branches
> - make code paths as straight as possible
> - avoid using more than two branches per 16 byte window, in case of
>   poor temporal locality
> - in general, avoid using more than three branches per 16 byte window
> - use far branches only when absolutely necessary
> - limit recursivity to a single call site
> - ensure that for each call a corresponding return exists
> - avoid having code and data mixed up in the same cache line
> - dont use self modifying code
> 
> http://developer.amd.com/media/SWOpt2FetchBranchPred0208.wmv
> [cited 2008/04/30]
> 
> How to achieve this in D?
> 
> -manfred

I think most of this is more relevant to compiler writers than to programmers.

In any case, all but a few of these can't be directly influenced from code. So I guess it comes down to "trust the compiler" ^^

 --downs



More information about the Digitalmars-d mailing list