qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Schwab <schwab@linux-m68k.org>
To: Vince Weaver <vince@csl.cornell.edu>
Cc: qemu-devel@nongnu.org, Aurelien Jarno <aurelien@aurel32.net>
Subject: [Qemu-devel] Re: [PATCH] Fix extlh instruction on Alpha
Date: Wed, 16 Sep 2009 23:14:17 +0200	[thread overview]
Message-ID: <m2tyz2iod2.fsf@igel.home> (raw)
In-Reply-To: <20090916163826.M50839@stanley.csl.cornell.edu> (Vince Weaver's message of "Wed, 16 Sep 2009 16:45:20 -0400 (EDT)")

Vince Weaver <vince@csl.cornell.edu> 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, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

      parent reply	other threads:[~2009-09-16 21:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-09 16:08 [Qemu-devel] [PATCH] Fix extlh instruction on Alpha Vince Weaver
2009-09-16 19:52 ` Aurelien Jarno
2009-09-16 20:45   ` Vince Weaver
2009-09-16 20:56     ` Aurelien Jarno
2009-09-17 16:07       ` Vince Weaver
2009-09-17 16:25         ` Laurent Desnogues
2009-09-17 16:35         ` [Qemu-devel] " Andreas Schwab
2009-09-17 17:19         ` [Qemu-devel] " Aurelien Jarno
2009-09-16 21:14     ` Andreas Schwab [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2tyz2iod2.fsf@igel.home \
    --to=schwab@linux-m68k.org \
    --cc=aurelien@aurel32.net \
    --cc=qemu-devel@nongnu.org \
    --cc=vince@csl.cornell.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).