[U-Boot] [PATCH v3] riscv: add Kconfig entries for the F and D ISA extensions support

This patch adds Kconfig entries for the F (Single-Precision) and D (Double-Precision) floating point instruction-set extensions.
Signed-off-by: Eric Lin tesheng@andestech.com --- Changes for v2: - Grammatical correction in commit message "adds" - Fixed the config name to indicate both F and D
Changes for v3: - Separate the config name for ISA_F and ISA_D
arch/riscv/Kconfig | 14 ++++++++++++++ arch/riscv/Makefile | 16 ++++++++++++---- 2 files changed, 26 insertions(+), 4 deletions(-)
diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index 362f3cdc65..7a2463ffe2 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -91,6 +91,20 @@ config RISCV_ISA_C when building U-Boot, which results in compressed instructions in the U-Boot binary.
+config RISCV_ISA_F + bool "Emit single-precision floating-point instructions" + help + Adds "F" to the ISA subsets that the toolchain is allowed to emit + when building U-Boot, which results in single-precision instructions + in the U-Boot binary. + +config RISCV_ISA_D + bool "Emit double-precision floating-point instructions" + help + Adds "D" to the ISA subsets that the toolchain is allowed to emit + when building U-Boot, which results in 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..f834d11720 100644 --- a/arch/riscv/Makefile +++ b/arch/riscv/Makefile @@ -5,15 +5,23 @@
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 = f + ABI := $(ABI)f +endif +ifeq ($(CONFIG_RISCV_ISA_D),y) + ARCH_D = fd + ABI := $(ABI)d +endif ifeq ($(CONFIG_RISCV_ISA_C),y) ARCH_C = c endif @@ -24,8 +32,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_D)$(ARCH_C) -mabi=$(ABI) \ + -mcmodel=$(CMODEL)
PLATFORM_CPPFLAGS += $(ARCH_FLAGS) CFLAGS_EFI += $(ARCH_FLAGS)

On Thu, Jun 6, 2019 at 5:06 PM Eric Lin tesheng@andestech.com wrote:
This patch adds Kconfig entries for the F (Single-Precision) and D (Double-Precision) floating point instruction-set extensions.
Signed-off-by: Eric Lin tesheng@andestech.com
Changes for v2: - Grammatical correction in commit message "adds" - Fixed the config name to indicate both F and D
Changes for v3: - Separate the config name for ISA_F and ISA_D
arch/riscv/Kconfig | 14 ++++++++++++++ arch/riscv/Makefile | 16 ++++++++++++---- 2 files changed, 26 insertions(+), 4 deletions(-)
Reviewed-by: Bin Meng bmeng.cn@gmail.com
@Eric Lin @Rick Chen
This patch was never applied. Do we still need this patch?
Regards, Bin

Hi Bin,
Bin Meng bmeng.cn@gmail.com 於 2020年2月4日 週二 下午11:50寫道:
On Thu, Jun 6, 2019 at 5:06 PM Eric Lin tesheng@andestech.com wrote:
This patch adds Kconfig entries for the F (Single-Precision) and D (Double-Precision) floating point instruction-set extensions.
Signed-off-by: Eric Lin tesheng@andestech.com
Changes for v2: - Grammatical correction in commit message "adds" - Fixed the config name to indicate both F and D
Changes for v3: - Separate the config name for ISA_F and ISA_D
arch/riscv/Kconfig | 14 ++++++++++++++ arch/riscv/Makefile | 16 ++++++++++++---- 2 files changed, 26 insertions(+), 4 deletions(-)
Reviewed-by: Bin Meng bmeng.cn@gmail.com
@Eric Lin @Rick Chen
This patch was never applied. Do we still need this patch?
I think this patch is unnecessary now. Thanks.
Regards, Bin
Regards, Eric

On Wed, Feb 5, 2020 at 9:11 AM Eric Lin dslin1010@gmail.com wrote:
Hi Bin,
Bin Meng bmeng.cn@gmail.com 於 2020年2月4日 週二 下午11:50寫道:
On Thu, Jun 6, 2019 at 5:06 PM Eric Lin tesheng@andestech.com wrote:
This patch adds Kconfig entries for the F (Single-Precision) and D (Double-Precision) floating point instruction-set extensions.
Signed-off-by: Eric Lin tesheng@andestech.com
Changes for v2: - Grammatical correction in commit message "adds" - Fixed the config name to indicate both F and D
Changes for v3: - Separate the config name for ISA_F and ISA_D
arch/riscv/Kconfig | 14 ++++++++++++++ arch/riscv/Makefile | 16 ++++++++++++---- 2 files changed, 26 insertions(+), 4 deletions(-)
Reviewed-by: Bin Meng bmeng.cn@gmail.com
@Eric Lin @Rick Chen
This patch was never applied. Do we still need this patch?
I think this patch is unnecessary now. Thanks.
Thanks. I updated the patch status on patchwork.
Regards, Bin
participants (3)
-
Bin Meng
-
Eric Lin
-
Eric Lin