[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] target-mips: fix mipsdsp_trunc16_sat16_round
From: |
Petar Jovanovic |
Subject: |
Re: [Qemu-devel] [PATCH] target-mips: fix mipsdsp_trunc16_sat16_round |
Date: |
Thu, 27 Jun 2013 21:48:19 +0000 |
________________________________________
From: Richard Henderson address@hidden on behalf of Richard Henderson
address@hidden
Sent: Thursday, June 27, 2013 8:20 PM
To: Petar Jovanovic
Cc: Petar Jovanovic; address@hidden; address@hidden
Subject: Re: [Qemu-devel] [PATCH] target-mips: fix mipsdsp_trunc16_sat16_round
On 06/17/2013 03:39 PM, Petar Jovanovic wrote:
> - int64_t temp;
> -
> - temp = (int32_t)a + 0x00008000;
> + uint16_t temp;
>
> - if (a > (int)0x7fff8000) {
> - temp = 0x7FFFFFFF;
> + if (a > 0x7FFF7FFF) {
> + temp = 0x7FFF;
> set_DSPControl_overflow_flag(1, 22, env);
> + } else {
> + temp = ((a + 0x8000) >> 16) & 0xFFFF;
> This doesn't look right either, as it doesn't properly check for overflow of
> negative values.
What overflow of negative values?
Can you please list the values for which the result would not be correct?
Thanks.
Petar