qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: "Jovanovic, Petar" <petarj@mips.com>
Cc: Blue Swirl <blauwirbel@gmail.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"aurelien@aurel32.net" <aurelien@aurel32.net>
Subject: Re: [Qemu-devel] [PATCH] target-mips: Fix incorrect shift for SHILO and SHILOV
Date: Tue, 04 Dec 2012 22:13:28 +0100	[thread overview]
Message-ID: <50BE6778.8090404@suse.de> (raw)
In-Reply-To: <874D219413C17C42B1D2E0432B92BE5CBBE2890C@exchdb03.mips.com>

Am 04.12.2012 20:48, schrieb Jovanovic, Petar:
>> diff --git a/target-mips/dsp_helper.c b/target-mips/dsp_helper.c
>> index e7949c2..f8a7a9f 100644
>> --- a/target-mips/dsp_helper.c
>> +++ b/target-mips/dsp_helper.c
>> @@ -3814,17 +3814,17 @@ void helper_shilo(target_ulong ac, target_ulong rs, CPUMIPSState *env)
>>
>>      rs5_0 = rs & 0x3F;
>>      rs5_0 = (int8_t)(rs5_0 << 2) >> 2;
>> -    rs5_0 = MIPSDSP_ABS(rs5_0);
>> +
>> +    if (rs5_0 == 0)
>> +        return;
> 
>> The check should be moved to translation time so that the call to this
>> helper is not generated at all.
> 
> This case is not likely so generation of unnecessary call is unlikely too.
> Let me know what you think.

FWIW you could use our unlikely() macro then to aid branch prediction.

Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

  parent reply	other threads:[~2012-12-04 21:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-04 14:49 [Qemu-devel] [PATCH] target-mips: Fix incorrect shift for SHILO and SHILOV Petar Jovanovic
2012-12-04 19:00 ` Blue Swirl
2012-12-04 19:43   ` Richard Henderson
2012-12-04 19:52     ` Blue Swirl
2012-12-04 19:48   ` Jovanovic, Petar
2012-12-04 19:54     ` Blue Swirl
2012-12-04 21:13     ` Andreas Färber [this message]
2012-12-04 23:34       ` Jovanovic, Petar

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=50BE6778.8090404@suse.de \
    --to=afaerber@suse.de \
    --cc=aurelien@aurel32.net \
    --cc=blauwirbel@gmail.com \
    --cc=petarj@mips.com \
    --cc=qemu-devel@nongnu.org \
    /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).