Skip to contentSkip to conversation

target-mips: pass 0 instead of -1 as rs in microMIPS LUI instruction

PATCH New Leon Alrae 1 participant 1 message Jan 26, 2015

lore
Share & tools
lore

Leon Alrae

author
#0 lore raw

PATCH 1/1 target-mips: pass 0 instead of -1 as rs in microMIPS LUI instruction

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.

---
 target-mips/translate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target-mips/translate.c +1 -1
index 77d89be..1347451 100644
@@ -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
Signature · 1 line
2.1.0