Is there a need for an arithmetic shift left instruction?
No. A logical shift left moves zeros into the low-order bit, which is correct for both signed and unsigned integers.
sra
InstructionMIPS has a shift right arithmetic instruction:
sra d,s,shft # $d <— s shifted right # shft bit positions. # 0 ≤ shft < 31
Sometimes you need to divide by two.
This instruction is faster and
more convenient than the
div
instruction.
Does the sra
instruction
give the correct results for unsigned integers?