Y
Hacker News
new
|
ask
|
show
|
jobs
by
jonsen
479 days ago
A shift is faster than an add.
2 comments
russdill
479 days ago
On 6502 they are both 2 cycles. On the vast majority of processors I'm aware of, "simple" alu operarations don't vary in execution time
link
kragen
479 days ago
On 8086 or ARM you can get a shift "for free" with your add, although on the 8086 you have to use the LEA instruction.
link
ksherlock
479 days ago
ADC #immediate is 2 cycles, as is ASL. Are you really multiplying a constant by 3 at runtime? Probably not. ADC zp is 3 cycles. Plus 2 cycles for the CLC.
link
ForOldHack
479 days ago
The M68020 added a dedicated barrel shifter, which could execute much faster then the M68000.
link