|
From: | Richard Henderson |
Subject: | Re: [PATCH v4 06/36] tcg: Introduce tcg_target_call_oarg_reg |
Date: | Wed, 25 Jan 2023 18:11:45 -1000 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 |
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~
[Prev in Thread] | Current Thread | [Next in Thread] |