arch-arm: Fix StaticInst encoding() method
authorGiacomo Travaglini <giacomo.travaglini@arm.com>
Tue, 19 Dec 2017 18:15:32 +0000 (18:15 +0000)
committerGiacomo Travaglini <giacomo.travaglini@arm.com>
Thu, 21 Dec 2017 13:23:51 +0000 (13:23 +0000)
The previously introduced method was missing the machInst value
to be masked.

Change-Id: Ic722f7cc2abc680da1a1f19c08299338b5c859a6
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Chuan Zhu <chuan.zhu@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/6881
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

src/arch/arm/insts/static_inst.hh

index 4595646cb45c1f08666f75418eabe6842c196322..7ca1a84b68448e3d7dee5dc47a1e740a243f3eff 100644 (file)
@@ -440,7 +440,7 @@ class ArmStaticInst : public StaticInst
     MachInst
     encoding() const
     {
-        return static_cast<MachInst>(mask(instSize() * 8));
+        return static_cast<MachInst>(machInst & (mask(instSize() * 8)));
     }
 };
 }