|
@@ -151,6 +151,7 @@ static bool tcg_out_sti(TCGContext *s, TCGType type, TCGArg val,
|
|
TCGReg base, intptr_t ofs);
|
|
TCGReg base, intptr_t ofs);
|
|
static void tcg_out_call(TCGContext *s, const tcg_insn_unit *target,
|
|
static void tcg_out_call(TCGContext *s, const tcg_insn_unit *target,
|
|
const TCGHelperInfo *info);
|
|
const TCGHelperInfo *info);
|
|
|
|
+static TCGReg tcg_target_call_oarg_reg(TCGCallReturnKind kind, int slot);
|
|
static bool tcg_target_const_match(int64_t val, TCGType type, int ct);
|
|
static bool tcg_target_const_match(int64_t val, TCGType type, int ct);
|
|
#ifdef TCG_TARGET_NEED_LDST_LABELS
|
|
#ifdef TCG_TARGET_NEED_LDST_LABELS
|
|
static int tcg_out_ldst_finalize(TCGContext *s);
|
|
static int tcg_out_ldst_finalize(TCGContext *s);
|
|
@@ -740,14 +741,16 @@ static void init_call_layout(TCGHelperInfo *info)
|
|
case dh_typecode_s64:
|
|
case dh_typecode_s64:
|
|
info->nr_out = 64 / TCG_TARGET_REG_BITS;
|
|
info->nr_out = 64 / TCG_TARGET_REG_BITS;
|
|
info->out_kind = TCG_CALL_RET_NORMAL;
|
|
info->out_kind = TCG_CALL_RET_NORMAL;
|
|
- assert(info->nr_out <= ARRAY_SIZE(tcg_target_call_oarg_regs));
|
|
|
|
|
|
+ /* Query the last register now to trigger any assert early. */
|
|
|
|
+ tcg_target_call_oarg_reg(info->out_kind, info->nr_out - 1);
|
|
break;
|
|
break;
|
|
case dh_typecode_i128:
|
|
case dh_typecode_i128:
|
|
info->nr_out = 128 / TCG_TARGET_REG_BITS;
|
|
info->nr_out = 128 / TCG_TARGET_REG_BITS;
|
|
info->out_kind = TCG_CALL_RET_NORMAL; /* TODO */
|
|
info->out_kind = TCG_CALL_RET_NORMAL; /* TODO */
|
|
switch (/* TODO */ TCG_CALL_RET_NORMAL) {
|
|
switch (/* TODO */ TCG_CALL_RET_NORMAL) {
|
|
case TCG_CALL_RET_NORMAL:
|
|
case TCG_CALL_RET_NORMAL:
|
|
- assert(info->nr_out <= ARRAY_SIZE(tcg_target_call_oarg_regs));
|
|
|
|
|
|
+ /* Query the last register now to trigger any assert early. */
|
|
|
|
+ tcg_target_call_oarg_reg(info->out_kind, info->nr_out - 1);
|
|
break;
|
|
break;
|
|
case TCG_CALL_RET_BY_REF:
|
|
case TCG_CALL_RET_BY_REF:
|
|
/*
|
|
/*
|
|
@@ -4592,7 +4595,7 @@ static void tcg_reg_alloc_call(TCGContext *s, TCGOp *op)
|
|
case TCG_CALL_RET_NORMAL:
|
|
case TCG_CALL_RET_NORMAL:
|
|
for (i = 0; i < nb_oargs; i++) {
|
|
for (i = 0; i < nb_oargs; i++) {
|
|
TCGTemp *ts = arg_temp(op->args[i]);
|
|
TCGTemp *ts = arg_temp(op->args[i]);
|
|
- TCGReg reg = tcg_target_call_oarg_regs[i];
|
|
|
|
|
|
+ TCGReg reg = tcg_target_call_oarg_reg(TCG_CALL_RET_NORMAL, i);
|
|
|
|
|
|
/* ENV should not be modified. */
|
|
/* ENV should not be modified. */
|
|
tcg_debug_assert(!temp_readonly(ts));
|
|
tcg_debug_assert(!temp_readonly(ts));
|