Skip to content
Snippets Groups Projects
Commit 16de7807 authored by patacongo's avatar patacongo
Browse files

Add single precision operations to FPU test

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4429 42af7a65-404d-4744-a932-0658087f49c3
parent c7245b74
No related branches found
No related tags found
No related merge requests found
......@@ -70,6 +70,12 @@
# error "CONFIG_EXAMPLES_OSTEST_FPUSIZE has the wrong size"
#endif
/************************************************************************************
* Private Data
************************************************************************************/
static uint32_t g_saveregs[XCPTCONTEXT_REGS];
/************************************************************************************
* Private Functions
************************************************************************************/
......@@ -84,17 +90,20 @@
void arch_getfpu(FAR uint32_t *fpusave)
{
irqstate_t flags;
uint32_t regs[XCPTCONTEXT_REGS];
/* Take a snapshot of the thread context right now */
flags = irqsave();
up_savefpu(regs); /* Saves the context of the FPU registers to memory */
irqrestore(flags);
up_saveusercontext(g_saveregs);
memcpy(fpusave, &regs[REG_S0], (4*SW_FPU_REGS));
/* Return only the floating register values */
memcpy(fpusave, &g_saveregs[REG_S0], (4*SW_FPU_REGS));
irqrestore(flags);
}
/* Given two arrays of size CONFIG_EXAMPLES_OSTEST_FPUSIZE this function
* will compare then an return true if they are identical.
* will compare them and return true if they are identical.
*/
bool arch_cmpfpu(FAR const uint32_t *fpusave1, FAR const uint32_t *fpusave2)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment