mirror of
https://github.com/apache/nuttx.git
synced 2026-08-01 20:28:58 +00:00
tricore/fpu: Support tricore fpucmp for float.
Implement up_fpucmp to compare FPU register state between two saved contexts. This is used by the ostest FPU test to verify that FPU registers are properly preserved across context switches. Signed-off-by: zhangyu117 <zhangyu117@xiaomi.com>
This commit is contained in:
parent
51ebb21474
commit
4e648c1693
1 changed files with 15 additions and 0 deletions
|
|
@ -26,6 +26,8 @@
|
|||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "tricore_internal.h"
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -43,3 +45,16 @@ void tricore_fpuinit(void)
|
|||
__mtcr(FPU_SYNC_TRAP_REG,
|
||||
__mfcr(FPU_SYNC_TRAP_REG) | (1U << FPU_TRAP_FZE_SHIFT));
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_fpucmp
|
||||
****************************************************************************/
|
||||
|
||||
bool up_fpucmp(const void *saveregs1, const void *saveregs2)
|
||||
{
|
||||
const uintptr_t *regs1 = saveregs1;
|
||||
const uintptr_t *regs2 = saveregs2;
|
||||
|
||||
return memcmp(®s1[REG_D8], ®s2[REG_D8],
|
||||
8 * sizeof(uintptr_t)) == 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue