qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC] alpha qemu arithmetic exceptions


From: Richard Henderson
Subject: Re: [Qemu-devel] [RFC] alpha qemu arithmetic exceptions
Date: Thu, 03 Jul 2014 13:19:19 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0

On 07/03/2014 11:25 AM, Al Viro wrote:
> On Thu, Jul 03, 2014 at 07:51:04AM +0100, Al Viro wrote:
> 
>> FWIW, why not just generate
>>      trunc_i64_i32 tmp, va
>>      trunc_i64_i32 tmp2, vb
>>      muls2_i32 tmp2, tmp, tmp, tmp2
>>      ext32s_i64 vc, tmp2
>>      maybe_overflow_32 tmp
>> where maybe_overflow throws IOV unless tmp is 0 or -1?
>> to suffice for mull/v.  mulq/v would be
>>      muls2_i64 vc, tmp, va, vb
>>      maybe_overflow_64 tmp
>> addl/v:
>>      trunc_i64_i32 tmp, va
>>      trunc_i64_i32 tmp2, vb
>>      add2_i32 tmp2, tmp, tmp, zero, tmp2, zero
>>      ext32s_i64 vc, tmp2
>>      maybe_overflow_32 tmp
>> etc.
> 
> Grr...  Wrong check, obviously - we want to check that tmp + MSB(tmp2) is 0.
> Something like
>       setcond_32      tmp2, tmp2, zero, TCG_COND_LT
>       add_i32         tmp, tmp2, tmp
>       call            helper_IOV_if_not_zero tmp
> for 32bit ones and
>       setcond_64      tmp2, vc, zero, TCG_COND_LT
>       add_i64         tmp, tmp2, tmp
>       call            helper_IOV_if_not_zero tmp
> for 64bit ones, or would it be better just to pass both arguments to helper
> and let it deal with the check?  I'm not familiar enough with TCG, sorry...
> 

I believe I have a tidy solution to these /v insns.  New patch set shortly.


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]