private static long roundToLeadBit(long i, int newLeadBit) {
		int amt = leadBit(i) - newLeadBit;
		if (amt == 0) {
			return i;
		}
		if (amt < 0) {
			return i << (-amt);
		}

		// round to nearest even
		long midbitmask = 1L << (amt - 1);
		boolean midset = (i & midbitmask) != 0;
		boolean eps = ((midbitmask - 1) & i) != 0;
		i >>>= amt;
		boolean odd = (i & 1) != 0;
		if (midset && (eps || odd)) {
			i += 1;
		}
		return i;
	}
right shift and round to nearest even or left shift to an integer with lead bit at
newLeadBit.

The final round up might cause a carry that propagates up, so this must be followed by a
test.

@param i integer representation of mantissa 1.xxxxx
@param newLeadBit the bit position we want as a new lead bit
@return integer representing 1.yyyy with a new lead bit position
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/pcode/floatformat/FloatFormat.java