public static long signExtend(long val, int bit) {
		long mask = 0;
		mask = (~mask) << bit;
		if (((val >> bit) & 1) != 0) {
			val |= mask;
		}
		else {
			val &= (~mask);
		}
		return val;
	}
Sign extend -val- above -bit-
@param val     value to extend
@param bit     bit specifying sign
@return the extended value
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/app/plugin/processors/sleigh/expression/TokenField.java