Hi Richard,

On 9/23/21 02:39, Richard Henderson wrote:
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.

Hmm, I think I'll have to look into this, but not now (it's again 3 am here)... I'll try to come up with something tomorrow.

r~

Reply via email to