[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAAhV-H5PyXZDpysbjhF9EL0iNKeDM7WWPRgjJB2WW0kVdj+w-Q@mail.gmail.com>
Date: Fri, 31 Jul 2020 14:54:12 +0800
From: Huacai Chen <chenhc@...ote.com>
To: Serge Semin <Sergey.Semin@...kalelectronics.ru>
Cc: Jiaxun Yang <jiaxun.yang@...goat.com>,
Serge Semin <fancer.lancer@...il.com>,
"open list:MIPS" <linux-mips@...r.kernel.org>,
Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
Paul Burton <paulburton@...nel.org>,
Zhou Yanjie <zhouyanjie@...o.com>,
周琰杰 (Zhou Yanjie)
<zhouyanjie@...yeetech.com>,
Liangliang Huang <huanglllzu@...il.com>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] MIPS: Provide Kconfig option for default IEEE754
conformance mode
Reviewed-by: Huacai Chen <chenhc@...ote.com>
On Fri, Jul 31, 2020 at 2:18 PM Serge Semin
<Sergey.Semin@...kalelectronics.ru> wrote:
>
> On Fri, Jul 31, 2020 at 12:10:16PM +0800, 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.
>
> That's what should have been here in the first place. Thanks!
> Reviewed-by: Serge Semin <fancer.lancer@...il.com>
>
> >
> > Signed-off-by: Jiaxun Yang <jiaxun.yang@...goat.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.
> > +
> > + 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
> > --
> > 2.28.0
> >
Powered by blists - more mailing lists