harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aleksey Shipilev" <aleksey.shipi...@gmail.com>
Subject Re: a quick question for signed shift right for long type
Date Thu, 10 Jul 2008 13:04:37 GMT
Xiaoming, a couple of questions:
 1. Is this a reason for ICU-related failure?
 2. Does it reproduce in Java code for you?

I had written the test [1] and run it with HARMONY-5901 onboard:
 $ ../builds/shade.5901/bin/java -Xem:opt testShift
  a = -70
  b = -1

-Xem:opt used to make sure the method is compiled with OPT.
I can't see the failure you mention... Can you describe the steps to reproduce?

Thanks,
Aleksey.

[1]
public class testShift {

public static void main(String[] args) {
	long a = -70;
	long b = a >> 63;

	System.out.println("a = " + a);
	System.out.println("b = " + b);
}

}

On Thu, Jul 10, 2008 at 4:45 PM, xiaoming gu <xiaoming.gu@gmail.com> wrote:
> With H5901-V2.patch, A/16=-5 if A=-70 and A is a long. After checking each
> step, I found the mask
> for a>>63 is not right, which should be 0xffffffffffffffff but is
> 0xffffffff00000001. I tried many ways but couldn't
> find the reason. Thanks for your help.
>
> Xiaoming
>
> On Thu, Jul 10, 2008 at 5:53 PM, Aleksey Shipilev <
> aleksey.shipilev@gmail.com> wrote:
>
>> Hi, Xiaoming!
>>
>> Can you provide the exact test case?
>> It's not obvious what do you try to say.
>>
>> Thanks,
>> Aleksey.
>>
>> On Thu, Jul 10, 2008 at 1:36 PM, xiaoming gu <xiaoming.gu@gmail.com>
>> wrote:
>> > Hi, all. I just got a problem with signed shift right problem.
>> >
>> > long a = 0x8000000000000000;
>> > long b = a>>63; // b is 0xffffffffffffffff
>> >
>> > But if I use SAR to do the signed shift right in harmony internally, b is
>> > 0xffffffff00000001.
>> > I traced the code for a while and couldn't find the difference for the
>> two
>> > ways.
>> >
>> > Any idea? Thanks.
>> >
>> > Xiaoming
>> >
>>
>

Mime
View raw message