linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: WANG Xuerui <kernel@xen0n.name>
To: Jiaxun Yang <jiaxun.yang@flygoat.com>, linux-mips@vger.kernel.org
Cc: "Thomas Bogendoerfer" <tsbogend@alpha.franken.de>,
	"Paul Burton" <paulburton@kernel.org>,
	"Huacai Chen" <chenhc@lemote.com>,
	"Serge Semin" <Sergey.Semin@baikalelectronics.ru>,
	"Zhou Yanjie" <zhouyanjie@zoho.com>,
	"周琰杰 (Zhou Yanjie)" <zhouyanjie@wanyeetech.com>,
	"Liangliang Huang" <huanglllzu@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] MIPS: Provide Kconfig option for default IEEE754 conformance mode
Date: Fri, 31 Jul 2020 16:33:21 +0800	[thread overview]
Message-ID: <e314d7f4-56cb-950f-6f38-d49a00101f5f@xen0n.name> (raw)
In-Reply-To: <20200731041018.1381642-1-jiaxun.yang@flygoat.com>

Hi Jiaxun,

Nice catch! Only one minor nit. Otherwise:

Reviewed-by: WANG Xuerui <git@xen0n.name>


On 2020/7/31 12:10, Jiaxun Yang wrote:
> Requested by downstream distros, a Kconfig option for default
> IEEE754 conformance mode allows them to set their mode to
> relaxed by default.
>
> Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
> ---
>  arch/mips/Kconfig            | 21 +++++++++++++++++++++
>  arch/mips/kernel/cpu-probe.c | 12 +++++++++++-
>  2 files changed, 32 insertions(+), 1 deletion(-)
>
> diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
> index f6bb446d30f0..ef5b2a177b1b 100644
> --- a/arch/mips/Kconfig
> +++ b/arch/mips/Kconfig
> @@ -2877,6 +2877,27 @@ 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 Std 754 conformance mode"
> +	default IEEE754_DEFAULT_STRICT
> +	help
> +	  Default IEEE Std 754 conformance mode, see ieee754= kernel parameter
> +	  for detail.

Here and the title, "IEEE Std 754" can be just "IEEE 754". I don't
remember seeing the "IEEE Std 754" phrase anywhere.

I suggest the following help message:

"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 d9e8d39a7289..03adeed58efb 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

  parent reply	other threads:[~2020-07-31  8:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-31  4:10 [PATCH] MIPS: Provide Kconfig option for default IEEE754 conformance mode Jiaxun Yang
2020-07-31  6:17 ` Serge Semin
2020-07-31  6:54   ` Huacai Chen
2020-08-02 21:46   ` Maciej W. Rozycki
2020-08-03  9:01     ` Jiaxun Yang
2020-08-05 19:30       ` Maciej W. Rozycki
2020-08-05 20:49       ` Zhou Yanjie
2020-07-31  8:33 ` WANG Xuerui [this message]
2020-07-31  4:11 Jiaxun Yang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e314d7f4-56cb-950f-6f38-d49a00101f5f@xen0n.name \
    --to=kernel@xen0n.name \
    --cc=Sergey.Semin@baikalelectronics.ru \
    --cc=chenhc@lemote.com \
    --cc=huanglllzu@gmail.com \
    --cc=jiaxun.yang@flygoat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=paulburton@kernel.org \
    --cc=tsbogend@alpha.franken.de \
    --cc=zhouyanjie@wanyeetech.com \
    --cc=zhouyanjie@zoho.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).