flat assembler
Message board for the users of flat assembler.
Index
> Main > inc vs add |
Author |
|
revolution 09 Jul 2010, 13:22
b1528932 wrote: what is better? b1528932 wrote: what should i use? b1528932 wrote: inc can be used with lock b1528932 wrote: is there a way to make fasm generate inc/dec using modrm version (in 32bit mode)? |
|||
09 Jul 2010, 13:22 |
|
asmfan 09 Jul 2010, 13:50
"add" can prevent partial flags stall and enhancing reordering
|
|||
09 Jul 2010, 13:50 |
|
revolution 09 Jul 2010, 14:25
asmfan wrote: "add" can prevent partial flags stall and enhancing reordering |
|||
09 Jul 2010, 14:25 |
|
sinsi 09 Jul 2010, 14:39
With a lot of P4's inc or dec reg is slower then add or sub reg,1.
The difference between loop, dec and sub was interesting for code like Code: loop label ;slowest on all intel cpu's dec ecx jnz label ;dec is slow on most P4's sub ecx,1 jnz label ;this was the fastest on P4's Fastest here means clocks, not time, but the differences were all over the place because of the different CPU's used - everything from a P3 to an i7. Sometimes the P3 was faster, go figure. |
|||
09 Jul 2010, 14:39 |
|
LocoDelAssembly 09 Jul 2010, 16:00
revolution wrote:
|
|||
09 Jul 2010, 16:00 |
|
roboman 09 Jul 2010, 16:26
The general rule I try to follow is is when ever the reg inc or dec is getting used in the next command I'll use add because on some cpu's it has to wait for the inc/dec to clear through and you loose some of the optimization built into some of the cpu's. If it's not getting used right away the add/sub are bigger, so I tend to use inc/dec. But what the heck it's all faster then java, c and basic
|
|||
09 Jul 2010, 16:26 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.