Gabe Black has submitted this change. (
https://gem5-review.googlesource.com/c/public/gem5/+/48716 )
(
1 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the
submitted one.
)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
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/48716
Tested-by: kokoro <noreply+kok...@google.com>
Reviewed-by: Boris Shingarov <shinga...@labware.com>
Maintainer: Gabe Black <gabe.bl...@gmail.com>
---
M src/arch/sparc/process.cc
M src/arch/sparc/isa/base.isa
2 files changed, 26 insertions(+), 9 deletions(-)
Approvals:
Boris Shingarov: Looks good to me, approved
Gabe Black: Looks good to me, approved
kokoro: Regressions pass
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: 3
Gerrit-Owner: Gabe Black <gabe.bl...@gmail.com>
Gerrit-Reviewer: Bobby R. Bruce <bbr...@ucdavis.edu>
Gerrit-Reviewer: Boris Shingarov <shinga...@labware.com>
Gerrit-Reviewer: Gabe Black <gabe.bl...@gmail.com>
Gerrit-Reviewer: kokoro <noreply+kok...@google.com>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s