Barcelona optimization guide

By: David Kanter (, May 11, 2007 5:17 pm
Room: Moderated Discussions
Rob Thorpe ( on 5/11/07 wrote:
>Linus Torvalds ( on 5/10/07 wrote:
>>Rob Thorpe ( on 5/10/07 wrote:
>>>Still it's not that much of a problem, a code generator
>>>should be able to minimize the effect.
>>Sure, but the world would be a better place if you didn't
>>have to make uarch-specific optimizations, and could just
>>get code that works well for everybody. It looks like the
>>optimizations for Core 2 and Barcelona are generally going
>>to work well for both, though.

It seems likely to me that this means most folks will ignore the unaligned SSE LD capability in Barcelona as a result. Intel won't be adding that for a while...

>>[ Using push/pop in prologues/epilogues ]
>>>Are you sure that doing it that way has a significant
>>>effect on x86-64 code? Generally what's done is that the
>>>stack pointer is adjusted once then the local variables
>>>are MOVed into place.
>>The optimization explicitly says that using push is now
>>preferable (and that's a change wrt previous AMD rules).
>>And yes, the size difference can be quite noticeable. A
>>push is a single-byte op (two for the regs that need REX),
>>while a "mov to stack" is 5 bytes or more.
>>It adds up. When every single function tends to do several
>>of these things both in the entry and exit path. And since
>>you often have multiple epilogues, it also makes things
>>like short conditional branches less effective.
>>Is it "significant"? I don't think it's a huge issue on its
>>own, but it's a part of making code denser and getting
>>better I$ behaviour. I may be crazy, but I think I$ density
>I think that icache density behaviour matters too, though I >think its only one lever to get good performance overall.

AMD's L1I cache is pretty large to begin with and it's also not clear how much you really get by using stack manipulations versus the alternatives. Is this a 1-2% tweak?

< Previous Post in ThreadNext Post in Thread >
TopicPosted ByDate
Barcelona optimization guidemas2007/05/10 07:43 AM
  Barcelona optimization guideLinus Torvalds2007/05/10 10:00 AM
    Barcelona optimization guideRob Thorpe2007/05/10 10:23 AM
      Barcelona optimization guideLinus Torvalds2007/05/10 10:42 AM
        Barcelona optimization guideRob Thorpe2007/05/11 09:22 AM
          Barcelona optimization guideDavid Kanter2007/05/11 05:17 PM
            Barcelona optimization guideLinus Torvalds2007/05/11 05:30 PM
            Barcelona optimization guideanonymous2007/05/11 11:29 PM
              Barcelona optimization guideanonymous2007/05/12 07:47 AM
              Barcelona optimization guidehobold2007/05/14 05:30 AM
        Barcelona optimization guideAndreas Kaiser2007/05/12 09:32 AM
  Barcelona optimization guideVincent Diepeveen2007/05/13 05:20 AM
    Barcelona optimization guideEduardoS2007/05/13 07:01 AM
      Barcelona optimization guideVincent Diepeveen2007/05/13 09:18 AM
        Barcelona optimization guideMichael S2007/05/13 10:03 AM
        Barcelona optimization guideEduardoS2007/05/13 10:30 AM
        Barcelona optimization guideDresdenboy2007/05/14 08:18 AM
          Barcelona optimization guideVincent Diepeveen2007/05/16 02:36 AM
            Barcelona optimization guideEduardoS2007/05/16 06:57 AM
              Barcelona optimization guideVincent Diepeveen2007/05/16 09:51 AM
        Barcelona optimization guideDavid Kanter2007/05/16 04:13 AM
          Barcelona vs Core2 Vincent Diepeveen2007/05/16 06:35 AM
            Barcelona vs Core2 David Kanter2007/05/16 12:06 PM
            Barcelona vs Core2 EduardoS2007/05/16 12:41 PM
              Barcelona vs Core2 David Kanter2007/05/16 12:53 PM
                Barcelona vs Core2 EduardoS2007/05/16 01:37 PM
                  Barcelona vs Core2 David Kanter2007/05/16 02:43 PM
                    Barcelona vs Core2 EduardoS2007/05/16 04:32 PM
                    Barcelona vs Core2 Gabriele Svelto2007/05/17 06:38 AM
          Barcelona optimization guideanonymous2007/05/16 08:13 PM
            Barcelona optimization guideMichael S2007/05/17 05:26 AM
              Barcelona optimization guideanonymous2007/05/17 06:23 PM
Reply to this Topic
Body: No Text
How do you spell avocado?