All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] riscv: add Kconfig entries for the F and D ISA extensions support
@ 2019-05-21  7:18 Eric Lin
  2019-05-21  7:55 ` Bin Meng
  0 siblings, 1 reply; 12+ messages in thread
From: Eric Lin @ 2019-05-21  7:18 UTC (permalink / raw)
  To: u-boot

This patch add Kconfig entries for the F (Single-Precision)
and D (Double-Precision) floating point instruction-set extensions.

Signed-off-by: Eric Lin <tesheng@andestech.com>
---
 arch/riscv/Kconfig  |  8 ++++++++
 arch/riscv/Makefile | 12 ++++++++----
 2 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
index 362f3cdc65..a8031fa230 100644
--- a/arch/riscv/Kconfig
+++ b/arch/riscv/Kconfig
@@ -91,6 +91,14 @@ config RISCV_ISA_C
 	  when building U-Boot, which results in compressed instructions in the
 	  U-Boot binary.
 
+config RISCV_ISA_F
+	bool "Emit Floating-point instructions"
+	default n
+	help
+	  Adds "F" to the ISA subsets that the toolchain is allowed to emit
+	  when building U-Boot, which results in Single and Double-precision instructions
+	  in the U-Boot binary.
+
 config RISCV_ISA_A
 	def_bool y
 
diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile
index 0b80eb8d86..87ec0ea4b5 100644
--- a/arch/riscv/Makefile
+++ b/arch/riscv/Makefile
@@ -5,15 +5,19 @@
 
 ifeq ($(CONFIG_ARCH_RV64I),y)
 	ARCH_BASE = rv64im
-	ABI = lp64
+	ABI := lp64
 endif
 ifeq ($(CONFIG_ARCH_RV32I),y)
 	ARCH_BASE = rv32im
-	ABI = ilp32
+	ABI := ilp32
 endif
 ifeq ($(CONFIG_RISCV_ISA_A),y)
 	ARCH_A = a
 endif
+ifeq ($(CONFIG_RISCV_ISA_F),y)
+	ARCH_F = fd
+	ABI := $(ABI)d
+endif
 ifeq ($(CONFIG_RISCV_ISA_C),y)
 	ARCH_C = c
 endif
@@ -24,8 +28,8 @@ ifeq ($(CONFIG_CMODEL_MEDANY),y)
 	CMODEL = medany
 endif
 
-ARCH_FLAGS = -march=$(ARCH_BASE)$(ARCH_A)$(ARCH_C) -mabi=$(ABI) \
-	     -mcmodel=$(CMODEL)
+ARCH_FLAGS = -march=$(ARCH_BASE)$(ARCH_A)$(ARCH_F)$(ARCH_C) -mabi=$(ABI) \
+			         -mcmodel=$(CMODEL)
 
 PLATFORM_CPPFLAGS	+= $(ARCH_FLAGS)
 CFLAGS_EFI		+= $(ARCH_FLAGS)
-- 
2.17.0

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

* [U-Boot] [PATCH] riscv: add Kconfig entries for the F and D ISA extensions support
  2019-05-21  7:18 [U-Boot] [PATCH] riscv: add Kconfig entries for the F and D ISA extensions support Eric Lin
@ 2019-05-21  7:55 ` Bin Meng
  2019-05-22  8:22   ` tesheng at andestech.com
  0 siblings, 1 reply; 12+ messages in thread
From: Bin Meng @ 2019-05-21  7:55 UTC (permalink / raw)
  To: u-boot

Hi Eric,

On Tue, May 21, 2019 at 3:18 PM Eric Lin <tesheng@andestech.com> wrote:
>
> This patch add Kconfig entries for the F (Single-Precision)

adds

> and D (Double-Precision) floating point instruction-set extensions.
>

Could you please provide reason that why U-Boot has to be compiled
using F/D extension?

> Signed-off-by: Eric Lin <tesheng@andestech.com>
> ---
>  arch/riscv/Kconfig  |  8 ++++++++
>  arch/riscv/Makefile | 12 ++++++++----
>  2 files changed, 16 insertions(+), 4 deletions(-)
>
> diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
> index 362f3cdc65..a8031fa230 100644
> --- a/arch/riscv/Kconfig
> +++ b/arch/riscv/Kconfig
> @@ -91,6 +91,14 @@ config RISCV_ISA_C
>           when building U-Boot, which results in compressed instructions in the
>           U-Boot binary.
>
> +config RISCV_ISA_F
> +       bool "Emit Floating-point instructions"
> +       default n

this can be dropped as default is n

> +       help
> +         Adds "F" to the ISA subsets that the toolchain is allowed to emit
> +         when building U-Boot, which results in Single and Double-precision instructions

This does not match what the config name says. The config name is for
F and it cannot indicate both F and D here.

> +         in the U-Boot binary.
> +
>  config RISCV_ISA_A
>         def_bool y
>
> diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile
> index 0b80eb8d86..87ec0ea4b5 100644
> --- a/arch/riscv/Makefile
> +++ b/arch/riscv/Makefile
> @@ -5,15 +5,19 @@
>
>  ifeq ($(CONFIG_ARCH_RV64I),y)
>         ARCH_BASE = rv64im
> -       ABI = lp64
> +       ABI := lp64
>  endif
>  ifeq ($(CONFIG_ARCH_RV32I),y)
>         ARCH_BASE = rv32im
> -       ABI = ilp32
> +       ABI := ilp32
>  endif
>  ifeq ($(CONFIG_RISCV_ISA_A),y)
>         ARCH_A = a
>  endif
> +ifeq ($(CONFIG_RISCV_ISA_F),y)
> +       ARCH_F = fd
> +       ABI := $(ABI)d
> +endif
>  ifeq ($(CONFIG_RISCV_ISA_C),y)
>         ARCH_C = c
>  endif
> @@ -24,8 +28,8 @@ ifeq ($(CONFIG_CMODEL_MEDANY),y)
>         CMODEL = medany
>  endif
>
> -ARCH_FLAGS = -march=$(ARCH_BASE)$(ARCH_A)$(ARCH_C) -mabi=$(ABI) \
> -            -mcmodel=$(CMODEL)
> +ARCH_FLAGS = -march=$(ARCH_BASE)$(ARCH_A)$(ARCH_F)$(ARCH_C) -mabi=$(ABI) \
> +                                -mcmodel=$(CMODEL)
>
>  PLATFORM_CPPFLAGS      += $(ARCH_FLAGS)
>  CFLAGS_EFI             += $(ARCH_FLAGS)
> --

Regards,
Bin

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

* [U-Boot] [PATCH] riscv: add Kconfig entries for the F and D ISA extensions support
  2019-05-21  7:55 ` Bin Meng
@ 2019-05-22  8:22   ` tesheng at andestech.com
  2019-05-22  9:25     ` Bin Meng
  0 siblings, 1 reply; 12+ messages in thread
From: tesheng at andestech.com @ 2019-05-22  8:22 UTC (permalink / raw)
  To: u-boot

Hi Bin,

> -----Original Message-----
> From: Bin Meng [mailto:bmeng.cn at gmail.com]
> Sent: Tuesday, May 21, 2019 3:56 PM
> To: Eric Te-Sheng Lin(林德晟)
> Cc: U-Boot Mailing List; Lukas Auer; Anup Patel; Rick Jian-Zhi Chen(陳建志);
> Greentime Ying-Han Hu(胡英漢); dslin1010 at gmail.com
> Subject: Re: [PATCH] riscv: add Kconfig entries for the F and D ISA extensions
> support
>
> Hi Eric,
>
> On Tue, May 21, 2019 at 3:18 PM Eric Lin <tesheng@andestech.com> wrote:
> >
> > This patch add Kconfig entries for the F (Single-Precision)
>
> adds
>

OK I'll correct it as adds

> > and D (Double-Precision) floating point instruction-set extensions.
> >
>
> Could you please provide reason that why U-Boot has to be compiled using F/D
> extension?
>

Cause on AE350 platform, we have two different kinds of toolchain v5d (support I/M/A/C/F/D ISA) and
v5 (support I/M/A/C ISA). If we use the v5d toolchain to build U-Boot it will build fail, so we would like to add F/D extension on U-Boot.

> > Signed-off-by: Eric Lin <tesheng@andestech.com>
> > ---
> >  arch/riscv/Kconfig  |  8 ++++++++
> >  arch/riscv/Makefile | 12 ++++++++----
> >  2 files changed, 16 insertions(+), 4 deletions(-)
> >
> > diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index
> > 362f3cdc65..a8031fa230 100644
> > --- a/arch/riscv/Kconfig
> > +++ b/arch/riscv/Kconfig
> > @@ -91,6 +91,14 @@ config RISCV_ISA_C
> >           when building U-Boot, which results in compressed instructions
> in the
> >           U-Boot binary.
> >
> > +config RISCV_ISA_F
> > +       bool "Emit Floating-point instructions"
> > +       default n
>
> this can be dropped as default is n

OK, I'll drop it

> > +       help
> > +         Adds "F" to the ISA subsets that the toolchain is allowed to emit
> > +         when building U-Boot, which results in Single and
> > + Double-precision instructions
>
> This does not match what the config name says. The config name is for F and it
> cannot indicate both F and D here.
>

OK, I'll correct it as follows to cover F and D:
config RISCV_ISA_FD
    bool "Emit Floating-point instructions"
    help
      Adds "F" and "D" to the ISA subsets that the toolchain is allowed to emit
      when building U-Boot, which results in Single and Double-precision instructions
      in the U-Boot binary.


> > +         in the U-Boot binary.
> > +
> >  config RISCV_ISA_A
> >         def_bool y
> >
> > diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile index
> > 0b80eb8d86..87ec0ea4b5 100644
> > --- a/arch/riscv/Makefile
> > +++ b/arch/riscv/Makefile
> > @@ -5,15 +5,19 @@
> >
> >  ifeq ($(CONFIG_ARCH_RV64I),y)
> >         ARCH_BASE = rv64im
> > -       ABI = lp64
> > +       ABI := lp64
> >  endif
> >  ifeq ($(CONFIG_ARCH_RV32I),y)
> >         ARCH_BASE = rv32im
> > -       ABI = ilp32
> > +       ABI := ilp32
> >  endif
> >  ifeq ($(CONFIG_RISCV_ISA_A),y)
> >         ARCH_A = a
> >  endif
> > +ifeq ($(CONFIG_RISCV_ISA_F),y)
> > +       ARCH_F = fd

ifeq ($(CONFIG_RISCV_ISA_FD),y)
                  ARCH_FD = fd

> > +       ABI := $(ABI)d
> > +endif
> >  ifeq ($(CONFIG_RISCV_ISA_C),y)
> >         ARCH_C = c
> >  endif
> > @@ -24,8 +28,8 @@ ifeq ($(CONFIG_CMODEL_MEDANY),y)
> >         CMODEL = medany
> >  endif
> >
> > -ARCH_FLAGS = -march=$(ARCH_BASE)$(ARCH_A)$(ARCH_C) -mabi=$(ABI) \
> > -            -mcmodel=$(CMODEL)
> > +ARCH_FLAGS = -march=$(ARCH_BASE)$(ARCH_A)$(ARCH_F)$(ARCH_C)

ARCH_FLAGS = -march=$(ARCH_BASE)$(ARCH_A)$(ARCH_FD)$(ARCH_C)

> -mabi=$(ABI) \
> > +                                -mcmodel=$(CMODEL)
> >
> >  PLATFORM_CPPFLAGS      += $(ARCH_FLAGS)
> >  CFLAGS_EFI             += $(ARCH_FLAGS)
> > --
>
> Regards,
> Bin

Thanks for your review.

Regards,
Eric
CONFIDENTIALITY NOTICE:

This e-mail (and its attachments) may contain confidential and legally privileged information or information protected from disclosure. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or use of the information contained herein is strictly prohibited. In this case, please immediately notify the sender by return e-mail, delete the message (and any accompanying documents) and destroy all printed hard copies. Thank you for your cooperation.

Copyright ANDES TECHNOLOGY CORPORATION - All Rights Reserved.

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

* [U-Boot] [PATCH] riscv: add Kconfig entries for the F and D ISA extensions support
  2019-05-22  8:22   ` tesheng at andestech.com
@ 2019-05-22  9:25     ` Bin Meng
  2019-05-24  8:04       ` Eric Lin
  0 siblings, 1 reply; 12+ messages in thread
From: Bin Meng @ 2019-05-22  9:25 UTC (permalink / raw)
  To: u-boot

Hi Eric,

On Wed, May 22, 2019 at 4:23 PM <tesheng@andestech.com> wrote:
>
> Hi Bin,
>
> > -----Original Message-----
> > From: Bin Meng [mailto:bmeng.cn at gmail.com]
> > Sent: Tuesday, May 21, 2019 3:56 PM
> > To: Eric Te-Sheng Lin(林德晟)
> > Cc: U-Boot Mailing List; Lukas Auer; Anup Patel; Rick Jian-Zhi Chen(陳建志);
> > Greentime Ying-Han Hu(胡英漢); dslin1010 at gmail.com
> > Subject: Re: [PATCH] riscv: add Kconfig entries for the F and D ISA extensions
> > support
> >
> > Hi Eric,
> >
> > On Tue, May 21, 2019 at 3:18 PM Eric Lin <tesheng@andestech.com> wrote:
> > >
> > > This patch add Kconfig entries for the F (Single-Precision)
> >
> > adds
> >
>
> OK I'll correct it as adds
>
> > > and D (Double-Precision) floating point instruction-set extensions.
> > >
> >
> > Could you please provide reason that why U-Boot has to be compiled using F/D
> > extension?
> >
>
> Cause on AE350 platform, we have two different kinds of toolchain v5d (support I/M/A/C/F/D ISA) and
> v5 (support I/M/A/C ISA). If we use the v5d toolchain to build U-Boot it will build fail, so we would like to add F/D extension on U-Boot.

I don't understand. What difference do these two toochains have? Isn't
the v5d toolchain's default -march string be pre-configured to imafd?
But even if the toolchain is pre-configured to generate fd
instruction, I think it can be override by the compiler flags. Can you
please share the details of the toolchain you used? I suspect you have
to fix your toolchain, not U-Boot.

>
> > > Signed-off-by: Eric Lin <tesheng@andestech.com>
> > > ---
> > >  arch/riscv/Kconfig  |  8 ++++++++
> > >  arch/riscv/Makefile | 12 ++++++++----
> > >  2 files changed, 16 insertions(+), 4 deletions(-)
> > >
> > > diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index
> > > 362f3cdc65..a8031fa230 100644
> > > --- a/arch/riscv/Kconfig
> > > +++ b/arch/riscv/Kconfig
> > > @@ -91,6 +91,14 @@ config RISCV_ISA_C
> > >           when building U-Boot, which results in compressed instructions
> > in the
> > >           U-Boot binary.
> > >
> > > +config RISCV_ISA_F
> > > +       bool "Emit Floating-point instructions"
> > > +       default n
> >
> > this can be dropped as default is n
>
> OK, I'll drop it
>
> > > +       help
> > > +         Adds "F" to the ISA subsets that the toolchain is allowed to emit
> > > +         when building U-Boot, which results in Single and
> > > + Double-precision instructions
> >
> > This does not match what the config name says. The config name is for F and it
> > cannot indicate both F and D here.
> >
>
> OK, I'll correct it as follows to cover F and D:
> config RISCV_ISA_FD
>     bool "Emit Floating-point instructions"
>     help
>       Adds "F" and "D" to the ISA subsets that the toolchain is allowed to emit
>       when building U-Boot, which results in Single and Double-precision instructions
>       in the U-Boot binary.
>
>
> > > +         in the U-Boot binary.
> > > +
> > >  config RISCV_ISA_A
> > >         def_bool y
> > >
> > > diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile index
> > > 0b80eb8d86..87ec0ea4b5 100644
> > > --- a/arch/riscv/Makefile
> > > +++ b/arch/riscv/Makefile
> > > @@ -5,15 +5,19 @@
> > >
> > >  ifeq ($(CONFIG_ARCH_RV64I),y)
> > >         ARCH_BASE = rv64im
> > > -       ABI = lp64
> > > +       ABI := lp64
> > >  endif
> > >  ifeq ($(CONFIG_ARCH_RV32I),y)
> > >         ARCH_BASE = rv32im
> > > -       ABI = ilp32
> > > +       ABI := ilp32
> > >  endif
> > >  ifeq ($(CONFIG_RISCV_ISA_A),y)
> > >         ARCH_A = a
> > >  endif
> > > +ifeq ($(CONFIG_RISCV_ISA_F),y)
> > > +       ARCH_F = fd
>
> ifeq ($(CONFIG_RISCV_ISA_FD),y)
>                   ARCH_FD = fd
>
> > > +       ABI := $(ABI)d
> > > +endif
> > >  ifeq ($(CONFIG_RISCV_ISA_C),y)
> > >         ARCH_C = c
> > >  endif
> > > @@ -24,8 +28,8 @@ ifeq ($(CONFIG_CMODEL_MEDANY),y)
> > >         CMODEL = medany
> > >  endif
> > >
> > > -ARCH_FLAGS = -march=$(ARCH_BASE)$(ARCH_A)$(ARCH_C) -mabi=$(ABI) \
> > > -            -mcmodel=$(CMODEL)
> > > +ARCH_FLAGS = -march=$(ARCH_BASE)$(ARCH_A)$(ARCH_F)$(ARCH_C)
>
> ARCH_FLAGS = -march=$(ARCH_BASE)$(ARCH_A)$(ARCH_FD)$(ARCH_C)
>
> > -mabi=$(ABI) \
> > > +                                -mcmodel=$(CMODEL)
> > >
> > >  PLATFORM_CPPFLAGS      += $(ARCH_FLAGS)
> > >  CFLAGS_EFI             += $(ARCH_FLAGS)


Regards,
Bin

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

* [U-Boot] [PATCH] riscv: add Kconfig entries for the F and D ISA extensions support
  2019-05-22  9:25     ` Bin Meng
@ 2019-05-24  8:04       ` Eric Lin
  2019-05-24  8:21         ` [U-Boot] Fwd: " Eric Lin
                           ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Eric Lin @ 2019-05-24  8:04 UTC (permalink / raw)
  To: u-boot

Hi Bin

Bin Meng <bmeng.cn@gmail.com> 於 2019年5月22日 週三 下午5:25寫道:
>
> Hi Eric,
>
> On Wed, May 22, 2019 at 4:23 PM <tesheng@andestech.com> wrote:
> >
> > Hi Bin,
> >
> > > -----Original Message-----
> > > From: Bin Meng [mailto:bmeng.cn at gmail.com]
> > > Sent: Tuesday, May 21, 2019 3:56 PM
> > > To: Eric Te-Sheng Lin(林德晟)
> > > Cc: U-Boot Mailing List; Lukas Auer; Anup Patel; Rick Jian-Zhi Chen(陳建志);
> > > Greentime Ying-Han Hu(胡英漢); dslin1010 at gmail.com
> > > Subject: Re: [PATCH] riscv: add Kconfig entries for the F and D ISA extensions
> > > support
> > >
> > > Hi Eric,
> > >
> > > On Tue, May 21, 2019 at 3:18 PM Eric Lin <tesheng@andestech.com> wrote:
> > > >
> > > > This patch add Kconfig entries for the F (Single-Precision)
> > >
> > > adds
> > >
> >
> > OK I'll correct it as adds
> >
> > > > and D (Double-Precision) floating point instruction-set extensions.
> > > >
> > >
> > > Could you please provide reason that why U-Boot has to be compiled using F/D
> > > extension?
> > >
> >
> > Cause on AE350 platform, we have two different kinds of toolchain v5d (support I/M/A/C/F/D ISA) and
> > v5 (support I/M/A/C ISA). If we use the v5d toolchain to build U-Boot it will build fail, so we would like to add F/D extension on U-Boot.
>
> I don't understand. What difference do these two toochains have? Isn't
> the v5d toolchain's default -march string be pre-configured to imafd?
> But even if the toolchain is pre-configured to generate fd
> instruction, I think it can be override by the compiler flags. Can you
> please share the details of the toolchain you used? I suspect you have
> to fix your toolchain, not U-Boot.
>

It's seems the ABI issue. Because our toolchain don't support
multilib, the v5d toolchain libraries ABI is ilp64d.
If I use the v5d toolchain to build U-Boot with -mabi=lp64, it will
get link error as below:
...
riscv64-linux-ld.bfd:
/nds64le-linux-glibc-v5d/bin/../lib/gcc/riscv64-linux/7.3.0/libgcc.a(save-restore.o):
can't link double-float modules with soft-float modules
riscv64-linux-ld.bfd: failed to merge target specific data of file
/nds64le-linux-glibc-v5d/bin/../lib/gcc/riscv64-linux/7.3.0/libgcc.a(save-restore.o)
examples/standalone/Makefile:62: recipe for target
'examples/standalone/hello_world' failed
...

so we would like to override the compiler flag mabi to lp64d.

> >
> > > > Signed-off-by: Eric Lin <tesheng@andestech.com>
> > > > ---
> > > >  arch/riscv/Kconfig  |  8 ++++++++
> > > >  arch/riscv/Makefile | 12 ++++++++----
> > > >  2 files changed, 16 insertions(+), 4 deletions(-)
> > > >
> > > > diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index
> > > > 362f3cdc65..a8031fa230 100644
> > > > --- a/arch/riscv/Kconfig
> > > > +++ b/arch/riscv/Kconfig
> > > > @@ -91,6 +91,14 @@ config RISCV_ISA_C
> > > >           when building U-Boot, which results in compressed instructions
> > > in the
> > > >           U-Boot binary.
> > > >
> > > > +config RISCV_ISA_F
> > > > +       bool "Emit Floating-point instructions"
> > > > +       default n
> > >
> > > this can be dropped as default is n
> >
> > OK, I'll drop it
> >
> > > > +       help
> > > > +         Adds "F" to the ISA subsets that the toolchain is allowed to emit
> > > > +         when building U-Boot, which results in Single and
> > > > + Double-precision instructions
> > >
> > > This does not match what the config name says. The config name is for F and it
> > > cannot indicate both F and D here.
> > >
> >
> > OK, I'll correct it as follows to cover F and D:
> > config RISCV_ISA_FD
> >     bool "Emit Floating-point instructions"
> >     help
> >       Adds "F" and "D" to the ISA subsets that the toolchain is allowed to emit
> >       when building U-Boot, which results in Single and Double-precision instructions
> >       in the U-Boot binary.
> >
> >
> > > > +         in the U-Boot binary.
> > > > +
> > > >  config RISCV_ISA_A
> > > >         def_bool y
> > > >
> > > > diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile index
> > > > 0b80eb8d86..87ec0ea4b5 100644
> > > > --- a/arch/riscv/Makefile
> > > > +++ b/arch/riscv/Makefile
> > > > @@ -5,15 +5,19 @@
> > > >
> > > >  ifeq ($(CONFIG_ARCH_RV64I),y)
> > > >         ARCH_BASE = rv64im
> > > > -       ABI = lp64
> > > > +       ABI := lp64
> > > >  endif
> > > >  ifeq ($(CONFIG_ARCH_RV32I),y)
> > > >         ARCH_BASE = rv32im
> > > > -       ABI = ilp32
> > > > +       ABI := ilp32
> > > >  endif
> > > >  ifeq ($(CONFIG_RISCV_ISA_A),y)
> > > >         ARCH_A = a
> > > >  endif
> > > > +ifeq ($(CONFIG_RISCV_ISA_F),y)
> > > > +       ARCH_F = fd
> >
> > ifeq ($(CONFIG_RISCV_ISA_FD),y)
> >                   ARCH_FD = fd
> >
> > > > +       ABI := $(ABI)d
> > > > +endif
> > > >  ifeq ($(CONFIG_RISCV_ISA_C),y)
> > > >         ARCH_C = c
> > > >  endif
> > > > @@ -24,8 +28,8 @@ ifeq ($(CONFIG_CMODEL_MEDANY),y)
> > > >         CMODEL = medany
> > > >  endif
> > > >
> > > > -ARCH_FLAGS = -march=$(ARCH_BASE)$(ARCH_A)$(ARCH_C) -mabi=$(ABI) \
> > > > -            -mcmodel=$(CMODEL)
> > > > +ARCH_FLAGS = -march=$(ARCH_BASE)$(ARCH_A)$(ARCH_F)$(ARCH_C)
> >
> > ARCH_FLAGS = -march=$(ARCH_BASE)$(ARCH_A)$(ARCH_FD)$(ARCH_C)
> >
> > > -mabi=$(ABI) \
> > > > +                                -mcmodel=$(CMODEL)
> > > >
> > > >  PLATFORM_CPPFLAGS      += $(ARCH_FLAGS)
> > > >  CFLAGS_EFI             += $(ARCH_FLAGS)
>
>
> Regards,
> Bin

Thanks for your review
Eric

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

* [U-Boot] Fwd: [PATCH] riscv: add Kconfig entries for the F and D ISA extensions support
  2019-05-24  8:04       ` Eric Lin
@ 2019-05-24  8:21         ` Eric Lin
  2019-05-24  8:38         ` Eric Lin
  2019-05-24  9:40         ` [U-Boot] " Bin Meng
  2 siblings, 0 replies; 12+ messages in thread
From: Eric Lin @ 2019-05-24  8:21 UTC (permalink / raw)
  To: u-boot

Hi Bin

Bin Meng <bmeng.cn@gmail.com> 於 2019年5月22日 週三 下午5:25寫道:
>
> Hi Eric,
>
> On Wed, May 22, 2019 at 4:23 PM <tesheng@andestech.com> wrote:
> >
> > Hi Bin,
> >
> > > -----Original Message-----
> > > From: Bin Meng [mailto:bmeng.cn at gmail.com]
> > > Sent: Tuesday, May 21, 2019 3:56 PM
> > > To: Eric Te-Sheng Lin(林德晟)
> > > Cc: U-Boot Mailing List; Lukas Auer; Anup Patel; Rick Jian-Zhi Chen(陳建志);
> > > Greentime Ying-Han Hu(胡英漢); dslin1010 at gmail.com
> > > Subject: Re: [PATCH] riscv: add Kconfig entries for the F and D ISA extensions
> > > support
> > >
> > > Hi Eric,
> > >
> > > On Tue, May 21, 2019 at 3:18 PM Eric Lin <tesheng@andestech.com> wrote:
> > > >
> > > > This patch add Kconfig entries for the F (Single-Precision)
> > >
> > > adds
> > >
> >
> > OK I'll correct it as adds
> >
> > > > and D (Double-Precision) floating point instruction-set extensions.
> > > >
> > >
> > > Could you please provide reason that why U-Boot has to be compiled using F/D
> > > extension?
> > >
> >
> > Cause on AE350 platform, we have two different kinds of toolchain v5d (support I/M/A/C/F/D ISA) and
> > v5 (support I/M/A/C ISA). If we use the v5d toolchain to build U-Boot it will build fail, so we would like to add F/D extension on U-Boot.
>
> I don't understand. What difference do these two toochains have? Isn't
> the v5d toolchain's default -march string be pre-configured to imafd?
> But even if the toolchain is pre-configured to generate fd
> instruction, I think it can be override by the compiler flags. Can you
> please share the details of the toolchain you used? I suspect you have
> to fix your toolchain, not U-Boot.
>

It's seems the ABI issue. Because our toolchain don't support
multilib, the v5d toolchain libraries ABI is ilp64d.
If I use the v5d toolchain to build U-Boot with -mabi=lp64, it will
get link error as below:
...
riscv64-linux-ld.bfd:
/nds64le-linux-glibc-v5d/bin/../lib/gcc/riscv64-linux/7.3.0/libgcc.a(save-restore.o):
can't link double-float modules with soft-float modules
riscv64-linux-ld.bfd: failed to merge target specific data of file
/nds64le-linux-glibc-v5d/bin/../lib/gcc/riscv64-linux/7.3.0/libgcc.a(save-restore.o)
examples/standalone/Makefile:62: recipe for target
'examples/standalone/hello_world' failed
...

so we would like to override the compiler flag mabi to lp64d.

> >
> > > > Signed-off-by: Eric Lin <tesheng@andestech.com>
> > > > ---
> > > >  arch/riscv/Kconfig  |  8 ++++++++
> > > >  arch/riscv/Makefile | 12 ++++++++----
> > > >  2 files changed, 16 insertions(+), 4 deletions(-)
> > > >
> > > > diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index
> > > > 362f3cdc65..a8031fa230 100644
> > > > --- a/arch/riscv/Kconfig
> > > > +++ b/arch/riscv/Kconfig
> > > > @@ -91,6 +91,14 @@ config RISCV_ISA_C
> > > >           when building U-Boot, which results in compressed instructions
> > > in the
> > > >           U-Boot binary.
> > > >
> > > > +config RISCV_ISA_F
> > > > +       bool "Emit Floating-point instructions"
> > > > +       default n
> > >
> > > this can be dropped as default is n
> >
> > OK, I'll drop it
> >
> > > > +       help
> > > > +         Adds "F" to the ISA subsets that the toolchain is allowed to emit
> > > > +         when building U-Boot, which results in Single and
> > > > + Double-precision instructions
> > >
> > > This does not match what the config name says. The config name is for F and it
> > > cannot indicate both F and D here.
> > >
> >
> > OK, I'll correct it as follows to cover F and D:
> > config RISCV_ISA_FD
> >     bool "Emit Floating-point instructions"
> >     help
> >       Adds "F" and "D" to the ISA subsets that the toolchain is allowed to emit
> >       when building U-Boot, which results in Single and Double-precision instructions
> >       in the U-Boot binary.
> >
> >
> > > > +         in the U-Boot binary.
> > > > +
> > > >  config RISCV_ISA_A
> > > >         def_bool y
> > > >
> > > > diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile index
> > > > 0b80eb8d86..87ec0ea4b5 100644
> > > > --- a/arch/riscv/Makefile
> > > > +++ b/arch/riscv/Makefile
> > > > @@ -5,15 +5,19 @@
> > > >
> > > >  ifeq ($(CONFIG_ARCH_RV64I),y)
> > > >         ARCH_BASE = rv64im
> > > > -       ABI = lp64
> > > > +       ABI := lp64
> > > >  endif
> > > >  ifeq ($(CONFIG_ARCH_RV32I),y)
> > > >         ARCH_BASE = rv32im
> > > > -       ABI = ilp32
> > > > +       ABI := ilp32
> > > >  endif
> > > >  ifeq ($(CONFIG_RISCV_ISA_A),y)
> > > >         ARCH_A = a
> > > >  endif
> > > > +ifeq ($(CONFIG_RISCV_ISA_F),y)
> > > > +       ARCH_F = fd
> >
> > ifeq ($(CONFIG_RISCV_ISA_FD),y)
> >                   ARCH_FD = fd
> >
> > > > +       ABI := $(ABI)d
> > > > +endif
> > > >  ifeq ($(CONFIG_RISCV_ISA_C),y)
> > > >         ARCH_C = c
> > > >  endif
> > > > @@ -24,8 +28,8 @@ ifeq ($(CONFIG_CMODEL_MEDANY),y)
> > > >         CMODEL = medany
> > > >  endif
> > > >
> > > > -ARCH_FLAGS = -march=$(ARCH_BASE)$(ARCH_A)$(ARCH_C) -mabi=$(ABI) \
> > > > -            -mcmodel=$(CMODEL)
> > > > +ARCH_FLAGS = -march=$(ARCH_BASE)$(ARCH_A)$(ARCH_F)$(ARCH_C)
> >
> > ARCH_FLAGS = -march=$(ARCH_BASE)$(ARCH_A)$(ARCH_FD)$(ARCH_C)
> >
> > > -mabi=$(ABI) \
> > > > +                                -mcmodel=$(CMODEL)
> > > >
> > > >  PLATFORM_CPPFLAGS      += $(ARCH_FLAGS)
> > > >  CFLAGS_EFI             += $(ARCH_FLAGS)
>
>
> Regards,
> Bin

Thanks for your review
Eric

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

* [U-Boot] Fwd: [PATCH] riscv: add Kconfig entries for the F and D ISA extensions support
  2019-05-24  8:04       ` Eric Lin
  2019-05-24  8:21         ` [U-Boot] Fwd: " Eric Lin
@ 2019-05-24  8:38         ` Eric Lin
  2019-05-24  9:40         ` [U-Boot] " Bin Meng
  2 siblings, 0 replies; 12+ messages in thread
From: Eric Lin @ 2019-05-24  8:38 UTC (permalink / raw)
  To: u-boot

Hi Bin

Bin Meng <bmeng.cn@gmail.com> 於 2019年5月22日 週三 下午5:25寫道:
>
> Hi Eric,
>
> On Wed, May 22, 2019 at 4:23 PM <tesheng@andestech.com> wrote:
> >
> > Hi Bin,
> >
> > > -----Original Message-----
> > > From: Bin Meng [mailto:bmeng.cn at gmail.com]
> > > Sent: Tuesday, May 21, 2019 3:56 PM
> > > To: Eric Te-Sheng Lin(林德晟)
> > > Cc: U-Boot Mailing List; Lukas Auer; Anup Patel; Rick Jian-Zhi Chen(陳建志);
> > > Greentime Ying-Han Hu(胡英漢); dslin1010 at gmail.com
> > > Subject: Re: [PATCH] riscv: add Kconfig entries for the F and D ISA extensions
> > > support
> > >
> > > Hi Eric,
> > >
> > > On Tue, May 21, 2019 at 3:18 PM Eric Lin <tesheng@andestech.com> wrote:
> > > >
> > > > This patch add Kconfig entries for the F (Single-Precision)
> > >
> > > adds
> > >
> >
> > OK I'll correct it as adds
> >
> > > > and D (Double-Precision) floating point instruction-set extensions.
> > > >
> > >
> > > Could you please provide reason that why U-Boot has to be compiled using F/D
> > > extension?
> > >
> >
> > Cause on AE350 platform, we have two different kinds of toolchain v5d (support I/M/A/C/F/D ISA) and
> > v5 (support I/M/A/C ISA). If we use the v5d toolchain to build U-Boot it will build fail, so we would like to add F/D extension on U-Boot.
>
> I don't understand. What difference do these two toochains have? Isn't
> the v5d toolchain's default -march string be pre-configured to imafd?
> But even if the toolchain is pre-configured to generate fd
> instruction, I think it can be override by the compiler flags. Can you
> please share the details of the toolchain you used? I suspect you have
> to fix your toolchain, not U-Boot.
>

It's seems the ABI issue. Because our toolchain don't support
multilib, the v5d toolchain libraries ABI is ilp64d.
If I use the v5d toolchain to build U-Boot with -mabi=lp64, it will
get link error as below:
...
riscv64-linux-ld.bfd:
/nds64le-linux-glibc-v5d/bin/../lib/gcc/riscv64-linux/7.3.0/libgcc.a(save-restore.o):
can't link double-float modules with soft-float modules
riscv64-linux-ld.bfd: failed to merge target specific data of file
/nds64le-linux-glibc-v5d/bin/../lib/gcc/riscv64-linux/7.3.0/libgcc.a(save-restore.o)
examples/standalone/Makefile:62: recipe for target
'examples/standalone/hello_world' failed
...

so we would like to override the compiler flag mabi to lp64d.

> >
> > > > Signed-off-by: Eric Lin <tesheng@andestech.com>
> > > > ---
> > > >  arch/riscv/Kconfig  |  8 ++++++++
> > > >  arch/riscv/Makefile | 12 ++++++++----
> > > >  2 files changed, 16 insertions(+), 4 deletions(-)
> > > >
> > > > diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index
> > > > 362f3cdc65..a8031fa230 100644
> > > > --- a/arch/riscv/Kconfig
> > > > +++ b/arch/riscv/Kconfig
> > > > @@ -91,6 +91,14 @@ config RISCV_ISA_C
> > > >           when building U-Boot, which results in compressed instructions
> > > in the
> > > >           U-Boot binary.
> > > >
> > > > +config RISCV_ISA_F
> > > > +       bool "Emit Floating-point instructions"
> > > > +       default n
> > >
> > > this can be dropped as default is n
> >
> > OK, I'll drop it
> >
> > > > +       help
> > > > +         Adds "F" to the ISA subsets that the toolchain is allowed to emit
> > > > +         when building U-Boot, which results in Single and
> > > > + Double-precision instructions
> > >
> > > This does not match what the config name says. The config name is for F and it
> > > cannot indicate both F and D here.
> > >
> >
> > OK, I'll correct it as follows to cover F and D:
> > config RISCV_ISA_FD
> >     bool "Emit Floating-point instructions"
> >     help
> >       Adds "F" and "D" to the ISA subsets that the toolchain is allowed to emit
> >       when building U-Boot, which results in Single and Double-precision instructions
> >       in the U-Boot binary.
> >
> >
> > > > +         in the U-Boot binary.
> > > > +
> > > >  config RISCV_ISA_A
> > > >         def_bool y
> > > >
> > > > diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile index
> > > > 0b80eb8d86..87ec0ea4b5 100644
> > > > --- a/arch/riscv/Makefile
> > > > +++ b/arch/riscv/Makefile
> > > > @@ -5,15 +5,19 @@
> > > >
> > > >  ifeq ($(CONFIG_ARCH_RV64I),y)
> > > >         ARCH_BASE = rv64im
> > > > -       ABI = lp64
> > > > +       ABI := lp64
> > > >  endif
> > > >  ifeq ($(CONFIG_ARCH_RV32I),y)
> > > >         ARCH_BASE = rv32im
> > > > -       ABI = ilp32
> > > > +       ABI := ilp32
> > > >  endif
> > > >  ifeq ($(CONFIG_RISCV_ISA_A),y)
> > > >         ARCH_A = a
> > > >  endif
> > > > +ifeq ($(CONFIG_RISCV_ISA_F),y)
> > > > +       ARCH_F = fd
> >
> > ifeq ($(CONFIG_RISCV_ISA_FD),y)
> >                   ARCH_FD = fd
> >
> > > > +       ABI := $(ABI)d
> > > > +endif
> > > >  ifeq ($(CONFIG_RISCV_ISA_C),y)
> > > >         ARCH_C = c
> > > >  endif
> > > > @@ -24,8 +28,8 @@ ifeq ($(CONFIG_CMODEL_MEDANY),y)
> > > >         CMODEL = medany
> > > >  endif
> > > >
> > > > -ARCH_FLAGS = -march=$(ARCH_BASE)$(ARCH_A)$(ARCH_C) -mabi=$(ABI) \
> > > > -            -mcmodel=$(CMODEL)
> > > > +ARCH_FLAGS = -march=$(ARCH_BASE)$(ARCH_A)$(ARCH_F)$(ARCH_C)
> >
> > ARCH_FLAGS = -march=$(ARCH_BASE)$(ARCH_A)$(ARCH_FD)$(ARCH_C)
> >
> > > -mabi=$(ABI) \
> > > > +                                -mcmodel=$(CMODEL)
> > > >
> > > >  PLATFORM_CPPFLAGS      += $(ARCH_FLAGS)
> > > >  CFLAGS_EFI             += $(ARCH_FLAGS)
>
>
> Regards,
> Bin

Thanks for your review
Eric

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

* [U-Boot] [PATCH] riscv: add Kconfig entries for the F and D ISA extensions support
  2019-05-24  8:04       ` Eric Lin
  2019-05-24  8:21         ` [U-Boot] Fwd: " Eric Lin
  2019-05-24  8:38         ` Eric Lin
@ 2019-05-24  9:40         ` Bin Meng
  2019-05-28  7:54           ` Greentime Hu
  2 siblings, 1 reply; 12+ messages in thread
From: Bin Meng @ 2019-05-24  9:40 UTC (permalink / raw)
  To: u-boot

Hi Eric,

On Fri, May 24, 2019 at 4:04 PM Eric Lin <dslin1010@gmail.com> wrote:
>
> Hi Bin
>
> Bin Meng <bmeng.cn@gmail.com> 於 2019年5月22日 週三 下午5:25寫道:
> >
> > Hi Eric,
> >
> > On Wed, May 22, 2019 at 4:23 PM <tesheng@andestech.com> wrote:
> > >
> > > Hi Bin,
> > >
> > > > -----Original Message-----
> > > > From: Bin Meng [mailto:bmeng.cn at gmail.com]
> > > > Sent: Tuesday, May 21, 2019 3:56 PM
> > > > To: Eric Te-Sheng Lin(林德晟)
> > > > Cc: U-Boot Mailing List; Lukas Auer; Anup Patel; Rick Jian-Zhi Chen(陳建志);
> > > > Greentime Ying-Han Hu(胡英漢); dslin1010 at gmail.com
> > > > Subject: Re: [PATCH] riscv: add Kconfig entries for the F and D ISA extensions
> > > > support
> > > >
> > > > Hi Eric,
> > > >
> > > > On Tue, May 21, 2019 at 3:18 PM Eric Lin <tesheng@andestech.com> wrote:
> > > > >
> > > > > This patch add Kconfig entries for the F (Single-Precision)
> > > >
> > > > adds
> > > >
> > >
> > > OK I'll correct it as adds
> > >
> > > > > and D (Double-Precision) floating point instruction-set extensions.
> > > > >
> > > >
> > > > Could you please provide reason that why U-Boot has to be compiled using F/D
> > > > extension?
> > > >
> > >
> > > Cause on AE350 platform, we have two different kinds of toolchain v5d (support I/M/A/C/F/D ISA) and
> > > v5 (support I/M/A/C ISA). If we use the v5d toolchain to build U-Boot it will build fail, so we would like to add F/D extension on U-Boot.
> >
> > I don't understand. What difference do these two toochains have? Isn't
> > the v5d toolchain's default -march string be pre-configured to imafd?
> > But even if the toolchain is pre-configured to generate fd
> > instruction, I think it can be override by the compiler flags. Can you
> > please share the details of the toolchain you used? I suspect you have
> > to fix your toolchain, not U-Boot.
> >
>
> It's seems the ABI issue. Because our toolchain don't support
> multilib, the v5d toolchain libraries ABI is ilp64d.
> If I use the v5d toolchain to build U-Boot with -mabi=lp64, it will
> get link error as below:

Then please fix your compiler. Passing -mabi=lp64 to compiler is
definitely correct.

> ...
> riscv64-linux-ld.bfd:
> /nds64le-linux-glibc-v5d/bin/../lib/gcc/riscv64-linux/7.3.0/libgcc.a(save-restore.o):
> can't link double-float modules with soft-float modules
> riscv64-linux-ld.bfd: failed to merge target specific data of file
> /nds64le-linux-glibc-v5d/bin/../lib/gcc/riscv64-linux/7.3.0/libgcc.a(save-restore.o)
> examples/standalone/Makefile:62: recipe for target
> 'examples/standalone/hello_world' failed
> ...
>
> so we would like to override the compiler flag mabi to lp64d.

No, adding this to U-Boot is a workaround to your compiler.

Regards,
Bin

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

* [U-Boot] [PATCH] riscv: add Kconfig entries for the F and D ISA extensions support
  2019-05-24  9:40         ` [U-Boot] " Bin Meng
@ 2019-05-28  7:54           ` Greentime Hu
  2019-05-28  9:58             ` Bin Meng
  0 siblings, 1 reply; 12+ messages in thread
From: Greentime Hu @ 2019-05-28  7:54 UTC (permalink / raw)
  To: u-boot

Hi Bin,
On Fri, May 24, 2019 at 05:40:08PM +0800, Bin Meng wrote:
> Hi Eric,
> 
> On Fri, May 24, 2019 at 4:04 PM Eric Lin <dslin1010@gmail.com> wrote:
> >
> > Hi Bin
> >
> > Bin Meng <bmeng.cn@gmail.com> ??? 2019???5???22??? ?????? ??????5:25?????????
> > >
> > > Hi Eric,
> > >
> > > On Wed, May 22, 2019 at 4:23 PM <tesheng@andestech.com> wrote:
> > > >
> > > > Hi Bin,
> > > >
> > > > > -----Original Message-----
> > > > > From: Bin Meng [mailto:bmeng.cn at gmail.com]
> > > > > Sent: Tuesday, May 21, 2019 3:56 PM
> > > > > To: Eric Te-Sheng Lin(?????????)
> > > > > Cc: U-Boot Mailing List; Lukas Auer; Anup Patel; Rick Jian-Zhi Chen(?????????);
> > > > > Greentime Ying-Han Hu(?????????); dslin1010 at gmail.com
> > > > > Subject: Re: [PATCH] riscv: add Kconfig entries for the F and D ISA extensions
> > > > > support
> > > > >
> > > > > Hi Eric,
> > > > >
> > > > > On Tue, May 21, 2019 at 3:18 PM Eric Lin <tesheng@andestech.com> wrote:
> > > > > >
> > > > > > This patch add Kconfig entries for the F (Single-Precision)
> > > > >
> > > > > adds
> > > > >
> > > >
> > > > OK I'll correct it as adds
> > > >
> > > > > > and D (Double-Precision) floating point instruction-set extensions.
> > > > > >
> > > > >
> > > > > Could you please provide reason that why U-Boot has to be compiled using F/D
> > > > > extension?
> > > > >
> > > >
> > > > Cause on AE350 platform, we have two different kinds of toolchain v5d (support I/M/A/C/F/D ISA) and
> > > > v5 (support I/M/A/C ISA). If we use the v5d toolchain to build U-Boot it will build fail, so we would like to add F/D extension on U-Boot.
> > >
> > > I don't understand. What difference do these two toochains have? Isn't
> > > the v5d toolchain's default -march string be pre-configured to imafd?
> > > But even if the toolchain is pre-configured to generate fd
> > > instruction, I think it can be override by the compiler flags. Can you
> > > please share the details of the toolchain you used? I suspect you have
> > > to fix your toolchain, not U-Boot.
> > >
> >
> > It's seems the ABI issue. Because our toolchain don't support
> > multilib, the v5d toolchain libraries ABI is ilp64d.
> > If I use the v5d toolchain to build U-Boot with -mabi=lp64, it will
> > get link error as below:
> 
> Then please fix your compiler. Passing -mabi=lp64 to compiler is
> definitely correct.

 One of our customer ever used floating point in their project. They want
 to calculate something with floating point instructions in u-Boot before
 entering kernel.

 IMHO, we may consider this case for user to use -mabi=ilp64d.
 This CONFIG will be useful for them to compile their codes and linking together
 with u-Boot.

 Thanks :)

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

* [U-Boot] [PATCH] riscv: add Kconfig entries for the F and D ISA extensions support
  2019-05-28  7:54           ` Greentime Hu
@ 2019-05-28  9:58             ` Bin Meng
  2019-05-28 10:50               ` Greentime Hu
  0 siblings, 1 reply; 12+ messages in thread
From: Bin Meng @ 2019-05-28  9:58 UTC (permalink / raw)
  To: u-boot

Hi Greentime,

On Tue, May 28, 2019 at 3:54 PM Greentime Hu <greentime@andestech.com> wrote:
>
> Hi Bin,
> On Fri, May 24, 2019 at 05:40:08PM +0800, Bin Meng wrote:
> > Hi Eric,
> >
> > On Fri, May 24, 2019 at 4:04 PM Eric Lin <dslin1010@gmail.com> wrote:
> > >
> > > Hi Bin
> > >
> > > Bin Meng <bmeng.cn@gmail.com> ??? 2019???5???22??? ?????? ??????5:25?????????
> > > >
> > > > Hi Eric,
> > > >
> > > > On Wed, May 22, 2019 at 4:23 PM <tesheng@andestech.com> wrote:
> > > > >
> > > > > Hi Bin,
> > > > >
> > > > > > -----Original Message-----
> > > > > > From: Bin Meng [mailto:bmeng.cn at gmail.com]
> > > > > > Sent: Tuesday, May 21, 2019 3:56 PM
> > > > > > To: Eric Te-Sheng Lin(?????????)
> > > > > > Cc: U-Boot Mailing List; Lukas Auer; Anup Patel; Rick Jian-Zhi Chen(?????????);
> > > > > > Greentime Ying-Han Hu(?????????); dslin1010 at gmail.com
> > > > > > Subject: Re: [PATCH] riscv: add Kconfig entries for the F and D ISA extensions
> > > > > > support
> > > > > >
> > > > > > Hi Eric,
> > > > > >
> > > > > > On Tue, May 21, 2019 at 3:18 PM Eric Lin <tesheng@andestech.com> wrote:
> > > > > > >
> > > > > > > This patch add Kconfig entries for the F (Single-Precision)
> > > > > >
> > > > > > adds
> > > > > >
> > > > >
> > > > > OK I'll correct it as adds
> > > > >
> > > > > > > and D (Double-Precision) floating point instruction-set extensions.
> > > > > > >
> > > > > >
> > > > > > Could you please provide reason that why U-Boot has to be compiled using F/D
> > > > > > extension?
> > > > > >
> > > > >
> > > > > Cause on AE350 platform, we have two different kinds of toolchain v5d (support I/M/A/C/F/D ISA) and
> > > > > v5 (support I/M/A/C ISA). If we use the v5d toolchain to build U-Boot it will build fail, so we would like to add F/D extension on U-Boot.
> > > >
> > > > I don't understand. What difference do these two toochains have? Isn't
> > > > the v5d toolchain's default -march string be pre-configured to imafd?
> > > > But even if the toolchain is pre-configured to generate fd
> > > > instruction, I think it can be override by the compiler flags. Can you
> > > > please share the details of the toolchain you used? I suspect you have
> > > > to fix your toolchain, not U-Boot.
> > > >
> > >
> > > It's seems the ABI issue. Because our toolchain don't support
> > > multilib, the v5d toolchain libraries ABI is ilp64d.
> > > If I use the v5d toolchain to build U-Boot with -mabi=lp64, it will
> > > get link error as below:
> >
> > Then please fix your compiler. Passing -mabi=lp64 to compiler is
> > definitely correct.
>
>  One of our customer ever used floating point in their project. They want
>  to calculate something with floating point instructions in u-Boot before
>  entering kernel.

This is a new use case. For other architectures like x86, we don't
allow U-Boot to be compiled using hardware float ABI. Why can't they
use software floating point instead?

>
>  IMHO, we may consider this case for user to use -mabi=ilp64d.
>  This CONFIG will be useful for them to compile their codes and linking together
>  with u-Boot.
>
>  Thanks :)

Regards,
Bin

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

* [U-Boot] [PATCH] riscv: add Kconfig entries for the F and D ISA extensions support
  2019-05-28  9:58             ` Bin Meng
@ 2019-05-28 10:50               ` Greentime Hu
  2019-05-29  3:21                 ` Bin Meng
  0 siblings, 1 reply; 12+ messages in thread
From: Greentime Hu @ 2019-05-28 10:50 UTC (permalink / raw)
  To: u-boot

Hi Bin,
On Tue, May 28, 2019 at 05:58:47PM +0800, Bin Meng wrote:
> Hi Greentime,
> 
> On Tue, May 28, 2019 at 3:54 PM Greentime Hu <greentime@andestech.com> wrote:
> >
> > Hi Bin,
> > On Fri, May 24, 2019 at 05:40:08PM +0800, Bin Meng wrote:
> > > Hi Eric,
> > >
> > > On Fri, May 24, 2019 at 4:04 PM Eric Lin <dslin1010@gmail.com> wrote:
> > > >
> > > > Hi Bin
> > > >
> > > > Bin Meng <bmeng.cn@gmail.com> ??? 2019???5???22??? ?????? ??????5:25?????????
> > > > >
> > > > > Hi Eric,
> > > > >
> > > > > On Wed, May 22, 2019 at 4:23 PM <tesheng@andestech.com> wrote:
> > > > > >
> > > > > > Hi Bin,
> > > > > >
> > > > > > > -----Original Message-----
> > > > > > > From: Bin Meng [mailto:bmeng.cn at gmail.com]
> > > > > > > Sent: Tuesday, May 21, 2019 3:56 PM
> > > > > > > To: Eric Te-Sheng Lin(?????????)
> > > > > > > Cc: U-Boot Mailing List; Lukas Auer; Anup Patel; Rick Jian-Zhi Chen(?????????);
> > > > > > > Greentime Ying-Han Hu(?????????); dslin1010 at gmail.com
> > > > > > > Subject: Re: [PATCH] riscv: add Kconfig entries for the F and D ISA extensions
> > > > > > > support
> > > > > > >
> > > > > > > Hi Eric,
> > > > > > >
> > > > > > > On Tue, May 21, 2019 at 3:18 PM Eric Lin <tesheng@andestech.com> wrote:
> > > > > > > >
> > > > > > > > This patch add Kconfig entries for the F (Single-Precision)
> > > > > > >
> > > > > > > adds
> > > > > > >
> > > > > >
> > > > > > OK I'll correct it as adds
> > > > > >
> > > > > > > > and D (Double-Precision) floating point instruction-set extensions.
> > > > > > > >
> > > > > > >
> > > > > > > Could you please provide reason that why U-Boot has to be compiled using F/D
> > > > > > > extension?
> > > > > > >
> > > > > >
> > > > > > Cause on AE350 platform, we have two different kinds of toolchain v5d (support I/M/A/C/F/D ISA) and
> > > > > > v5 (support I/M/A/C ISA). If we use the v5d toolchain to build U-Boot it will build fail, so we would like to add F/D extension on U-Boot.
> > > > >
> > > > > I don't understand. What difference do these two toochains have? Isn't
> > > > > the v5d toolchain's default -march string be pre-configured to imafd?
> > > > > But even if the toolchain is pre-configured to generate fd
> > > > > instruction, I think it can be override by the compiler flags. Can you
> > > > > please share the details of the toolchain you used? I suspect you have
> > > > > to fix your toolchain, not U-Boot.
> > > > >
> > > >
> > > > It's seems the ABI issue. Because our toolchain don't support
> > > > multilib, the v5d toolchain libraries ABI is ilp64d.
> > > > If I use the v5d toolchain to build U-Boot with -mabi=lp64, it will
> > > > get link error as below:
> > >
> > > Then please fix your compiler. Passing -mabi=lp64 to compiler is
> > > definitely correct.
> >
> >  One of our customer ever used floating point in their project. They want
> >  to calculate something with floating point instructions in u-Boot before
> >  entering kernel.
> 
> This is a new use case. For other architectures like x86, we don't
> allow U-Boot to be compiled using hardware float ABI. Why can't they
> use software floating point instead?

It's because they'd like to calculate something very quickly. It may just be
done in few cycles with floating point instructions and it will be very useful
for their usages instead of using soft-float.

That's the reason they ask us to provide such kind of CONFIG and we think it
might also be helpful for users who are trying to do some mathematics with
floating point instructions in u-Boot.

Thanks. :)

> >
> >  IMHO, we may consider this case for user to use -mabi=ilp64d.
> >  This CONFIG will be useful for them to compile their codes and linking together
> >  with u-Boot.
> >
> >  Thanks :)
> 
> Regards,
> Bin

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

* [U-Boot] [PATCH] riscv: add Kconfig entries for the F and D ISA extensions support
  2019-05-28 10:50               ` Greentime Hu
@ 2019-05-29  3:21                 ` Bin Meng
  0 siblings, 0 replies; 12+ messages in thread
From: Bin Meng @ 2019-05-29  3:21 UTC (permalink / raw)
  To: u-boot

On Tue, May 28, 2019 at 6:50 PM Greentime Hu <greentime@andestech.com> wrote:
>
> Hi Bin,
> On Tue, May 28, 2019 at 05:58:47PM +0800, Bin Meng wrote:
> > Hi Greentime,
> >
> > On Tue, May 28, 2019 at 3:54 PM Greentime Hu <greentime@andestech.com> wrote:
> > >
> > > Hi Bin,
> > > On Fri, May 24, 2019 at 05:40:08PM +0800, Bin Meng wrote:
> > > > Hi Eric,
> > > >
> > > > On Fri, May 24, 2019 at 4:04 PM Eric Lin <dslin1010@gmail.com> wrote:
> > > > >
> > > > > Hi Bin
> > > > >
> > > > > Bin Meng <bmeng.cn@gmail.com> ??? 2019???5???22??? ?????? ??????5:25?????????
> > > > > >
> > > > > > Hi Eric,
> > > > > >
> > > > > > On Wed, May 22, 2019 at 4:23 PM <tesheng@andestech.com> wrote:
> > > > > > >
> > > > > > > Hi Bin,
> > > > > > >
> > > > > > > > -----Original Message-----
> > > > > > > > From: Bin Meng [mailto:bmeng.cn at gmail.com]
> > > > > > > > Sent: Tuesday, May 21, 2019 3:56 PM
> > > > > > > > To: Eric Te-Sheng Lin(?????????)
> > > > > > > > Cc: U-Boot Mailing List; Lukas Auer; Anup Patel; Rick Jian-Zhi Chen(?????????);
> > > > > > > > Greentime Ying-Han Hu(?????????); dslin1010 at gmail.com
> > > > > > > > Subject: Re: [PATCH] riscv: add Kconfig entries for the F and D ISA extensions
> > > > > > > > support
> > > > > > > >
> > > > > > > > Hi Eric,
> > > > > > > >
> > > > > > > > On Tue, May 21, 2019 at 3:18 PM Eric Lin <tesheng@andestech.com> wrote:
> > > > > > > > >
> > > > > > > > > This patch add Kconfig entries for the F (Single-Precision)
> > > > > > > >
> > > > > > > > adds
> > > > > > > >
> > > > > > >
> > > > > > > OK I'll correct it as adds
> > > > > > >
> > > > > > > > > and D (Double-Precision) floating point instruction-set extensions.
> > > > > > > > >
> > > > > > > >
> > > > > > > > Could you please provide reason that why U-Boot has to be compiled using F/D
> > > > > > > > extension?
> > > > > > > >
> > > > > > >
> > > > > > > Cause on AE350 platform, we have two different kinds of toolchain v5d (support I/M/A/C/F/D ISA) and
> > > > > > > v5 (support I/M/A/C ISA). If we use the v5d toolchain to build U-Boot it will build fail, so we would like to add F/D extension on U-Boot.
> > > > > >
> > > > > > I don't understand. What difference do these two toochains have? Isn't
> > > > > > the v5d toolchain's default -march string be pre-configured to imafd?
> > > > > > But even if the toolchain is pre-configured to generate fd
> > > > > > instruction, I think it can be override by the compiler flags. Can you
> > > > > > please share the details of the toolchain you used? I suspect you have
> > > > > > to fix your toolchain, not U-Boot.
> > > > > >
> > > > >
> > > > > It's seems the ABI issue. Because our toolchain don't support
> > > > > multilib, the v5d toolchain libraries ABI is ilp64d.
> > > > > If I use the v5d toolchain to build U-Boot with -mabi=lp64, it will
> > > > > get link error as below:
> > > >
> > > > Then please fix your compiler. Passing -mabi=lp64 to compiler is
> > > > definitely correct.
> > >
> > >  One of our customer ever used floating point in their project. They want
> > >  to calculate something with floating point instructions in u-Boot before
> > >  entering kernel.
> >
> > This is a new use case. For other architectures like x86, we don't
> > allow U-Boot to be compiled using hardware float ABI. Why can't they
> > use software floating point instead?
>
> It's because they'd like to calculate something very quickly. It may just be
> done in few cycles with floating point instructions and it will be very useful
> for their usages instead of using soft-float.
>
> That's the reason they ask us to provide such kind of CONFIG and we think it
> might also be helpful for users who are trying to do some mathematics with
> floating point instructions in u-Boot.
>

I will have to leave this to other people to comment. I personally do
not like this to be supported in the upstream U-Boot. However if
others do not object, I am OK too.

Regards,
Bin

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

end of thread, other threads:[~2019-05-29  3:21 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-21  7:18 [U-Boot] [PATCH] riscv: add Kconfig entries for the F and D ISA extensions support Eric Lin
2019-05-21  7:55 ` Bin Meng
2019-05-22  8:22   ` tesheng at andestech.com
2019-05-22  9:25     ` Bin Meng
2019-05-24  8:04       ` Eric Lin
2019-05-24  8:21         ` [U-Boot] Fwd: " Eric Lin
2019-05-24  8:38         ` Eric Lin
2019-05-24  9:40         ` [U-Boot] " Bin Meng
2019-05-28  7:54           ` Greentime Hu
2019-05-28  9:58             ` Bin Meng
2019-05-28 10:50               ` Greentime Hu
2019-05-29  3:21                 ` Bin Meng

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.