qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: rth7680@gmail.com, Petar Jovanovic <petar.jovanovic@rt-rk.com>,
	qemu-devel@nongnu.org, blauwirbel@gmail.com, petarj@mips.com,
	afaerber@suse.de, aurelien@aurel32.net
Subject: Re: [Qemu-devel] [PATCH v2] target-mips: Fix incorrect shift for SHILO and SHILOV
Date: Wed, 05 Dec 2012 09:51:57 -0600	[thread overview]
Message-ID: <50BF6D9D.2030901@twiddle.net> (raw)
In-Reply-To: <CAFEAcA84izMg3NvzPobYFw7FV2xmBJeizT6PXUscTbPrh4c86g@mail.gmail.com>

On 2012-12-05 09:49, Peter Maydell wrote:
> On 5 December 2012 15:36, Richard Henderson <rth@twiddle.net> wrote:
>> On 2012-12-04 17:29, Petar Jovanovic wrote:
>>>      rs5_0 = (int8_t)(rs5_0 << 2) >> 2;
>>
>> This is more portably written as
>>
>>   rs5_0 = (rs5_0 ^ 0x20) - 0x20;
> 
> ...but way more obscurely. If we want to play that
> kind of game can we have a sign-extension function in
> a header somewhere?

I dunno about more obscurely.  It took me a minute to figure out
what was wanted in the original.

As for a helper function... sure.


r~

  reply	other threads:[~2012-12-05 15:52 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-04 23:29 [Qemu-devel] [PATCH v2] target-mips: Fix incorrect shift for SHILO and SHILOV Petar Jovanovic
2012-12-05 15:36 ` Richard Henderson
2012-12-05 15:49   ` Peter Maydell
2012-12-05 15:51     ` Richard Henderson [this message]
2012-12-05 16:38       ` Peter Maydell
2012-12-05 23:16         ` Richard Henderson
2012-12-06  8:17         ` Aurelien Jarno
2012-12-05 20:41 ` Johnson, Eric
2012-12-05 21:36   ` Johnson, Eric
2012-12-05 23:31     ` Jovanovic, Petar
2012-12-06  0:13       ` Johnson, Eric
2012-12-06  8:11 ` Aurelien Jarno

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=50BF6D9D.2030901@twiddle.net \
    --to=rth@twiddle.net \
    --cc=afaerber@suse.de \
    --cc=aurelien@aurel32.net \
    --cc=blauwirbel@gmail.com \
    --cc=petar.jovanovic@rt-rk.com \
    --cc=petarj@mips.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rth7680@gmail.com \
    /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).