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
This commit is contained in:
patacongo 2012-02-26 15:27:36 +00:00
parent c7245b74fd
commit 16de7807fc

View File

@ -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)