From: Troy G. <tro...@gm...> - 2010-11-26 17:15:13
|
>From what I can tell, it looks like the objective C instruction might not always be the same when doing a shift right. I posted the following Java code and corresponding Objective C code to illustrate this. In Java the value ends up positive and Objective C negative. I'm not sure if the left shift has this same issue. Thanks again! int k2 = -2147483648; k2 = k2 >>> 1; assertEquals(1073741824, k2); //this passes //objective c generated code int _r34.i = -2147483648; _r34.i = _r34.i >> (0x1f & 1); STAssertEquals(1073741824, _r34.i, @"Should be 1073741824 and not -1073741824"); |