From b99243360f10f73f64058741ca8f95047e980e4a Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Mon, 25 Nov 2019 02:13:58 -0800 Subject: 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 Reviewed-by: Gabe Black Maintainer: Gabe Black Tested-by: kokoro --- src/arch/sparc/decoder.hh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/arch') 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( asi << (sizeof(MachInst) * 8))); } else { - emi |= (static_cast(bits(inst, 12, 5)) + emi |= (static_cast(bits(emi, 12, 5)) << (sizeof(MachInst) * 8)); } instDone = true; -- cgit v1.2.3