|
Archives
D Programming
DD.gnu digitalmars.D digitalmars.D.bugs digitalmars.D.dtl digitalmars.D.ide digitalmars.D.dwt digitalmars.D.announce digitalmars.D.learn digitalmars.D.debugger C/C++ Programming
c++c++.announce c++.atl c++.beta c++.chat c++.command-line c++.dos c++.dos.16-bits c++.dos.32-bits c++.idde c++.mfc c++.rtl c++.stl c++.stl.hp c++.stl.port c++.stl.sgi c++.stlsoft c++.windows c++.windows.16-bits c++.windows.32-bits c++.wxwindows digitalmars.empire digitalmars.DMDScript electronics |
digitalmars.D - Adapting to a specific processor
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 May 01 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 May 01 2008
Manfred Nowak Wrote:AMD recommends some coding styles like: - make code paths as straight as possible - in general, avoid using more than three branches per 16 byte window - limit recursivity to a single call site May 02 2008
downs wrote:I think most of this is more relevant to compiler writers than to programmers. May 04 2008
Manfred Nowak Wrote:One might be able to notice the contradiction and please notice that AMD writes in Chapter 2.2: | Source-code transformations interact with a compiler’s code | generator, making it difficult to control the generated machine | code from the source level. May 07 2008
|