Author Topic: Succesive Writes vs PUSHes  (Read 16400 times)


  • Member
  • **
  • Posts: 95
Re: Succesive Writes vs PUSHes
« Reply #30 on: June 15, 2017, 06:18:01 PM »
We are talking about stack in much more general sense, not specific or selected processors. Whether a processor implements a dedicated circuitry to make certain instructions fast (like rep movsd), is really not my concern at this moment.

Thank you, that explains it all, of course. And why do our results show that push/pop and mov are equally fast?
Codes are not equal. Your modified test code is more complicated and too high-level than it should. When I asked for help with confirmation, I meant the codes should be in equal settings, running on different CPUs, or else the results are invalid. Secondly, certain processors do apply special implementations when dealing with the stack, for example LSD (look it up), stack engines etc. The purpose however is not to make it fast, but to make it rather on par with simple RISC-based instructions. Your results are showing all that - pound-for-pound, a 1 byte PUSH is having some difficulties in catching up with multiple bytes MOV.