From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <3805F385.FFA2BEFB@mit.edu> Date: Thu, 14 Oct 1999 11:15:18 -0400 From: Adam C Powell IV Subject: Re: binary optimization In-Reply-To: <199909271336.JAA0000003130@amt174.lkg.dec.com> Richard Gorton wrote: > >Suppose I'd like to build one binary which runs optimally on every > >Alpha. Okay, that's too tall an order, how about the tightest loops, > >the most time-consuming subroutines having versions compiled for > >multiple processors. > > A very tall order, indeed. Especially since there are different > sized caches on different machines. For example, it is possible > to get a PWS500a with 0, 1, or 2 Mb of cache (off-chip). > So far as I know, the only way to currently determine the off-chip > cache size is to run some code which attempts to figure it out > based upon the timing of memory traffic. Interesting, /proc/cpuinfo has cache sizes on PPC and x86, so I thought it did on Alpha, but it doesn't. So there's no way to get this at all? Oh well. > I would recommend building different versions for the relevant > chip generations (one for ev56, one for ev6) to handle architectural > differences (sqrt, ftoi, itof, etc.) until someone ships a > dynamic binary optimization system. But this is the kind of thing my primitive scheme would allow. You have multiple symbols for a given routine, each compiled for a different chip generation, and (following esci's suggestion) index to a function pointer table at runtime to choose between them. > See (shameless plug): > http://rob.millbury.net/~wlug/slides.html > The september '99 talk on "Wiggins/Redstone" > > for an overview of the kind of things that a dynamic optimization > system has to worry about, opportunities, etc. Another dynamic > optimization effort is HP's Dynamo project: > > http://www.hpl.hp.com/techreports/1999/HPL-1999-77.pdf > http://www.hpl.hp.com/techreports/1999/HPL-1999-78.pdf Wow! These are way more advanced than what I was looking for. Thanks for the pointers to the latest and greatest! I think for now I'll just use this compile-time optimization for multiple generations with runtime selection, and wait for these runtime optimization schemes to bear fruit before building for them. Thanks, -Adam P.