[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v6 08/16] target-or32: Add instruction tanslatio
From: |
Max Filippov |
Subject: |
Re: [Qemu-devel] [PATCH v6 08/16] target-or32: Add instruction tanslation |
Date: |
Tue, 26 Jun 2012 13:32:57 +0400 |
On Tue, Jun 26, 2012 at 1:14 PM, 陳韋任 (Wei-Ren Chen)
<address@hidden> wrote:
>> > 0xffffffff is -1, 0x80000000 is -MAX.
>> > -1/-MAX ?will raise a exception, and I've handle this.
-1 / -MAX equals 0, it's not the issue here.
>> > -MAX/-1 ?will get a MAX, for max value of a register is -(-MAX)-1, so,
>> > it overflowed, I didn't handle this.
>>
>> Actually you did this with three brcondi in the else branch. The only thing
>> left is not to crash in case guest doesn't want range exception.
>
> So Jia need to do something like below
>
> /*
> * if ((%ra == 0xffffffff || %rb == 0x80000000) && (sr_ove == 0))
Actually the condition that needs special care is
((%rb == 0 || %ra == 0x80000000 && %rb == 0xffffffff) && sr_ove == 0)
> * goto lab3;
> *
> * lab3:
> * compute %ra/%rb but do NOT cause host failed?
This step is empty if the result is undefined, which I think is the case.
> */
> tcg_gen_ori_tl(cpu_sr, cpu_sr, SR_OV);
> tcg_gen_ori_tl(cpu_sr, cpu_sr, SR_CY);
If we get here then the first part of condition (before && sr_ove == 0)
is true.
> tcg_gen_brcondi_tl(TCG_COND_NE, sr_ove, SR_OVE, lab3);
> gen_exception(dc, EXCP_RANGE);
> gen_set_label(lab2);
> tcg_gen_div_tl(cpu_R[rd], cpu_R[ra], cpu_R[rb]);
> gen_set_label(lab3);
>
> ???
??? == just nothing.
--
Thanks.
-- Max
- [Qemu-devel] [PATCH v6 05/16] target-or32: Add exception support, (continued)
- [Qemu-devel] [PATCH v6 05/16] target-or32: Add exception support, Jia Liu, 2012/06/20
- [Qemu-devel] [PATCH v6 06/16] target-or32: Add int instruction helpers, Jia Liu, 2012/06/20
- [Qemu-devel] [PATCH v6 07/16] target-or32: Add float instruction helpers, Jia Liu, 2012/06/20
- [Qemu-devel] [PATCH v6 08/16] target-or32: Add instruction tanslation, Jia Liu, 2012/06/20
- Re: [Qemu-devel] [PATCH v6 08/16] target-or32: Add instruction tanslation, Max Filippov, 2012/06/21
- Re: [Qemu-devel] [PATCH v6 08/16] target-or32: Add instruction tanslation, Jia Liu, 2012/06/24
- Re: [Qemu-devel] [PATCH v6 08/16] target-or32: Add instruction tanslation, Max Filippov, 2012/06/25
- Re: [Qemu-devel] [PATCH v6 08/16] target-or32: Add instruction tanslation, Jia Liu, 2012/06/25
- Re: [Qemu-devel] [PATCH v6 08/16] target-or32: Add instruction tanslation, Max Filippov, 2012/06/26
- Re: [Qemu-devel] [PATCH v6 08/16] target-or32: Add instruction tanslation, Wei-Ren Chen, 2012/06/26
- Re: [Qemu-devel] [PATCH v6 08/16] target-or32: Add instruction tanslation,
Max Filippov <=
[Qemu-devel] [PATCH v6 09/16] target-or32: Add PIC support, Jia Liu, 2012/06/20
[Qemu-devel] [PATCH v6 12/16] target-or32: Add system instructions, Jia Liu, 2012/06/20
[Qemu-devel] [PATCH v6 13/16] target-or32: Add gdb stub, Jia Liu, 2012/06/20
[Qemu-devel] [PATCH v6 14/16] target-or32: Add linux syscall, signal and termbits, Jia Liu, 2012/06/20
[Qemu-devel] [PATCH v6 15/16] target-or32: Add linux user support, Jia Liu, 2012/06/20
[Qemu-devel] [PATCH v6 16/16] target-or32: Add testcases, Jia Liu, 2012/06/20
[Qemu-devel] [PATCH v6 11/16] target-or32: Add a IIS dummy board, Jia Liu, 2012/06/20