arch: Make the decoder reset() method virtual.

This is called very infrequently, and so it's virtual overhead is
practically irrelevant.

Change-Id: If92cd96f75234c65c4cdffe392c32cfdd9b0c8cb
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52074
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Gabe Black
2021-10-25 02:12:42 -07:00
parent 5e7c964158
commit 81fa62fc91
9 changed files with 15 additions and 25 deletions

View File

@@ -67,11 +67,10 @@ Decoder::Decoder(ISA* isa)
void
Decoder::reset()
{
InstDecoder::reset();
bigThumb = false;
offset = 0;
emi = 0;
instDone = false;
outOfBytes = true;
foundIt = false;
}

View File

@@ -133,7 +133,7 @@ class Decoder : public InstDecoder
Decoder(ISA* isa = nullptr);
/** Reset the decoders internal state. */
void reset();
void reset() override;
/**
* Feed data to the decoder.

View File

@@ -55,6 +55,12 @@ class InstDecoder
virtual StaticInstPtr fetchRomMicroop(
MicroPC micropc, StaticInstPtr curMacroop);
virtual void
reset()
{
instDone = false;
outOfBytes = true;
}
void *moreBytesPtr() const { return _moreBytesPtr; }
size_t moreBytesSize() const { return _moreBytesSize; }

View File

@@ -60,12 +60,6 @@ class Decoder : public InstDecoder
{
}
void
reset()
{
instDone = false;
}
//Use this to give data to the decoder. This should be used
//when there is control flow.
void

View File

@@ -57,12 +57,6 @@ class Decoder : public InstDecoder
{
}
void
reset()
{
instDone = false;
}
// Use this to give data to the predecoder. This should be used
// when there is control flow.
void

View File

@@ -42,9 +42,7 @@ void Decoder::reset()
{
aligned = true;
mid = false;
outOfBytes = true;
emi = 0;
instDone = false;
}
void

View File

@@ -68,7 +68,7 @@ class Decoder : public InstDecoder
Decoder(ISA* isa=nullptr) : InstDecoder(&machInst) { reset(); }
void process() {}
void reset();
void reset() override;
inline bool compressed(ExtMachInst inst) { return (inst & 0x3) < 0x3; }

View File

@@ -56,12 +56,6 @@ class Decoder : public InstDecoder
void process() {}
void
reset()
{
instDone = false;
}
// Use this to give data to the predecoder. This should be used
// when there is control flow.
void

View File

@@ -302,7 +302,12 @@ class Decoder : public InstDecoder
stack = old->stack;
}
void reset() { state = ResetState; }
void
reset() override
{
InstDecoder::reset();
state = ResetState;
}
void process();