Re: [PATCH] MIPS: Implement ieee754 NAN2008 emulation mode

From: Philippe Mathieu-Daudé
Date: Mon May 27 2024 - 08:38:51 EST


On 7/5/24 14:34, Jiaxun Yang wrote:
Implement ieee754 NAN2008 emulation mode.

When this mode is enabled, kernel will accept ELF file
compiled for both NaN 2008 and NaN legacy, but if hardware
does not have capability to match ELF's NaN mode, __own_fpu
will fail for corresponding thread and fpuemu will then kick
in.

This mode trade performance for corretness, while maintaining

"correctness"

support for both NaN mode regardless of hardware capability.
It is useful for multilib installation that have both types
of binary exist in system.

Signed-off-by: Jiaxun Yang <jiaxun.yang@xxxxxxxxxxx>
---
Documentation/admin-guide/kernel-parameters.txt | 4 +++-
arch/mips/include/asm/fpu.h | 15 +++++++++++++++
arch/mips/kernel/elf.c | 4 ++++
arch/mips/kernel/fpu-probe.c | 10 +++++++++-
4 files changed, 31 insertions(+), 2 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@xxxxxxxxxx>