diff mbox

[PULL,13/14] target-mips: pass 0 instead of -1 as rs in microMIPS LUI instruction

Message ID 1423821732-22542-14-git-send-email-leon.alrae@imgtec.com
State New
Headers show

Commit Message

Leon Alrae Feb. 13, 2015, 10:02 a.m. UTC
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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/target-mips/translate.c b/target-mips/translate.c
index 6ab3763..35e6cfe 100644
--- a/target-mips/translate.c
+++ b/target-mips/translate.c
@@ -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