target-mips: pass 0 instead of -1 as rs in microMIPS LUI instruction
authorLeon Alrae <leon.alrae@imgtec.com>
Mon, 26 Jan 2015 16:58:57 +0000 (16:58 +0000)
committerLeon Alrae <leon.alrae@imgtec.com>
Fri, 13 Feb 2015 14:11:29 +0000 (14:11 +0000)
Using rs = -1 in gen_logic_imm() for microMIPS LUI instruction is dangerous
and may bite us when implementing microMIPS R6 because in R6 AUI and LUI
are distinguished by rs value. Therefore use 0 for safety.

Reported-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
target-mips/translate.c

index b80af98..ca51149 100644 (file)
@@ -13653,7 +13653,7 @@ static void decode_micromips32_opc (CPUMIPSState *env, DisasContext *ctx,
                target. */
             break;
         case LUI:
-            gen_logic_imm(ctx, OPC_LUI, rs, -1, imm);
+            gen_logic_imm(ctx, OPC_LUI, rs, 0, imm);
             break;
         case SYNCI:
             /* Break the TB to be able to sync copied instructions