mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/1] riscv: Enable compiler optimizations
@ 2020-07-08  5:43 Chenxi Mao
  2020-07-19  4:45 ` Palmer Dabbelt
  0 siblings, 1 reply; 3+ messages in thread
From: Chenxi Mao @ 2020-07-08  5:43 UTC (permalink / raw)
  To: paul.walmsley, palmer, aou
  Cc: linux-riscv, linux-kernel, chenxi.mao2013, Chenxi Mao

Enable ARCH_HAS_FAST_MULTIPLIER and ARCH_SUPPORTS_INT128 for better
code generation.
These 2 configurations works fine on GCC-9.3 and GCC-10.1

Signed-off-by: Chenxi Mao <maochenxi@eswin.com>
---
 arch/riscv/Kconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
index 128192e14ff2..f21b7e5188ca 100644
--- a/arch/riscv/Kconfig
+++ b/arch/riscv/Kconfig
@@ -26,6 +26,8 @@ config RISCV
 	select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT if MMU
 	select ARCH_WANT_FRAME_POINTERS
 	select ARCH_WANT_HUGE_PMD_SHARE if 64BIT
+	select ARCH_HAS_FAST_MULTIPLIER
+	select ARCH_SUPPORTS_INT128 if GCC_VERSION >= 50000 || CC_IS_CLANG
 	select CLONE_BACKWARDS
 	select COMMON_CLK
 	select EDAC_SUPPORT
-- 
2.25.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] riscv: Enable compiler optimizations
  2020-07-08  5:43 [PATCH 1/1] riscv: Enable compiler optimizations Chenxi Mao
@ 2020-07-19  4:45 ` Palmer Dabbelt
  2020-07-20  6:23   ` Ard Biesheuvel
  0 siblings, 1 reply; 3+ messages in thread
From: Palmer Dabbelt @ 2020-07-19  4:45 UTC (permalink / raw)
  To: maochenxi, ardb
  Cc: Paul Walmsley, aou, linux-riscv, linux-kernel, chenxi.mao2013, maochenxi

On Tue, 07 Jul 2020 22:43:54 PDT (-0700), maochenxi@eswin.com wrote:
> Enable ARCH_HAS_FAST_MULTIPLIER and ARCH_SUPPORTS_INT128 for better
> code generation.
> These 2 configurations works fine on GCC-9.3 and GCC-10.1
>
> Signed-off-by: Chenxi Mao <maochenxi@eswin.com>
> ---
>  arch/riscv/Kconfig | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
> index 128192e14ff2..f21b7e5188ca 100644
> --- a/arch/riscv/Kconfig
> +++ b/arch/riscv/Kconfig
> @@ -26,6 +26,8 @@ config RISCV
>  	select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT if MMU
>  	select ARCH_WANT_FRAME_POINTERS
>  	select ARCH_WANT_HUGE_PMD_SHARE if 64BIT
> +	select ARCH_HAS_FAST_MULTIPLIER
> +	select ARCH_SUPPORTS_INT128 if GCC_VERSION >= 50000 || CC_IS_CLANG

IIRC int128 is only supported on 64-bit targets, and we already have this under
RV64I but with a different set of requirements.  It looks like everyone has a
different set of requirements, but I feel like CC_HAS_INT128 is the right way
to go.  I'm not sure why we have the version check there.  Ard: do you know why
we would need both?

The fast multiplier one looks fine to me.  They're supposed to stay
alphabetical, though.

>  	select CLONE_BACKWARDS
>  	select COMMON_CLK
>  	select EDAC_SUPPORT

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] riscv: Enable compiler optimizations
  2020-07-19  4:45 ` Palmer Dabbelt
@ 2020-07-20  6:23   ` Ard Biesheuvel
  0 siblings, 0 replies; 3+ messages in thread
From: Ard Biesheuvel @ 2020-07-20  6:23 UTC (permalink / raw)
  To: Palmer Dabbelt
  Cc: maochenxi, Paul Walmsley, Albert Ou, linux-riscv,
	Linux Kernel Mailing List, chenxi.mao2013

On Sun, 19 Jul 2020 at 07:45, Palmer Dabbelt <palmer@dabbelt.com> wrote:
>
> On Tue, 07 Jul 2020 22:43:54 PDT (-0700), maochenxi@eswin.com wrote:
> > Enable ARCH_HAS_FAST_MULTIPLIER and ARCH_SUPPORTS_INT128 for better
> > code generation.
> > These 2 configurations works fine on GCC-9.3 and GCC-10.1
> >
> > Signed-off-by: Chenxi Mao <maochenxi@eswin.com>
> > ---
> >  arch/riscv/Kconfig | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
> > index 128192e14ff2..f21b7e5188ca 100644
> > --- a/arch/riscv/Kconfig
> > +++ b/arch/riscv/Kconfig
> > @@ -26,6 +26,8 @@ config RISCV
> >       select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT if MMU
> >       select ARCH_WANT_FRAME_POINTERS
> >       select ARCH_WANT_HUGE_PMD_SHARE if 64BIT
> > +     select ARCH_HAS_FAST_MULTIPLIER
> > +     select ARCH_SUPPORTS_INT128 if GCC_VERSION >= 50000 || CC_IS_CLANG
>
> IIRC int128 is only supported on 64-bit targets, and we already have this under
> RV64I but with a different set of requirements.  It looks like everyone has a
> different set of requirements, but I feel like CC_HAS_INT128 is the right way
> to go.  I'm not sure why we have the version check there.  Ard: do you know why
> we would need both?
>

That looks like copy/paste from the arm64 tree to me, where the names
of the libgcc routines were changed at some point, and we only support
the newer ones in the kernel.

> The fast multiplier one looks fine to me.  They're supposed to stay
> alphabetical, though.
>
> >       select CLONE_BACKWARDS
> >       select COMMON_CLK
> >       select EDAC_SUPPORT

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-07-20  6:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-08  5:43 [PATCH 1/1] riscv: Enable compiler optimizations Chenxi Mao
2020-07-19  4:45 ` Palmer Dabbelt
2020-07-20  6:23   ` Ard Biesheuvel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®