home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.asm.x86      Ahh, the lost art of x86 assembly      4,675 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 3,909 of 4,675   
   James Harris to antispam@nospicedham.math.uni.wroc.   
   Re: Prologue and epilogue   
   12 Jul 19 12:52:19   
   
   From: james.harris.1@nospicedham.gmail.com   
      
   On 12/07/2019 02:15, antispam@nospicedham.math.uni.wroc.pl wrote:   
   > There was recently discussion about speed of various   
   > ways of saving and restoring registers.  I did a little   
   > microbenchmark, saving and restorin 7 registers in   
   > different ways:   
   >   
   > a - save and restore using moves in ascending order   
   > b - save using moves in descending order, restore in ascending order   
   > c - save using pushes, restore using moves in ascending order   
   > d - save and restore using pushes and pops   
      
   ... tests snipped   
      
   > So, at least on modern Intel   
   > processors differences between moves and pushes are very   
   > small.   
   >   
   > Of course this is very naive benchmark and and only covers   
   > two processor types.   
      
   Thanks for posting the info. It's something I would have eventually   
   needed to test.   
      
   Of course, moves take up a lot more code space than pushes and pops so   
   until and unless further info is forthcoming your timings suggest that   
   the use of push/pop where possible appears to be a good rule-of-thumb   
   way to go.   
      
   As for how push and pop would behave in earlier CPU generations, I   
   haven't checked but I suspect the stack adjustments and transfers   
   inherent in those instructions have been carried out in parallel since   
   long, long ago. Maybe Pentium Pro. Maybe Pentium. Maybe 386. Maybe even   
   earlier.   
      
      
   --   
   James Harris   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca