qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] Difference between tcg_gen_ld_i64 and tcg_gen_qemu_ld_i64.


From: Rafael Kioji
Subject: [Qemu-devel] Difference between tcg_gen_ld_i64 and tcg_gen_qemu_ld_i64.
Date: Sun, 29 Apr 2018 18:15:18 +0800
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0

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)
2. void tcg_gen_qemu_ld_i64(TCGv_i64 val, TCGv addr, TCGArg idx,
   TCGMemOp memop)

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:

/* Convenience accessors for reading and writing single and double
 * FP registers. Writing clears the upper parts of the associated
 * 128 bit vector register, as required by the architecture.
 * Note that unlike the GP register accessors, the values returned
 * by the read functions must be manually freed.
 */
static TCGv_i64 read_fp_dreg(DisasContext *s, int reg)
{
    TCGv_i64 v = tcg_temp_new_i64();

    tcg_gen_ld_i64(v, cpu_env, fp_reg_offset(s, reg, MO_64));
    return v;
}


Thanks!

--
Att.,
Rafael



reply via email to

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