[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] target-mips: Fix incorrect shift for SHILO and
From: |
Andreas Färber |
Subject: |
Re: [Qemu-devel] [PATCH] target-mips: Fix incorrect shift for SHILO and SHILOV |
Date: |
Tue, 04 Dec 2012 22:13:28 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 |
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