[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH for 2.10 23/35] m68k/translate: fix incorrect co
From: |
Laurent Vivier |
Subject: |
Re: [Qemu-devel] [PATCH for 2.10 23/35] m68k/translate: fix incorrect copy/paste |
Date: |
Mon, 24 Jul 2017 21:20:33 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 |
Le 24/07/2017 à 21:19, Philippe Mathieu-Daudé a écrit :
> On 07/24/2017 04:01 PM, Richard Henderson wrote:
>> On 07/24/2017 11:54 AM, Laurent Vivier wrote:
>>> Le 24/07/2017 à 20:27, Philippe Mathieu-Daudé a écrit :
>>>> diff --git a/target/m68k/translate.c b/target/m68k/translate.c
>>>> index ada2a91b64..1a2f421aab 100644
>>>> --- a/target/m68k/translate.c
>>>> +++ b/target/m68k/translate.c
>>>> @@ -1321,7 +1321,8 @@ static void gen_cc_cond(DisasCompare *c,
>>>> DisasContext *s, int cond)
>>>> case 5: /* CS (C) */
>>>> /* Some cases fold C into X. */
>>>> if (op == CC_OP_ADDB || op == CC_OP_ADDW || op ==
>>>> CC_OP_ADDL ||
>>>> - op == CC_OP_ADDB || op == CC_OP_ADDW || op ==
>>>> CC_OP_ADDL) {
>>>> + op == CC_OP_SUBB || op == CC_OP_SUBW || op ==
>>>> CC_OP_SUBL ||
>>>> + op == CC_OP_LOGIC) {
>>>
>>> According to commit (db3d7945) introducing the incorrect copy/paste, I
>>> don't think we need the CC_OP_LOGIC here. Logic operations never
>>> generates X flags (whereas they can generate Z and and N).
>>
>> Indeed, look at the comment below. LOGIC is supposed to fall through
>> to the code that produces TCG_COND_NEVER.
>
> Indeed I also miss-copypasted :)
>
> So the correct fix would be:?
>
> if (op == CC_OP_ADDB || op == CC_OP_ADDW || op == CC_OP_ADDL ||
> - op == CC_OP_ADDB || op == CC_OP_ADDW || op == CC_OP_ADDL) {
> + op == CC_OP_SUBB || op == CC_OP_SUBW || op == CC_OP_SUBL) {
yes
Reviewed-by: Laurent Vivier <address@hidden>
Laurent
- Re: [Qemu-devel] [PATCH for 2.10 21/35] arm/sysbus-fdt: fix null pointer dereference, (continued)
- [Qemu-devel] [PATCH for 2.10 22/35] arm/vexpress: fix potential memory leak, Philippe Mathieu-Daudé, 2017/07/24
- [Qemu-devel] [PATCH for 2.10 23/35] m68k/translate: fix incorrect copy/paste, Philippe Mathieu-Daudé, 2017/07/24
- [Qemu-devel] [PATCH for 2.10 24/35] linux-user/sh4: fix incorrect memory write, Philippe Mathieu-Daudé, 2017/07/24
- [Qemu-devel] [PATCH for 2.10 25/35] linux-user: extract is_error() out of syscall.c, Philippe Mathieu-Daudé, 2017/07/24
- [Qemu-devel] [PATCH for 2.10 26/35] linux-user: use is_error() to avoid warnings and make the code clearer, Philippe Mathieu-Daudé, 2017/07/24
- [Qemu-devel] [PATCH for 2.10 27/35] syscall: fix dereference of undefined pointer, Philippe Mathieu-Daudé, 2017/07/24