diff options
Diffstat (limited to 'target-ppc/translate.c')
-rw-r--r-- | target-ppc/translate.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/target-ppc/translate.c b/target-ppc/translate.c index a14d197e4..b27863855 100644 --- a/target-ppc/translate.c +++ b/target-ppc/translate.c @@ -6908,8 +6908,8 @@ static always_inline void gen_evmergelo (DisasContext *ctx) tcg_temp_free(t0); tcg_temp_free(t1); #else - tcg_gen_mov_i32(cpu_gpr[rD(ctx->opcode)], cpu_gpr[rB(ctx->opcode)]); tcg_gen_mov_i32(cpu_gprh[rD(ctx->opcode)], cpu_gpr[rA(ctx->opcode)]); + tcg_gen_mov_i32(cpu_gpr[rD(ctx->opcode)], cpu_gpr[rB(ctx->opcode)]); #endif } static always_inline void gen_evmergehilo (DisasContext *ctx) @@ -6946,8 +6946,16 @@ static always_inline void gen_evmergelohi (DisasContext *ctx) tcg_temp_free(t0); tcg_temp_free(t1); #else - tcg_gen_mov_i32(cpu_gpr[rD(ctx->opcode)], cpu_gprh[rB(ctx->opcode)]); - tcg_gen_mov_i32(cpu_gprh[rD(ctx->opcode)], cpu_gpr[rA(ctx->opcode)]); + if (rD(ctx->opcode) == rA(ctx->opcode)) { + TCGv_i32 tmp = tcg_temp_new_i32(); + tcg_gen_mov_i32(tmp, cpu_gpr[rA(ctx->opcode)]); + tcg_gen_mov_i32(cpu_gpr[rD(ctx->opcode)], cpu_gprh[rB(ctx->opcode)]); + tcg_gen_mov_i32(cpu_gprh[rD(ctx->opcode)], tmp); + tcg_temp_free_i32(tmp); + } else { + tcg_gen_mov_i32(cpu_gpr[rD(ctx->opcode)], cpu_gprh[rB(ctx->opcode)]); + tcg_gen_mov_i32(cpu_gprh[rD(ctx->opcode)], cpu_gpr[rA(ctx->opcode)]); + } #endif } static always_inline void gen_evsplati (DisasContext *ctx) |