From 6bb72b184d7fe0e1e08f9cca722e78d1d24920c2 Mon Sep 17 00:00:00 2001 From: Aurelien Jarno Date: Mon, 4 May 2009 09:54:57 +0200 Subject: [PATCH] target-mips: proper sign extension for 'SUBU rd, zero, rt' Signed-off-by: Aurelien Jarno --- target-mips/translate.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target-mips/translate.c b/target-mips/translate.c index 2c163e0ca4..7ecc9fdaf3 100644 --- a/target-mips/translate.c +++ b/target-mips/translate.c @@ -1604,6 +1604,7 @@ static void gen_arith (CPUState *env, DisasContext *ctx, uint32_t opc, tcg_gen_ext32s_tl(cpu_gpr[rd], cpu_gpr[rd]); } else if (rs == 0 && rt != 0) { tcg_gen_neg_tl(cpu_gpr[rd], cpu_gpr[rt]); + tcg_gen_ext32s_tl(cpu_gpr[rd], cpu_gpr[rd]); } else if (rs != 0 && rt == 0) { tcg_gen_mov_tl(cpu_gpr[rd], cpu_gpr[rs]); } else {