summaryrefslogtreecommitdiff
path: root/tcg
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2008-05-12 13:49:14 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2008-05-12 13:49:14 +0000
commit6a8d7b763772691053d1971f29e64b1e296962cf (patch)
tree07972aed4ca3227d02b5545a48086e6cde5f29ab /tcg
parentec95da6cfb636d6ec1e5ecc3e8e4c223749d2d31 (diff)
downloadqemu-6a8d7b763772691053d1971f29e64b1e296962cf.tar.gz
temporary hack to handle register shortage with dyngen for qemu_st64()
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4438 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'tcg')
-rw-r--r--tcg/tcg.c39
-rw-r--r--tcg/tcg.h2
2 files changed, 41 insertions, 0 deletions
diff --git a/tcg/tcg.c b/tcg/tcg.c
index c5a8dafb12..aa46bcf399 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -308,6 +308,45 @@ TCGv tcg_global_reg_new(TCGType type, int reg, const char *name)
return MAKE_TCGV(idx);
}
+#if TCG_TARGET_REG_BITS == 32
+/* temporary hack to avoid register shortage for tcg_qemu_st64() */
+TCGv tcg_global_reg2_new_hack(TCGType type, int reg1, int reg2,
+ const char *name)
+{
+ TCGContext *s = &tcg_ctx;
+ TCGTemp *ts;
+ int idx;
+ char buf[64];
+
+ if (type != TCG_TYPE_I64)
+ tcg_abort();
+ idx = s->nb_globals;
+ tcg_temp_alloc(s, s->nb_globals + 2);
+ ts = &s->temps[s->nb_globals];
+ ts->base_type = type;
+ ts->type = TCG_TYPE_I32;
+ ts->fixed_reg = 1;
+ ts->reg = reg1;
+ ts->val_type = TEMP_VAL_REG;
+ pstrcpy(buf, sizeof(buf), name);
+ pstrcat(buf, sizeof(buf), "_0");
+ ts->name = strdup(buf);
+
+ ts++;
+ ts->base_type = type;
+ ts->type = TCG_TYPE_I32;
+ ts->fixed_reg = 1;
+ ts->reg = reg2;
+ ts->val_type = TEMP_VAL_REG;
+ pstrcpy(buf, sizeof(buf), name);
+ pstrcat(buf, sizeof(buf), "_1");
+ ts->name = strdup(buf);
+
+ s->nb_globals += 2;
+ return MAKE_TCGV(idx);
+}
+#endif
+
TCGv tcg_global_mem_new(TCGType type, int reg, tcg_target_long offset,
const char *name)
{
diff --git a/tcg/tcg.h b/tcg/tcg.h
index 68d8d4420b..66bbe73a4a 100644
--- a/tcg/tcg.h
+++ b/tcg/tcg.h
@@ -267,6 +267,8 @@ void tcg_set_frame(TCGContext *s, int reg,
tcg_target_long start, tcg_target_long size);
void tcg_set_macro_func(TCGContext *s, TCGMacroFunc *func);
TCGv tcg_global_reg_new(TCGType type, int reg, const char *name);
+TCGv tcg_global_reg2_new_hack(TCGType type, int reg1, int reg2,
+ const char *name);
TCGv tcg_global_mem_new(TCGType type, int reg, tcg_target_long offset,
const char *name);
TCGv tcg_temp_new(TCGType type);