Commit 6a8d7b763772691053d1971f29e64b1e296962cf
1 parent
ec95da6c
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
Showing
2 changed files
with
41 additions
and
0 deletions
tcg/tcg.c
@@ -308,6 +308,45 @@ TCGv tcg_global_reg_new(TCGType type, int reg, const char *name) | @@ -308,6 +308,45 @@ TCGv tcg_global_reg_new(TCGType type, int reg, const char *name) | ||
308 | return MAKE_TCGV(idx); | 308 | return MAKE_TCGV(idx); |
309 | } | 309 | } |
310 | 310 | ||
311 | +#if TCG_TARGET_REG_BITS == 32 | ||
312 | +/* temporary hack to avoid register shortage for tcg_qemu_st64() */ | ||
313 | +TCGv tcg_global_reg2_new_hack(TCGType type, int reg1, int reg2, | ||
314 | + const char *name) | ||
315 | +{ | ||
316 | + TCGContext *s = &tcg_ctx; | ||
317 | + TCGTemp *ts; | ||
318 | + int idx; | ||
319 | + char buf[64]; | ||
320 | + | ||
321 | + if (type != TCG_TYPE_I64) | ||
322 | + tcg_abort(); | ||
323 | + idx = s->nb_globals; | ||
324 | + tcg_temp_alloc(s, s->nb_globals + 2); | ||
325 | + ts = &s->temps[s->nb_globals]; | ||
326 | + ts->base_type = type; | ||
327 | + ts->type = TCG_TYPE_I32; | ||
328 | + ts->fixed_reg = 1; | ||
329 | + ts->reg = reg1; | ||
330 | + ts->val_type = TEMP_VAL_REG; | ||
331 | + pstrcpy(buf, sizeof(buf), name); | ||
332 | + pstrcat(buf, sizeof(buf), "_0"); | ||
333 | + ts->name = strdup(buf); | ||
334 | + | ||
335 | + ts++; | ||
336 | + ts->base_type = type; | ||
337 | + ts->type = TCG_TYPE_I32; | ||
338 | + ts->fixed_reg = 1; | ||
339 | + ts->reg = reg2; | ||
340 | + ts->val_type = TEMP_VAL_REG; | ||
341 | + pstrcpy(buf, sizeof(buf), name); | ||
342 | + pstrcat(buf, sizeof(buf), "_1"); | ||
343 | + ts->name = strdup(buf); | ||
344 | + | ||
345 | + s->nb_globals += 2; | ||
346 | + return MAKE_TCGV(idx); | ||
347 | +} | ||
348 | +#endif | ||
349 | + | ||
311 | TCGv tcg_global_mem_new(TCGType type, int reg, tcg_target_long offset, | 350 | TCGv tcg_global_mem_new(TCGType type, int reg, tcg_target_long offset, |
312 | const char *name) | 351 | const char *name) |
313 | { | 352 | { |
tcg/tcg.h
@@ -267,6 +267,8 @@ void tcg_set_frame(TCGContext *s, int reg, | @@ -267,6 +267,8 @@ void tcg_set_frame(TCGContext *s, int reg, | ||
267 | tcg_target_long start, tcg_target_long size); | 267 | tcg_target_long start, tcg_target_long size); |
268 | void tcg_set_macro_func(TCGContext *s, TCGMacroFunc *func); | 268 | void tcg_set_macro_func(TCGContext *s, TCGMacroFunc *func); |
269 | TCGv tcg_global_reg_new(TCGType type, int reg, const char *name); | 269 | TCGv tcg_global_reg_new(TCGType type, int reg, const char *name); |
270 | +TCGv tcg_global_reg2_new_hack(TCGType type, int reg1, int reg2, | ||
271 | + const char *name); | ||
270 | TCGv tcg_global_mem_new(TCGType type, int reg, tcg_target_long offset, | 272 | TCGv tcg_global_mem_new(TCGType type, int reg, tcg_target_long offset, |
271 | const char *name); | 273 | const char *name); |
272 | TCGv tcg_temp_new(TCGType type); | 274 | TCGv tcg_temp_new(TCGType type); |