summaryrefslogtreecommitdiff
path: root/src/arch
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2019-11-25 02:13:58 -0800
committerGabe Black <gabeblack@google.com>2019-12-04 04:29:50 +0000
commitb99243360f10f73f64058741ca8f95047e980e4a (patch)
treed8fe1b38dd8712cba1656c86765d64b32064e0b6 /src/arch
parentef481775ae58afad37abe0c3c9b9bdf119d7bf33 (diff)
downloadgem5-b99243360f10f73f64058741ca8f95047e980e4a.tar.xz
sparc: Fix the predecoder's moreBytes method.
Endianness transformation was moved from the CPU into this method, making the "inst" parameter guest endian instead of host endian. The emi member of the decoder was set using the betoh method, ensuring that it was still stored in host order. Unfortunately, the "inst" parameter was used in some places when setting up the rest of emi. This change replaces those uses of inst with emi. Change-Id: I0c7f9a1833db4b64fc1a5015cf10f6ba3f7c26a0 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23163 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com> Tested-by: kokoro <noreply+kokoro@google.com>
Diffstat (limited to 'src/arch')
-rw-r--r--src/arch/sparc/decoder.hh4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/arch/sparc/decoder.hh b/src/arch/sparc/decoder.hh
index 8124a6963..999d0ed06 100644
--- a/src/arch/sparc/decoder.hh
+++ b/src/arch/sparc/decoder.hh
@@ -70,11 +70,11 @@ class Decoder
// should come from. Use that in the ExtMachInst. This is
// slightly redundant, but it removes the need to put a condition
// into all the execute functions
- if (inst & (1 << 13)) {
+ if (emi & (1 << 13)) {
emi |= (static_cast<ExtMachInst>(
asi << (sizeof(MachInst) * 8)));
} else {
- emi |= (static_cast<ExtMachInst>(bits(inst, 12, 5))
+ emi |= (static_cast<ExtMachInst>(bits(emi, 12, 5))
<< (sizeof(MachInst) * 8));
}
instDone = true;