qemu-discuss
[Top][All Lists]
Advanced

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

Re: [Qemu-discuss] Output many return values of some instruction


From: Peter Maydell
Subject: Re: [Qemu-discuss] Output many return values of some instruction
Date: Mon, 1 Dec 2014 09:49:56 +0000

On 1 December 2014 at 02:53,  <address@hidden> wrote:
> Hi, Peter
>    1) cpu_T[2] and cpu_T[3] have been built by me as same as cpu_[0] &1.

Don't do that. Use local temporaries as I have been suggesting.

>    2) tcg_gen_getsec_tl(R_EAX, R_EBX, R_ECX, cpu_T[1]); I tried
> it before, but the result is not my expectation. But if I do
> TCG mov, EAX will get what I want.

Then you should debug it to figure out what is going wrong...

>    3) I know that tcg_out_movi is a function used in the TCG
> backends. And my aim is to finish one instruction on HW
> without the instruction. So I must implement it use some code
> on the backend of QEMU.

No, you are misunderstanding here. The way QEMU works is:

 * frontend code decodes target instructions and converts
   them into generic TCG intermediate operations
 * backend code handles all generic TCG operations and
   writes suitable host code

Your front end needs to write out suitable generic TCG
intermediate code to perform the function your new
guest instruction does. (This might include "call this
function in the frontend at runtime" if the new
instruction is complicated.) There is never any need to
change the backends, because they all can handle the same
set of generic operations. Everything the front end
needs to do can be expressed using those generic ops.

thanks
-- PMM



reply via email to

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