/* Example: sign_extend(9, 3) would return -7 as bit3 of 1001b is 1 and bit0..2 is 001b which when sign extended to 1111111111111001b is -7. */
static s32 sign_extend(u32 oper, int index)
/* Example: sign_extend(9, 3) would return -7 as bit3 of 1001b is 1 and bit0..2 is 001b which when sign extended to 1111111111111001b is -7. */
static s32 sign_extend(u32 oper, int index)
{
	u8 shift = 31 - index;
	return (s32)(oper << shift) >> shift;
}