qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] target-xtensa: fix search_pc for the last TB op


From: Max Filippov
Subject: Re: [Qemu-devel] [PATCH] target-xtensa: fix search_pc for the last TB opcode
Date: Wed, 19 Dec 2012 22:49:13 +0300

On Wed, Dec 19, 2012 at 11:45 PM, Blue Swirl <address@hidden> wrote:
> On Tue, Dec 18, 2012 at 7:21 AM, Max Filippov <address@hidden> wrote:
>> Zero out tcg_ctx.gen_opc_instr_start for instructions representing the
>> last guest opcode in the TB.
>>
>> Cc: address@hidden
>> Signed-off-by: Max Filippov <address@hidden>
>> ---
>>  target-xtensa/translate.c |    8 +++++++-
>>  1 files changed, 7 insertions(+), 1 deletions(-)
>>
>> diff --git a/target-xtensa/translate.c b/target-xtensa/translate.c
>> index 5d8762c..d109a08 100644
>> --- a/target-xtensa/translate.c
>> +++ b/target-xtensa/translate.c
>> @@ -3005,7 +3005,13 @@ static void gen_intermediate_code_internal(
>>      gen_icount_end(tb, insn_count);
>>      *tcg_ctx.gen_opc_ptr = INDEX_op_end;
>>
>> -    if (!search_pc) {
>> +    if (search_pc) {
>> +        j = tcg_ctx.gen_opc_ptr - tcg_ctx.gen_opc_buf;
>> +        lj++;
>> +        while (lj <= j) {
>> +            tcg_ctx.gen_opc_instr_start[lj++] = 0;
>> +        }
>
> Instead of the loop, how about something like
> memset(&tcg_ctx.gen_opc_instr_start[lj], 0, j - lj)?

Off by one, j - lj + 1.
Wanted to keep it looking as other instances, but can do it this way too.

>> +    } else {
>>          tb->size = dc.pc - pc_start;
>>          tb->icount = insn_count;
>>      }
>> --
>> 1.7.7.6
>>



-- 
Thanks.
-- Max



reply via email to

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