aboutsummaryrefslogtreecommitdiff
path: root/tcg
diff options
context:
space:
mode:
authorAurelien Jarno <aurelien@aurel32.net>2009-09-29 17:00:28 +0200
committerAurelien Jarno <aurelien@aurel32.net>2009-09-30 14:10:34 +0200
commit6692b043198d58a12317009edb98654c6839f043 (patch)
tree30eade0e1961fe672a35a1bc09f6f78e3be03fee /tcg
parenttarget-ppc: log instructions start in TCG code (diff)
downloadqemu-kvm-6692b043198d58a12317009edb98654c6839f043.tar.gz
qemu-kvm-6692b043198d58a12317009edb98654c6839f043.tar.bz2
qemu-kvm-6692b043198d58a12317009edb98654c6839f043.zip
TCG: fix DEF2 macro
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Diffstat (limited to 'tcg')
-rw-r--r--tcg/tcg.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/tcg/tcg.c b/tcg/tcg.c
index 93066e249..73a649ac8 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -67,7 +67,7 @@ static void patch_reloc(uint8_t *code_ptr, int type,
static TCGOpDef tcg_op_defs[] = {
#define DEF(s, n, copy_size) { #s, 0, 0, n, n, 0, copy_size },
-#define DEF2(s, iargs, oargs, cargs, flags) { #s, iargs, oargs, cargs, iargs + oargs + cargs, flags, 0 },
+#define DEF2(s, oargs, iargs, cargs, flags) { #s, oargs, iargs, cargs, iargs + oargs + cargs, flags, 0 },
#include "tcg-opc.h"
#undef DEF
#undef DEF2
@@ -1385,12 +1385,16 @@ static void temp_save(TCGContext *s, int temp, TCGRegSet allocated_regs)
ts->val_type = TEMP_VAL_MEM;
break;
case TEMP_VAL_CONST:
- reg = tcg_reg_alloc(s, tcg_target_available_regs[ts->type],
- allocated_regs);
if (!ts->mem_allocated)
temp_allocate_frame(s, temp);
- tcg_out_movi(s, ts->type, reg, ts->val);
- tcg_out_st(s, ts->type, reg, ts->mem_reg, ts->mem_offset);
+ if (ts->type == TCG_TYPE_I32) {
+ tcg_out_sti(s, ts->type, ts->val, ts->mem_reg, ts->mem_offset);
+ } else {
+ reg = tcg_reg_alloc(s, tcg_target_available_regs[ts->type],
+ allocated_regs);
+ tcg_out_movi(s, ts->type, reg, ts->val);
+ tcg_out_st(s, ts->type, reg, ts->mem_reg, ts->mem_offset);
+ }
ts->val_type = TEMP_VAL_MEM;
break;
case TEMP_VAL_MEM: