News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Succesive Writes vs PUSHes

Started by coder, June 13, 2017, 12:59:16 PM

Previous topic - Next topic

coder

Quote from: jj2007 on June 15, 2017, 06:02:03 PM
QuoteWe 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.