target-mips: proper sign extension for 'SUBU rd, zero, rt'
authorAurelien Jarno <aurelien@aurel32.net>
Mon, 4 May 2009 07:54:57 +0000 (09:54 +0200)
committerAurelien Jarno <aurelien@aurel32.net>
Mon, 4 May 2009 08:05:21 +0000 (10:05 +0200)
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

target-mips/translate.c

index 2c163e0..7ecc9fd 100644 (file)
@@ -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 {