This constant is, first, a #define, and second only used in one place.
In that one place, it appears that the code it guards is no longer
necessary in general. It was originally written to avoid refetching a
block of data that you're still in, even if you've moved slightly
farther in it because you're skipping the next instruction due to an
annulled branch delay slot. In reality however, in SPARC, the one ISA
I'm aware of which has this sort of branching behavior, the PC state
object will correctly determine that no branch is happening in these
cases. Code lower down in the loop will then recompute where fetching
should continue based on the next PC, automatically skipping the
annulled branch slot without misinterpretting the gap as a branch.
This change therefore also removes this block of code.
Change-Id: I820ebc9df10aeb4fcb69c12f6a784e9ec616743c
Reviewed-on: https://gem5-review.googlesource.com/6821
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
StaticInstPtr decodeInst(ExtMachInst);
-// Alpha Does NOT have a delay slot
-#define ISA_HAS_DELAY_SLOT 0
-
const Addr PageShift = 13;
const Addr PageBytes = ULL(1) << PageShift;
const Addr PageMask = ~(PageBytes - 1);
StaticInstPtr decodeInst(ExtMachInst);
- // ARM DOES NOT have a delay slot
- #define ISA_HAS_DELAY_SLOT 0
-
const Addr PageShift = 12;
const Addr PageBytes = ULL(1) << PageShift;
const Addr Page_Mask = ~(PageBytes - 1);
StaticInstPtr decodeInst(ExtMachInst);
-// MIPS DOES have a delay slot
-#define ISA_HAS_DELAY_SLOT 1
-
const Addr PageShift = 13;
const Addr PageBytes = ULL(1) << PageShift;
const Addr Page_Mask = ~(PageBytes - 1);
StaticInstPtr decodeInst(ExtMachInst);
-// POWER DOES NOT have a delay slot
-#define ISA_HAS_DELAY_SLOT 0
-
const Addr PageShift = 12;
const Addr PageBytes = ULL(1) << PageShift;
const Addr Page_Mask = ~(PageBytes - 1);
using namespace LittleEndianGuest;
-// Riscv does NOT have a delay slot
-#define ISA_HAS_DELAY_SLOT 0
-
const Addr PageShift = 12;
const Addr PageBytes = ULL(1) << PageShift;
// This makes sure the big endian versions of certain functions are used.
using namespace BigEndianGuest;
-// SPARC has a delay slot
-#define ISA_HAS_DELAY_SLOT 1
-
// real address virtual mapping
// sort of like alpha super page, but less frequently used
const Addr SegKPMEnd = ULL(0xfffffffc00000000);
//are used.
using namespace LittleEndianGuest;
- // X86 does not have a delay slot
-#define ISA_HAS_DELAY_SLOT 0
-
const Addr PageShift = 12;
const Addr PageBytes = ULL(1) << PageShift;
break;
}
- if (ISA_HAS_DELAY_SLOT && pcOffset == 0) {
- // Walk past any annulled delay slot instructions.
- Addr pcAddr = thisPC.instAddr() & BaseCPU::PCMask;
- while (fetchAddr != pcAddr && blkOffset < numInsts) {
- blkOffset++;
- fetchAddr += instSize;
- }
- if (blkOffset >= numInsts)
- break;
- }
-
MachInst inst = TheISA::gtoh(cacheInsts[blkOffset]);
decoder[tid]->moreBytes(thisPC, fetchAddr, inst);