qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 10/25] target-tricore: Use clz opcode


From: Bastian Koppelmann
Subject: Re: [Qemu-devel] [PATCH 10/25] target-tricore: Use clz opcode
Date: Thu, 17 Nov 2016 15:42:13 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0

On 11/16/2016 08:25 PM, Richard Henderson wrote:
> diff --git a/target-tricore/translate.c b/target-tricore/translate.c
> index 36f734a..69cdfb9 100644
> --- a/target-tricore/translate.c
> +++ b/target-tricore/translate.c
> @@ -6367,7 +6367,8 @@ static void decode_rr_logical_shift(CPUTriCoreState 
> *env, DisasContext *ctx)
>          tcg_gen_andc_tl(cpu_gpr_d[r3], cpu_gpr_d[r1], cpu_gpr_d[r2]);
>          break;
>      case OPC2_32_RR_CLO:
> -        gen_helper_clo(cpu_gpr_d[r3], cpu_gpr_d[r1]);
> +        tcg_gen_not_tl(cpu_gpr_d[r3], cpu_gpr_d[r1]);
> +        tcg_gen_clzi_tl(cpu_gpr_d[r3], cpu_gpr_d[r3], TARGET_LONG_BITS);

This doesn't work for r1 = 0. It returns 0x1f, but should return 0. I
guess the error is not here, but I couldn't figure out where exactly it is.

Cheers,
    Bastian




reply via email to

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