Skip to content

Commit fc18d6d

Browse files
zqb-alljmontleon
authored andcommitted
riscv: support enable more ISA for compare
Add ISA zba zbb zbc zbs zicond config RISCV_ISA_ZBA port form commit c12603e Author: Xiao Wang <[email protected]> Date: Thu May 16 17:04:30 2024 +0800 riscv, bpf: Optimize zextw insn with Zba extension config RISCV_ISA_ZBC port form commit a43fe27 Author: Xiao Wang <[email protected]> Date: Fri Jun 21 13:47:07 2024 +0800 riscv: Optimize crc32 with Zbc extension Change-Id: Ic77b3fd8bd3b167840e4183aea2e0757ab90e330
1 parent 1a1dad1 commit fc18d6d

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed

arch/riscv/Kconfig

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,18 @@ config TOOLCHAIN_HAS_ZBB
587587
depends on LLD_VERSION >= 150000 || LD_VERSION >= 23900
588588
depends on AS_HAS_OPTION_ARCH
589589

590+
config RISCV_ISA_ZBA
591+
bool "Zba extension support for bit manipulation instructions"
592+
default y
593+
help
594+
Add support for enabling optimisations in the kernel when the Zba
595+
extension is detected at boot.
596+
597+
The Zba extension provides instructions to accelerate the generation
598+
of addresses that index into arrays of basic data types.
599+
600+
If you don't know what to do here, say Y.
601+
590602
config RISCV_ISA_ZBB
591603
bool "Zbb extension support for bit manipulation instructions"
592604
depends on TOOLCHAIN_HAS_ZBB
@@ -603,6 +615,31 @@ config RISCV_ISA_ZBB
603615

604616
If you don't know what to do here, say Y.
605617

618+
config RISCV_ISA_ZBC
619+
bool "Zbc extension support for carry-less multiplication instructions"
620+
depends on MMU
621+
depends on RISCV_ALTERNATIVE
622+
default y
623+
help
624+
Adds support to dynamically detect the presence of the Zbc
625+
extension (carry-less multiplication) and enable its usage.
626+
627+
The Zbc extension could accelerate CRC (cyclic redundancy check)
628+
calculations.
629+
630+
If you don't know what to do here, say Y.
631+
632+
config RISCV_ISA_ZBS
633+
bool "Zbs extension support for single-bit instructions"
634+
depends on MMU
635+
depends on RISCV_ALTERNATIVE
636+
default y
637+
help
638+
Adds support to dynamically detect the presence of the Zbs
639+
extension (single-bit) and enable its usage.
640+
641+
If you don't know what to do here, say Y.
642+
606643
config RISCV_ISA_ZICBOM
607644
bool "Zicbom extension support for non-coherent DMA operation"
608645
depends on MMU
@@ -633,6 +670,18 @@ config RISCV_ISA_ZICBOZ
633670

634671
If you don't know what to do here, say Y.
635672

673+
config RISCV_ISA_ZICOND
674+
bool "Zicond extension support for conditional arithmetic and conditional-select/move operations"
675+
depends on MMU
676+
depends on RISCV_ALTERNATIVE
677+
default y
678+
help
679+
Adds support to dynamically detect the presence of the Zicond
680+
extension and enable its usage.
681+
682+
If you don't know what to do here, say Y.
683+
684+
636685
config TOOLCHAIN_HAS_ZIHINTPAUSE
637686
bool
638687
default y

arch/riscv/Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ riscv-march-$(CONFIG_ARCH_RV64I) := rv64ima
6464
riscv-march-$(CONFIG_FPU) := $(riscv-march-y)fd
6565
riscv-march-$(CONFIG_RISCV_ISA_C) := $(riscv-march-y)c
6666
riscv-march-$(CONFIG_RISCV_ISA_V) := $(riscv-march-y)v
67+
riscv-march-$(CONFIG_RISCV_ISA_ZBA) := $(riscv-march-y)_zba
68+
riscv-march-$(CONFIG_RISCV_ISA_ZBB) := $(riscv-march-y)_zbb
69+
riscv-march-$(CONFIG_RISCV_ISA_ZBC) := $(riscv-march-y)_zbc
70+
riscv-march-$(CONFIG_RISCV_ISA_ZBS) := $(riscv-march-y)_zbs
71+
riscv-march-$(CONFIG_RISCV_ISA_ZICOND) := $(riscv-march-y)_zicond
6772

6873
ifdef CONFIG_TOOLCHAIN_NEEDS_OLD_ISA_SPEC
6974
KBUILD_CFLAGS += -Wa,-misa-spec=2.2

0 commit comments

Comments
 (0)