mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 17:53:56 -06:00
tcg: Reorg function calls
Pre-compute the function call layout for each helper at startup. Drop TCG_CALL_DUMMY_ARG, as we no longer need to leave gaps in the op->args[] array. This allows several places to stop checking for NULL TCGTemp, to which TCG_CALL_DUMMY_ARG mapped. For tcg_gen_callN, loop over the arguments once. Allocate the TCGOp for the call early but delay emitting it, collecting arguments first. This allows the argument processing loop to emit code for extensions and have them sequenced before the call. For tcg_reg_alloc_call, loop over the arguments in reverse order, which allows stack slots to be filled first naturally. Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
31fd884b2e
commit
39004a71d8
5 changed files with 394 additions and 250 deletions
|
@ -42,11 +42,29 @@ typedef enum {
|
|||
TCG_CALL_ARG_EXTEND_S, /* ... as a sign-extended i64 */
|
||||
} TCGCallArgumentKind;
|
||||
|
||||
typedef struct TCGCallArgumentLoc {
|
||||
TCGCallArgumentKind kind : 8;
|
||||
unsigned arg_slot : 8;
|
||||
unsigned ref_slot : 8;
|
||||
unsigned arg_idx : 4;
|
||||
unsigned tmp_subindex : 2;
|
||||
} TCGCallArgumentLoc;
|
||||
|
||||
/* Avoid "unsigned < 0 is always false" Werror, when iarg_regs is empty. */
|
||||
#define REG_P(L) \
|
||||
((int)(L)->arg_slot < (int)ARRAY_SIZE(tcg_target_call_iarg_regs))
|
||||
|
||||
typedef struct TCGHelperInfo {
|
||||
void *func;
|
||||
const char *name;
|
||||
unsigned flags;
|
||||
unsigned typemask;
|
||||
unsigned typemask : 32;
|
||||
unsigned flags : 8;
|
||||
unsigned nr_in : 8;
|
||||
unsigned nr_out : 8;
|
||||
TCGCallReturnKind out_kind : 8;
|
||||
|
||||
/* Maximum physical arguments are constrained by TCG_TYPE_I128. */
|
||||
TCGCallArgumentLoc in[MAX_CALL_IARGS * (128 / TCG_TARGET_REG_BITS)];
|
||||
} TCGHelperInfo;
|
||||
|
||||
extern TCGContext tcg_init_ctx;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue