Hi Petar, On Mon, Oct 29, 2012 at 9:40 PM, Jovanovic, Petar <pet...@mips.com> wrote: > Hi Jia, > >> imm = (int16_t)(imm << 6) >> 6; > > result of a bitwise shift of a signed type and a negative vlaue is > implementation-defined, so you can not rely on that. >
I think it will take a 10bits signed value sign extend into 16bits signed value, and I've tested it with negative values, it working well. > Regards, > Petar Regards, Jia.