Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
jonsen
5 months ago
|
parent
|
context
|
favorite
| on:
The Pentium contains a complicated circuit to mult...
A shift is faster than an add.
russdill
5 months ago
|
next
[–]
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
kragen
5 months ago
|
parent
|
next
[–]
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.
ksherlock
5 months ago
|
parent
|
prev
|
next
[–]
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.
ForOldHack
5 months ago
|
prev
[–]
The M68020 added a dedicated barrel shifter, which could execute much faster then the M68000.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: