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:
zhangyu117 2026-05-20 20:07:53 +08:00 committed by Xiang Xiao
parent 51ebb21474
commit 4e648c1693

View file

@ -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(&regs1[REG_D8], &regs2[REG_D8],
8 * sizeof(uintptr_t)) == 0;
}