Gabe Black has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/52034 )
Change subject: arch: Simplify and tidy up PCState classes.
......................................................................
arch: Simplify and tidy up PCState classes.
Change-Id: Ife5412fdd8cc8093371365b8dd4705f77b952191
---
M src/arch/x86/pcstate.hh
M src/arch/arm/pcstate.hh
M src/arch/power/pcstate.hh
M src/arch/riscv/pcstate.hh
4 files changed, 26 insertions(+), 38 deletions(-)
diff --git a/src/arch/arm/pcstate.hh b/src/arch/arm/pcstate.hh
index b6f46ce..b2a88c8 100644
--- a/src/arch/arm/pcstate.hh
+++ b/src/arch/arm/pcstate.hh
@@ -79,22 +79,19 @@
AArch64Bit = (1 << 2)
};
- uint8_t flags;
- uint8_t nextFlags;
- uint8_t _itstate;
- uint8_t _nextItstate;
- uint8_t _size;
- bool _illegalExec;
+ uint8_t flags = 0;
+ uint8_t nextFlags = 0;
+ uint8_t _itstate = 0;
+ uint8_t _nextItstate = 0;
+ uint8_t _size = 0;
+ bool _illegalExec = false;
// Software Step flags
- bool _debugStep;
- bool _stepped;
+ bool _debugStep = false;
+ bool _stepped = false;
public:
- PCState() : flags(0), nextFlags(0), _itstate(0), _nextItstate(0),
- _size(0), _illegalExec(false), _debugStep(false),
- _stepped(false)
- {}
+ PCState() {}
void
set(Addr val)
@@ -103,10 +100,7 @@
npc(val + (thumb() ? 2 : 4));
}
- PCState(Addr val) : flags(0), nextFlags(0), _itstate(0),
- _nextItstate(0), _size(0), _illegalExec(false),
- _debugStep(false), _stepped(false)
- { set(val); }
+ PCState(Addr val) { set(val); }
bool
illegalExec() const
diff --git a/src/arch/power/pcstate.hh b/src/arch/power/pcstate.hh
index 393c001..7784005 100644
--- a/src/arch/power/pcstate.hh
+++ b/src/arch/power/pcstate.hh
@@ -42,24 +42,10 @@
class PCState : public GenericISA::SimplePCState<4>
{
private:
- typedef GenericISA::SimplePCState<4> Base;
ByteOrder guestByteOrder = ByteOrder::big;
public:
- PCState()
- {}
-
- void
- set(Addr val)
- {
- Base::set(val);
- npc(val + 4);
- }
-
- PCState(Addr val)
- {
- set(val);
- }
+ using GenericISA::SimplePCState<4>::SimplePCState;
ByteOrder
byteOrder() const
diff --git a/src/arch/riscv/pcstate.hh b/src/arch/riscv/pcstate.hh
index 06030b3..0ab2b91 100644
--- a/src/arch/riscv/pcstate.hh
+++ b/src/arch/riscv/pcstate.hh
@@ -53,15 +53,14 @@
class PCState : public GenericISA::UPCState<4>
{
private:
- bool _compressed;
- bool _rv32;
+ bool _compressed = false;
+ bool _rv32 = false;
public:
- PCState() : UPCState() { _compressed = false; _rv32 = false; }
- PCState(Addr val) : UPCState(val) { _compressed = false; _rv32 =
false; }
+ using GenericISA::UPCState<4>::UPCState;
void compressed(bool c) { _compressed = c; }
- bool compressed() { return _compressed; }
+ bool compressed() const { return _compressed; }
void rv32(bool val) { _rv32 = val; }
bool rv32() const { return _rv32; }
diff --git a/src/arch/x86/pcstate.hh b/src/arch/x86/pcstate.hh
index d04ec2c..077ea15 100644
--- a/src/arch/x86/pcstate.hh
+++ b/src/arch/x86/pcstate.hh
@@ -97,14 +97,14 @@
}
void
- serialize(CheckpointOut &cp) const
+ serialize(CheckpointOut &cp) const override
{
Base::serialize(cp);
SERIALIZE_SCALAR(_size);
}
void
- unserialize(CheckpointIn &cp)
+ unserialize(CheckpointIn &cp) override
{
Base::unserialize(cp);
UNSERIALIZE_SCALAR(_size);
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/52034
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: Ife5412fdd8cc8093371365b8dd4705f77b952191
Gerrit-Change-Number: 52034
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s