File tree Expand file tree Collapse file tree 2 files changed +36
-1
lines changed Expand file tree Collapse file tree 2 files changed +36
-1
lines changed Original file line number Diff line number Diff line change @@ -466,6 +466,37 @@ config RISCV_ISA_SVPBMT
466
466
467
467
If you don't know what to do here, say Y.
468
468
469
+ config TOOLCHAIN_HAS_V
470
+ bool
471
+ default y
472
+ depends on !64BIT || $(cc-option,-mabi=lp64 -march=rv64iv)
473
+ depends on !32BIT || $(cc-option,-mabi=ilp32 -march=rv32iv)
474
+ depends on LLD_VERSION >= 140000 || LD_VERSION >= 23800
475
+ depends on AS_HAS_OPTION_ARCH
476
+
477
+ config RISCV_ISA_V
478
+ bool "VECTOR extension support"
479
+ depends on TOOLCHAIN_HAS_V
480
+ depends on FPU
481
+ select DYNAMIC_SIGFRAME
482
+ default y
483
+ help
484
+ Say N here if you want to disable all vector related procedure
485
+ in the kernel.
486
+
487
+ If you don't know what to do here, say Y.
488
+
489
+ config RISCV_ISA_V_DEFAULT_ENABLE
490
+ bool "Enable userspace Vector by default"
491
+ depends on RISCV_ISA_V
492
+ default y
493
+ help
494
+ Say Y here if you want to enable Vector in userspace by default.
495
+ Otherwise, userspace has to make explicit prctl() call to enable
496
+ Vector, or enable it via the sysctl interface.
497
+
498
+ If you don't know what to do here, say Y.
499
+
469
500
config TOOLCHAIN_HAS_ZBB
470
501
bool
471
502
default y
Original file line number Diff line number Diff line change @@ -60,6 +60,7 @@ riscv-march-$(CONFIG_ARCH_RV32I) := rv32ima
60
60
riscv-march-$(CONFIG_ARCH_RV64I) := rv64ima
61
61
riscv-march-$(CONFIG_FPU) := $(riscv-march-y ) fd
62
62
riscv-march-$(CONFIG_RISCV_ISA_C) := $(riscv-march-y ) c
63
+ riscv-march-$(CONFIG_RISCV_ISA_V) := $(riscv-march-y ) v
63
64
64
65
ifdef CONFIG_TOOLCHAIN_NEEDS_OLD_ISA_SPEC
65
66
KBUILD_CFLAGS += -Wa,-misa-spec=2.2
71
72
# Check if the toolchain supports Zihintpause extension
72
73
riscv-march-$(CONFIG_TOOLCHAIN_HAS_ZIHINTPAUSE) := $(riscv-march-y ) _zihintpause
73
74
74
- KBUILD_CFLAGS += -march=$(subst fd,,$(riscv-march-y ) )
75
+ # Remove F,D,V from isa string for all. Keep extensions between "fd" and "v" by
76
+ # matching non-v and non-multi-letter extensions out with the filter ([^v_]*)
77
+ KBUILD_CFLAGS += -march=$(shell echo $(riscv-march-y ) | sed -E 's/(rv32ima|rv64ima) fd([^v_]*)v?/\1\2/')
78
+
75
79
KBUILD_AFLAGS += -march=$(riscv-march-y )
76
80
77
81
KBUILD_CFLAGS += -mno-save-restore
You can’t perform that action at this time.
0 commit comments