I know that logical left shift and arithmetic left shift perform the same operation of multiplying the number with 2k when shifted by k bits. In x86-64 ISA, there are two instructions for logical left shift shl
and arithmetic left shift sal
. When both instructions are doing the same job, what is the need of creating second instruction?
Asked
Active
Viewed 430 times
4

Peter Cordes
- 328,167
- 45
- 605
- 847

KRS Nandhan
- 47
- 4