From: Arno P. <ar...@pu...> - 2010-11-26 18:10:09
|
you are right. There is a cast to an unsigned int missing for the ushr instruction. Should be fixed now. Arno On 11/26/10 9:50 AM, Troy Gaines wrote: > After further looking, it seems like the following would work for the > corresponding unsigned shift right >>> in Java to Objective C. > > int k = (unsigned) k >> (0x1f & 1); > > > > > On Fri, Nov 26, 2010 at 11:14 AM, Troy Gaines <tro...@gm... > <mailto:tro...@gm...>> wrote: > > 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"); > > > > > ------------------------------------------------------------------------------ > Increase Visibility of Your 3D Game App& Earn a Chance To Win $500! > Tap into the largest installed PC base& get more eyes on your game by > optimizing for Intel(R) Graphics Technology. Get started today with the > Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. > http://p.sf.net/sfu/intelisp-dev2dev > > > > _______________________________________________ > xmlvm-users mailing list > xml...@li... > https://lists.sourceforge.net/lists/listinfo/xmlvm-users |