qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v2 06/22] target/loongarch: Add main translation routines


From: Richard Henderson
Subject: Re: [PATCH v2 06/22] target/loongarch: Add main translation routines
Date: Mon, 26 Jul 2021 05:35:44 -1000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0

On 7/25/21 11:39 PM, Song Gao wrote:
+void gen_base_offset_addr(TCGv addr, int base, int offset)
+{
+    if (base == 0) {
+        tcg_gen_movi_tl(addr, offset);
+    } else if (offset == 0) {
+        gen_load_gpr(addr, base);
+    } else {
+        tcg_gen_movi_tl(addr, offset);
+        gen_op_addr_add(addr, cpu_gpr[base], addr);
+    }
+}

Using the interfaces I quote above from my riscv cleanup,
this can be tidied to

     tcg_gen_addi_tl(addr, gpr_src(base), offset);


'riscv cleanup' series at 
20210709042608.883256-1-richard.henderson@linaro.org/">https://patchew.org/QEMU/20210709042608.883256-1-richard.henderson@linaro.org/ 
, Right?

Yes.


r~



reply via email to

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