qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v3 09/30] tcg/loongarch64: Implement tcg_out_mov and tcg_out_


From: Richard Henderson
Subject: Re: [PATCH v3 09/30] tcg/loongarch64: Implement tcg_out_mov and tcg_out_movi
Date: Wed, 22 Sep 2021 11:39:56 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0

On 9/22/21 11:09 AM, WANG Xuerui wrote:
+    if (pc_offset == (int32_t)pc_offset) {
+        tcg_target_long lo = sextreg(pc_offset, 0, 12);
+        tcg_target_long hi = pc_offset - lo;
+        tcg_out_opc_pcaddu12i(s, rd, hi >> 12);
+        tcg_out_opc_addi_d(s, rd, rd, lo);

pc_offset = 0x7ffff800 will fail:

lo = 0xfffffffffffff800
hi = 0x0000000080000000

but hi will be interpreted as negative by pcaddu12i.

This is the same problem I pointed out with tcg_out_call, but with different 
constants.


r~



reply via email to

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