flat assembler
Message board for the users of flat assembler.
Index
> Main > add trick |
Author |
|
BOTOKILLER 21 Jul 2011, 13:19
Hi everyone!
Code: add cl, cl Will it work??? |
|||
21 Jul 2011, 13:19 |
|
BOTOKILLER 21 Jul 2011, 13:51
then what will be faster
Code: shl cl, 1 or Code: add cl, cl ??? |
|||
21 Jul 2011, 13:51 |
|
revolution 21 Jul 2011, 14:07
BOTOKILLER wrote: then what will be faster |
|||
21 Jul 2011, 14:07 |
|
revolution 21 Jul 2011, 14:08
Moving to Main.
|
|||
21 Jul 2011, 14:08 |
|
typedef 21 Jul 2011, 14:12
i think
Code: shl cl,1 |
|||
21 Jul 2011, 14:12 |
|
Madis731 22 Jul 2011, 07:03
The correct answer is: they both take the same time on pretty much any architecture and surrounding code, because they are really simple instructions. Not much to optimize there. 1 uop.
The only difference that you can measure is maybe power because shifting in bit logic is a matter of wiring neighbouring bits, but adding needs some fancy xor tricks and ripple carry and what not. So get your gear out and start measuring those precious pW (pico-Watts) you're saving EDIT: Maybe its an order of magnitude bigger (the power saved I mean) |
|||
22 Jul 2011, 07:03 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.