From 65a649dec03b0439fc504200531a4a5911f4404d Mon Sep 17 00:00:00 2001 From: farmdve Date: Tue, 17 Nov 2015 18:34:38 +0200 Subject: [PATCH] Fix issue #269 Patch from here http://lists.nongnu.org/archive/html/qemu-devel/2015-11/msg03848.html Also fix another potential issue with constants from https://github.com/qemu/qemu/commit/bbeb82395eaca0e3c38b433b2d2a5bad4a5fbd81#diff-9e0011b4d4a5890b309421630e6d86c3 --- qemu/target-i386/translate.c | 6 ++++-- qemu/tcg/tcg.c | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/qemu/target-i386/translate.c b/qemu/target-i386/translate.c index 2e7a822e..f644b4fa 100644 --- a/qemu/target-i386/translate.c +++ b/qemu/target-i386/translate.c @@ -4155,8 +4155,10 @@ static void gen_sse(CPUX86State *env, DisasContext *s, int b, break; #ifdef TARGET_X86_64 case MO_64: - tcg_gen_mulu2_i64(tcg_ctx, *cpu_regs[s->vex_v], *cpu_regs[reg], - *cpu_T[0], *cpu_regs[R_EDX]); + tcg_gen_mulu2_i64(tcg_ctx, *cpu_T[0], *cpu_T[1], + *cpu_T[0], *cpu_regs[R_EDX]); + tcg_gen_mov_i64(tcg_ctx, *cpu_regs[s->vex_v], *cpu_T[0]); + tcg_gen_mov_i64(tcg_ctx, *cpu_regs[reg], *cpu_T[1]); break; #endif } diff --git a/qemu/tcg/tcg.c b/qemu/tcg/tcg.c index 381fde94..abdcb9e4 100644 --- a/qemu/tcg/tcg.c +++ b/qemu/tcg/tcg.c @@ -2053,6 +2053,7 @@ static void tcg_reg_alloc_mov(TCGContext *s, const TCGOpDef *def, ts->mem_coherent = 1; } else if (ts->val_type == TEMP_VAL_CONST) { tcg_out_movi(s, itype, ts->reg, ts->val); + ts->mem_coherent = 0; } s->reg_to_temp[ts->reg] = args[1]; ts->val_type = TEMP_VAL_REG;