News:

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

Main Menu

npad instruction

Started by TouEnMasm, May 07, 2013, 04:32:28 PM

Previous topic - Next topic

jj2007

Quote from: Donkey on May 07, 2013, 06:44:13 PM
Not sure how much NOPs slow down code, most modern processors do not execute them ... they never enter an execution pipe, simply advance R/EIP

Quote from: Donkey on May 08, 2013, 01:30:55 PM
LOL, I really hope you were joking with those timings. The objective in padding with NOP is to make the code AFTER the alignment faster. As I said, the NOPs should never be executed as the prediction algorithm will not load them into the instruction pipe, they are jumped over.

Edgar,
I understand the purpose of nops before a loop, but the timings for varying numbers of nops inside the loop show that execution time is roughly proportional to the number of nops. There is no simple "free" advancing of EIP, at least not on the CPUs tested, sorry...

As to speeding up loops with align 16, see my previous post. It may have been an issue for the P4, though.