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