qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 1/2] target-m68k: add 64bit mull


From: Laurent Vivier
Subject: Re: [Qemu-devel] [PATCH v2 1/2] target-m68k: add 64bit mull
Date: Mon, 31 Oct 2016 15:21:35 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0


Le 31/10/2016 à 13:48, Richard Henderson a écrit :
> On 10/28/2016 04:01 PM, Laurent Vivier wrote:
>> +    if (ext & 0x400) {
>> +        if (!m68k_feature(s->env, M68K_FEATURE_QUAD_MULDIV)) {
>> +            gen_exception(s, s->pc - 4, EXCP_UNSUPPORTED);
>> +            return;
>> +        }
>> +
>> +        SRC_EA(env, src1, OS_LONG, 0, NULL);
>> +
>> +        if (sign) {
>> +            tcg_gen_muls2_i32(DREG(ext, 12), DREG(ext, 0), src1,
>> DREG(ext, 12));
>> +        } else {
>> +            tcg_gen_mulu2_i32(DREG(ext, 12), DREG(ext, 0), src1,
>> DREG(ext, 12));
>> +        }
> 
> TCG will react badly if Dl == Dh, and thus the two outputs are the same.
> 
> This is undefined in the spec, but guests violating the spec shouldn't
> cause qemu to crash.
> 
> I think you should compute this into N and Z and move the results
> (perhaps in an order matching real hw?) to the data registers afterward.

I'm going to update as you say, and I have checked on a real 68040: it
returns the low word of the result.

Thanks,
Laurent

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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