On 1/25/23 11:09, Alex Bennée wrote:
-static const int tcg_target_call_oarg_regs[2] = {
- TCG_REG_R0, TCG_REG_R1
-};
+
+static TCGReg tcg_target_call_oarg_reg(TCGCallReturnKind kind, int slot)
+{
+ tcg_debug_assert(kind == TCG_CALL_RET_NORMAL);
+ tcg_debug_assert(slot >= 0 && slot <= 3);
+ return TCG_REG_R0 + slot;
+}
So this is now returning allocations of TCG_REG_R0 to TCG_REG_R3?
Yes, should have mentioned in the patch description. Done.
Do we
have to take care to get things right if slot is ever bigger w.r.t.
tcg_target_reg_alloc_order?
No, reg_alloc_order is optimization for call-saved vs call-clobbered vs call arguments.
It should not affect correctness at all. Nor will it ever affect call return -- those
registers die immediately before the call, and become live with these values immediately
after the call.
r~