summaryrefslogtreecommitdiff
path: root/src/arch/arm/utility.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/arm/utility.hh')
-rw-r--r--src/arch/arm/utility.hh19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/arch/arm/utility.hh b/src/arch/arm/utility.hh
index 65c94926e..4256aa047 100644
--- a/src/arch/arm/utility.hh
+++ b/src/arch/arm/utility.hh
@@ -146,6 +146,25 @@ namespace ArmISA {
return !inUserMode(tc);
}
+ static inline bool
+ vfpEnabled(CPACR cpacr, CPSR cpsr)
+ {
+ return cpacr.cp10 == 0x3 ||
+ (cpacr.cp10 == 0x2 && inPrivilegedMode(cpsr));
+ }
+
+ static inline bool
+ vfpEnabled(CPACR cpacr, CPSR cpsr, FPEXC fpexc)
+ {
+ return fpexc.en && vfpEnabled(cpacr, cpsr);
+ }
+
+ static inline bool
+ neonEnabled(CPACR cpacr, CPSR cpsr, FPEXC fpexc)
+ {
+ return !cpacr.asedis && vfpEnabled(cpacr, cpsr, fpexc);
+ }
+
uint64_t getArgument(ThreadContext *tc, int number, bool fp);
Fault setCp15Register(uint32_t &Rd, int CRn, int opc1, int CRm, int opc2);