Konstantin Demin
c3d09a3e94
imported from https://salsa.debian.org/kernel-team/linux.git commit 9d5cc9d9d6501d7f1dd7e194d4b245bd0b6c6a22 version 6.11.4-1
36 lines
1.3 KiB
Diff
36 lines
1.3 KiB
Diff
From: YunQiang Su <syq@debian.org>
|
|
Date: Mon 16 Nov 2020 09:11:00 +0800
|
|
Subject: Use RELAXED ieee754 mode for Loongson-3 as 3A 4000 is 2008-only
|
|
Forwarded: not-needed
|
|
|
|
There are 2 mode of value of IEEE NaN hardcoded by CPU.
|
|
Currently, our mipsel/mips64el port is in so-called lagacy mode.
|
|
Loongson 3A 4000 is set as the so-called 2008 mode.
|
|
|
|
To make Debian workable on Loongson 3A 4000, we need set the kerenl in
|
|
RELAXED mode.
|
|
|
|
https://web.archive.org/web/20180830093617/https://dmz-portal.mips.com/wiki/MIPS_ABI_-_NaN_Interlinking
|
|
|
|
[bwh: Update for addition of EMULATED mode in 6.11]
|
|
---
|
|
arch/mips/kernel/fpu-probe.c | 7 ++++++-
|
|
1 file changed, 6 insertions(+), 1 deletion(-)
|
|
|
|
--- a/arch/mips/kernel/fpu-probe.c
|
|
+++ b/arch/mips/kernel/fpu-probe.c
|
|
@@ -144,7 +144,12 @@ static void cpu_set_fpu_2008(struct cpui
|
|
* IEEE 754 conformance mode to use. Affects the NaN encoding and the
|
|
* ABS.fmt/NEG.fmt execution mode.
|
|
*/
|
|
-static enum { STRICT, EMULATED, LEGACY, STD2008, RELAXED } ieee754 = STRICT;
|
|
+enum ieee754_mode { STRICT, EMULATED, LEGACY, STD2008, RELAXED };
|
|
+#ifdef CONFIG_CPU_LOONGSON64
|
|
+static enum ieee754_mode ieee754 = RELAXED;
|
|
+#else
|
|
+static enum ieee754_mode ieee754 = STRICT;
|
|
+#endif
|
|
|
|
/*
|
|
* Set the IEEE 754 NaN encodings and the ABS.fmt/NEG.fmt execution modes
|