qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 5/x] ppc: Convert op_load_gpr_{T0, T1, T2} to TC


From: Paul Brook
Subject: Re: [Qemu-devel] [PATCH 5/x] ppc: Convert op_load_gpr_{T0, T1, T2} to TCG
Date: Sun, 7 Sep 2008 15:22:31 +0100
User-agent: KMail/1.9.9

> > Can't you use extu_i32_i64 followed by shift and then or? I think you
> > should not use TCGV_HIGH outside tcg directory, it's an implementation
> > detail.
>
> Thanks for the suggestion! You mean like this?
>
> static always_inline void gen_load_gpr64(TCGv t, int reg) {
> #if defined(TARGET_PPC64)
>    tcg_gen_mov_i64(t, cpu_gpr[reg]);
> #else
>    tcg_gen_extu_i32_i64(t, cpu_gprh[reg]);
>    tcg_gen_shli_i64(t, t, 32);
>    TCGv tmp = tcg_temp_local_new(TCG_TYPE_I64);
>    tcg_gen_extu_i32_i64(tmp, cpu_gpr[reg]);
>    tcg_gen_or_i64(t, t, tmp);
>    tcg_temp_free(tmp);
> #endif
> }

It's probably worth making a separate helper function for concatenating two 
32-bit operands into a 64-bit operand so that it can be implemented natively. 
I doubt whether the TCG code is smart enough to DTRT there.

Paul




reply via email to

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