qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 4/6] target/m68k: Optimize get_sr() using deposi


From: Richard Henderson
Subject: Re: [Qemu-devel] [PATCH 4/6] target/m68k: Optimize get_sr() using deposit_i32()
Date: Mon, 11 Mar 2019 07:52:03 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0

On 3/9/19 4:34 PM, Philippe Mathieu-Daudé wrote:
>  static TCGv gen_get_sr(DisasContext *s)
>  {
> -    TCGv ccr;
> -    TCGv sr;
> +    TCGv dest;
>  
> -    ccr = gen_get_ccr(s);
> -    sr = tcg_temp_new();
> -    tcg_gen_andi_i32(sr, QREG_SR, 0xffe0);
> -    tcg_gen_or_i32(sr, sr, ccr);
> -    tcg_temp_free(ccr);
> -    return sr;
> +    dest = gen_get_ccr(s);
> +    tcg_gen_deposit_i32(dest, dest, QREG_SR, 5, 11);
> +    return dest;

Err.. there's no shift of QREG_SR by 5 in the original.
I think you meant

  tcg_gen_deposit_i32(dest, QREG_SR, dest, 0, 5);

But I'd be surprised if QREG_SR even has those bits set,
and we could elide the ANDI entirely, making this just an OR.


r~



reply via email to

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