Barcelona optimization guide

By: Rob Thorpe (rthorpe.delete@this.realworldtech.com), May 10, 2007 9:23 am
Room: Moderated Discussions
Linus Torvalds (torvalds@osdl.org) on 5/10/07 wrote:
---------------------------
>mas (mas769@hotmail.com) on 5/10/07 wrote:
>---------------------------
>>http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/40546.pdf
>
>Looks pretty solid from a quick read-through.
>
>My only "oops, that's not nice" moment came with the
>discussion about conditionak branches directly to, and
>immediately preceding, the "ret" instruction. That's a
>fairly common pattern for simple functions with no need
>for a prologue/epilogue.
>
>Yes, those are also prime inlining material, but often
>build/size concerns make that not be a good option.

I don't think they're even always good inlining options. I've written lots of subroutines where the whole body of the routine is a single "if then else" or it ends in one. I expect many of these contain conditional branches to ret.

Still it's not that much of a problem, a code generator should be able to minimize the effect.

>The rest looks like some solid improvements. The stack
>tracking should help, and also means that we can finally
>go back to writing prologues with a sequence of small
>"push" ops instead of that idiotic "do explicit stack
>offsets" crud that just blows up the code size.

Slightly OT question:-
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.

(Also, I wonder if the two things you mention are connected. To make push faster they will have redesigned the way stack related ops work including ret.)
< Previous Post in ThreadNext Post in Thread >
TopicPosted ByDate
Barcelona optimization guidemas2007/05/10 06:43 AM
  Barcelona optimization guideLinus Torvalds2007/05/10 09:00 AM
    Barcelona optimization guideRob Thorpe2007/05/10 09:23 AM
      Barcelona optimization guideLinus Torvalds2007/05/10 09:42 AM
        Barcelona optimization guideRob Thorpe2007/05/11 08:22 AM
          Barcelona optimization guideDavid Kanter2007/05/11 04:17 PM
            Barcelona optimization guideLinus Torvalds2007/05/11 04:30 PM
            Barcelona optimization guideanonymous2007/05/11 10:29 PM
              Barcelona optimization guideanonymous2007/05/12 06:47 AM
              Barcelona optimization guidehobold2007/05/14 04:30 AM
        Barcelona optimization guideAndreas Kaiser2007/05/12 08:32 AM
  Barcelona optimization guideVincent Diepeveen2007/05/13 04:20 AM
    Barcelona optimization guideEduardoS2007/05/13 06:01 AM
      Barcelona optimization guideVincent Diepeveen2007/05/13 08:18 AM
        Barcelona optimization guideMichael S2007/05/13 09:03 AM
        Barcelona optimization guideEduardoS2007/05/13 09:30 AM
        Barcelona optimization guideDresdenboy2007/05/14 07:18 AM
          Barcelona optimization guideVincent Diepeveen2007/05/16 01:36 AM
            Barcelona optimization guideEduardoS2007/05/16 05:57 AM
              Barcelona optimization guideVincent Diepeveen2007/05/16 08:51 AM
        Barcelona optimization guideDavid Kanter2007/05/16 03:13 AM
          Barcelona vs Core2 Vincent Diepeveen2007/05/16 05:35 AM
            Barcelona vs Core2 David Kanter2007/05/16 11:06 AM
            Barcelona vs Core2 EduardoS2007/05/16 11:41 AM
              Barcelona vs Core2 David Kanter2007/05/16 11:53 AM
                Barcelona vs Core2 EduardoS2007/05/16 12:37 PM
                  Barcelona vs Core2 David Kanter2007/05/16 01:43 PM
                    Barcelona vs Core2 EduardoS2007/05/16 03:32 PM
                    Barcelona vs Core2 Gabriele Svelto2007/05/17 05:38 AM
          Barcelona optimization guideanonymous2007/05/16 07:13 PM
            Barcelona optimization guideMichael S2007/05/17 04:26 AM
              Barcelona optimization guideanonymous2007/05/17 05:23 PM
Reply to this Topic
Name:
Email:
Topic:
Body: No Text
How do you spell avocado?