[Mips] Simplify loadImmediate (NFC)
loadImmediate computes ShiftAmount in an unnecessarily complicated
manner. We just need to know the minimum right shift amount to bring
the immediate down to an unsigned 16-bit value, so
unsigned ShiftAmount = llvm::bit_width((uint64_t)ImmValue) - 16;
is sufficient. In other words, the following are all equivalent:
unsigned ShiftAmount = FirstSet - (15 - (LastSet - FirstSet));
unsigned ShiftAmount = llvm::countr_zero(IV) - (15 - (63 - llvm::countl_zero(IV) - llvm::countr_zero(IV)));
unsigned ShiftAmount = llvm::countr_zero(IV) - 15 + (63 - llvm::countl_zero(IV) - llvm::countr_zero(IV));
unsigned ShiftAmount = 48 - llvm::countl_zero(IV);
unsigned ShiftAmount = 64 - llvm::countl_zero(IV) - 16;
unsigned ShiftAmount = llvm::bit_width(IV) - 16;
where IV represents (uint64)ImmValue. I've also checked the
equivalence empirically up to 2u << 32.