Hi, all. I have two problems now. 1. Round-up problem with division and shift right that "The division operator rounds towards 0, but the right shift operator (>>) rounds towards negative infinity." For example -5/4=-1 but -5>>2=-2.
2. When the divisor is negative, how to deal with the shift operation? It's meaningless to do shift with a number of negative bits. Any comments? Thanks. Xiaoming On Mon, Jul 7, 2008 at 11:57 AM, Xiao-Feng Li <[EMAIL PROTECTED]> wrote: > On Mon, Jul 7, 2008 at 11:31 AM, xiaoming gu <[EMAIL PROTECTED]> > wrote: > > With testing, I find SAR is the "signed shift right" to replace div. So > the > > comments about SAR and SHR in Enc_defs.h are misplaced. > > So I assume you will correct it in your patch. :) > > Thanks, > xiaofeng > > > Xiaoming > > > > On Mon, Jul 7, 2008 at 8:24 AM, xiaoming gu <[EMAIL PROTECTED]> > wrote: > > > >> Hi, everyone. Which one is signed shift right, SAR or SHR? It seems > there > >> are some conflicts between > >> the definitions (in Enc_defs.h) and the usages (in > >> Ia32InstCodeSelector.cpp). Thanks. > >> > >> Xiaoming > >> > >> > >> On Sun, Jul 6, 2008 at 4:47 PM, Egor Pasko <[EMAIL PROTECTED]> > wrote: > >> > >>> On the 0x479 day of Apache Harmony xiaoming gu wrote: > >>> > Aleksey, one question. Is there any easy way to know which binary > >>> > instructions are generated at runtime? Thanks. > >>> > >>> Use command line options [1]. > >>> > >>> I suggest this set: > >>> > >>> -Xem:server_static -XX:jit.p.filter=.main > >>> -XX:jit.p.arg.log=ct,irdump,dotdump > >>> > >>> > >>> [1] http://harmony.apache.org/cmd_options.html > >>> > >>> > >>> > Xiaoming > >>> > > >>> > On Fri, Jul 4, 2008 at 6:17 PM, xiaoming gu <[EMAIL PROTECTED]> > >>> wrote: > >>> > > >>> > > Got it. I'll take the 1st way and the left work is pretty clear. > >>> Thanks. > >>> > > > >>> > > Xiaoming > >>> > > > >>> > > > >>> > > On Fri, Jul 4, 2008 at 6:11 PM, Aleksey Shipilev < > >>> > > [EMAIL PROTECTED]> wrote: > >>> > > > >>> > >> On Fri, Jul 4, 2008 at 2:04 PM, Aleksey Shipilev > >>> > >> <[EMAIL PROTECTED]> wrote: > >>> > >> > do "shl reg,<value>" > >>> > >> Of course, it's "SHIFT RIGHT", so "shr reg, <value>". > >>> > >> > >>> > >> Thanks, > >>> > >> Aleksey. > >>> > >> > >>> > > > >>> > > > >>> > >>> -- > >>> Egor Pasko > >>> > >>> > >> > > > > > > -- > http://xiao-feng.blogspot.com >
