Skip to contentSkip to conversation

riscv: add Kconfig entries for the F and D ISA extensions support

PATCH New Eric Lin 3 participants 4 messages Jun 6, 2019 – Feb 5, 2020 RISC-V

lore
Share & tools
lore

Eric Lin

author
#0 lore raw

PATCH v3 1/1 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.

---
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(-)
arch/riscv/Kconfig +14 -0
index 362f3cdc65..7a2463ffe2 100644
@@ -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
 
arch/riscv/Makefile +12 -4
index 0b80eb8d86..f834d11720 100644
@@ -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)
Signature · 1 line
2.17.0
#1 lore raw

PATCH v3 1/1 riscv: add Kconfig entries for the F and D ISA extensions support

Quoted 10 lines · Eric Lin

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

---
Changes for v2:
- Grammatical correction in commit message "adds"
- Fixed the config name to indicate both F and D

Quoted 7 lines

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(-)

@Eric Lin @Rick Chen

This patch was never applied. Do we still need this patch?

Regards,
Bin

#2 lore raw

PATCH v3 1/1 riscv: add Kconfig entries for the F and D ISA extensions support

Hi Bin,

Bin Meng <[email protected]> 於 2020年2月4日 週二 下午11:50寫道:

Quoted 20 lines · Eric Lin
Quoted 10 lines

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

---
Changes for v2:
- Grammatical correction in commit message "adds"
- Fixed the config name to indicate both F and D

Quoted 7 lines

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(-)
Quoted 6 lines

@Eric Lin @Rick Chen

This patch was never applied. Do we still need this patch?

I think this patch is unnecessary now. Thanks.

Quoted 2 lines

Regards,
Bin

Regards,
Eric

#3 lore raw

PATCH v3 1/1 riscv: add Kconfig entries for the F and D ISA extensions support

Quoted 25 lines · Eric Lin

Hi Bin,

Bin Meng <[email protected]> 於 2020年2月4日 週二 下午11:50寫道:

Quoted 20 lines · Eric Lin
Quoted 17 lines

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

---
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(-)
Quoted 8 lines
Quoted 6 lines

@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