[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <900c58a9-d706-be37-b160-603174a97e0f@wanyeetech.com>
Date: Fri, 7 Aug 2020 23:59:16 +0800
From: Zhou Yanjie <zhouyanjie@...yeetech.com>
To: Jiaxun Yang <jiaxun.yang@...goat.com>, linux-mips@...r.kernel.org
Cc: WANG Xuerui <git@...0n.name>,
Serge Semin <fancer.lancer@...il.com>,
Huacai Chen <chenhc@...ote.com>,
Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
Paul Burton <paulburton@...nel.org>,
Serge Semin <Sergey.Semin@...kalelectronics.ru>,
Zhou Yanjie <zhouyanjie@...o.com>,
Liangliang Huang <huanglllzu@...il.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] MIPS: Provide Kconfig option for default IEEE 754
conformance mode
Hello Jiaxun,
Reviewed-by: 周琰杰 (Zhou Yanjie) <zhouyanjie@...yeetech.com>
在 2020/8/1 下午2:11, Jiaxun Yang 写道:
> Requested by downstream distros, a Kconfig option for default
> IEEE 754 conformance mode allows them to set their mode to
> relaxed by default.
>
> Signed-off-by: Jiaxun Yang <jiaxun.yang@...goat.com>
> Reviewed-by: WANG Xuerui <git@...0n.name>
> Reviewed-by: Serge Semin <fancer.lancer@...il.com>
> Reviewed-by: Huacai Chen <chenhc@...ote.com>
>
> --
> v2: Reword according to Xuerui's suggestion.
> ---
> arch/mips/Kconfig | 22 ++++++++++++++++++++++
> arch/mips/kernel/cpu-probe.c | 12 +++++++++++-
> 2 files changed, 33 insertions(+), 1 deletion(-)
>
> diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
> index eaf7519e3033..ac35df2b9133 100644
> --- a/arch/mips/Kconfig
> +++ b/arch/mips/Kconfig
> @@ -2899,6 +2899,28 @@ config MIPS_NR_CPU_NR_MAP
> default 1024 if MIPS_NR_CPU_NR_MAP_1024
> default NR_CPUS if !MIPS_NR_CPU_NR_MAP_1024
>
> +choice
> + prompt "Default IEEE 754 conformance mode"
> + default IEEE754_DEFAULT_STRICT
> + help
> + Sets the default IEEE 754 conformance mode, same as overriding the
> + default value for the ieee754= kernel parameter. See the kernel
> + parameter for details.
> +
> + config IEEE754_DEFAULT_STRICT
> + bool "Strict"
> +
> + config IEEE754_DEFAULT_LEGACY
> + bool "Legacy"
> +
> + config IEEE754_DEFAULT_STD2008
> + bool "2008"
> +
> + config IEEE754_DEFAULT_RELAXED
> + bool "Relaxed"
> +
> +endchoice
> +
> #
> # Timer Interrupt Frequency Configuration
> #
> diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
> index c231c1b67889..a5b8fe019afc 100644
> --- a/arch/mips/kernel/cpu-probe.c
> +++ b/arch/mips/kernel/cpu-probe.c
> @@ -157,7 +157,17 @@ static void cpu_set_fpu_2008(struct cpuinfo_mips *c)
> * IEEE 754 conformance mode to use. Affects the NaN encoding and the
> * ABS.fmt/NEG.fmt execution mode.
> */
> -static enum { STRICT, LEGACY, STD2008, RELAXED } ieee754 = STRICT;
> +enum ieee754_mode { STRICT, LEGACY, STD2008, RELAXED };
> +
> +#if defined(CONFIG_IEEE754_DEFAULT_STRICT)
> +static enum ieee754_mode ieee754 = STRICT;
> +#elif defined(CONFIG_IEEE754_DEFAULT_LEGACY)
> +static enum ieee754_mode ieee754 = LEGACY;
> +#elif defined(CONFIG_IEEE754_DEFAULT_STD2008)
> +static enum ieee754_mode ieee754 = STD2008;
> +#elif defined(CONFIG_IEEE754_DEFAULT_RELAXED)
> +static enum ieee754_mode ieee754 = RELAXED;
> +#endif
>
> /*
> * Set the IEEE 754 NaN encodings and the ABS.fmt/NEG.fmt execution modes
Powered by blists - more mailing lists