qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Re: [PATCH] Fix extlh instruction on Alpha


From: Andreas Schwab
Subject: [Qemu-devel] Re: [PATCH] Fix extlh instruction on Alpha
Date: Wed, 16 Sep 2009 23:14:17 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Vince Weaver <address@hidden> writes:

> The code is attempting the following:
>
>   tmp1=rb&0x7;
>   tmp1=temp1<<3;
>
>   if (tmp1!=0) {
>      tmp1=64-tmp1;
>      rc=ra<<tmp1;
>   }
>   else {
>      rc=ra;
>   }
>
> The problem with the original code is that in the case of tmp1 being 0,
> the shift left by 64 would result in 0, instead of the identity.
>
> I tried to avoid the jump but couldn't.  Am I missing something?

Instead of tmp1 = 64 - tmp1 use tmp1 = -tmp1 & 0x3f.

Andreas.

-- 
Andreas Schwab, address@hidden
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




reply via email to

[Prev in Thread] Current Thread [Next in Thread]