[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] Difference between tcg_gen_ld_i64 and tcg_gen_qemu_ld_i
From: |
Bastian Koppelmann |
Subject: |
Re: [Qemu-devel] Difference between tcg_gen_ld_i64 and tcg_gen_qemu_ld_i64. |
Date: |
Sun, 29 Apr 2018 13:18:50 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 |
On 04/29/2018 12:15 PM, Rafael Kioji wrote:
> Dear all,
>
> What is the difference between these two functions? They are located in the
> file
> "tcg/tcg-op.c". Here is their header:
>
> 1. static inline void tcg_gen_ld_i64(TCGv_i64 ret, TCGv_ptr arg2,
> tcg_target_long offset)
This is used to access fields of qemu data structures from generated code, e.g.
CPUArmState.
> 2. void tcg_gen_qemu_ld_i64(TCGv_i64 val, TCGv addr, TCGArg idx,
> TCGMemOp memop)
This actually generates a load to guest memory.
>
> I don't quite understand the need for function (1). Especially because it is
> usually passed "cpu_env" for arg2. Like in target/arm/translate-a64.c:595:
cpu_env is a pointer to CPUArmState.
Cheers,
Bastian