Gabe Black has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/48716 )
Change subject: sparc: Stop special casing FP enable checks for full system.
......................................................................
sparc: Stop special casing FP enable checks for full system.
Set the actual state which gets checked in full system, and then do that
all the time.
Change-Id: I27ea0939ad71f7399b676e22ec2e73e3e0dd6476
---
M src/arch/sparc/isa/base.isa
M src/arch/sparc/process.cc
2 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/src/arch/sparc/isa/base.isa b/src/arch/sparc/isa/base.isa
index 89e48f0..9adc5ee 100644
--- a/src/arch/sparc/isa/base.isa
+++ b/src/arch/sparc/isa/base.isa
@@ -121,19 +121,15 @@
/// Check "FP enabled" machine status bit. Called when executing any
FP
/// instruction.
/// @retval Full-system mode: NoFault if FP is enabled, FpDisabled
- /// if not. Non-full-system mode: always returns NoFault.
+ /// if not.
static inline Fault
checkFpEnableFault(ExecContext *xc)
{
- if (FullSystem) {
- PSTATE pstate = xc->readMiscReg(MISCREG_PSTATE);
- if (pstate.pef && xc->readMiscReg(MISCREG_FPRS) & 0x4) {
- return NoFault;
- } else {
- return std::make_shared<FpDisabled>();
- }
- } else {
+ PSTATE pstate = xc->readMiscReg(MISCREG_PSTATE);
+ if (pstate.pef && xc->readMiscReg(MISCREG_FPRS) & 0x4) {
return NoFault;
+ } else {
+ return std::make_shared<FpDisabled>();
}
}
}};
diff --git a/src/arch/sparc/process.cc b/src/arch/sparc/process.cc
index e774b95..2ae9d4a 100644
--- a/src/arch/sparc/process.cc
+++ b/src/arch/sparc/process.cc
@@ -102,6 +102,9 @@
// Set the MMU Primary Context Register to hold the process' pid
tc->setMiscReg(MISCREG_MMU_P_CONTEXT, _pid);
+ // Enable floating point.
+ tc->setMiscReg(MISCREG_FPRS, 0x4);
+
/*
* T1 specific registers
*/
@@ -117,6 +120,7 @@
ThreadContext *tc = system->threads[contextIds[0]];
// The process runs in user mode with 32 bit addresses
PSTATE pstate = 0;
+ pstate.pef = 1;
pstate.ie = 1;
pstate.am = 1;
tc->setMiscReg(MISCREG_PSTATE, pstate);
@@ -132,6 +136,7 @@
ThreadContext *tc = system->threads[contextIds[0]];
// The process runs in user mode
PSTATE pstate = 0;
+ pstate.pef = 1;
pstate.ie = 1;
tc->setMiscReg(MISCREG_PSTATE, pstate);
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/48716
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: I27ea0939ad71f7399b676e22ec2e73e3e0dd6476
Gerrit-Change-Number: 48716
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