From d807e39a2cbfa28d5a5b60a663c43ea9b3b95fd2 Mon Sep 17 00:00:00 2001 From: Andy Lin Date: Wed, 7 Jan 2026 01:42:17 +0800 Subject: [PATCH] arch: riscv: Add the support for Zbkb ISA extension Introduce the missing flag to compile code with Zbkb extension, which has already been supported by the GCC 12 in current SDK. Signed-off-by: Andy Lin --- arch/riscv/Kconfig.isa | 8 ++++++++ cmake/compiler/gcc/target_riscv.cmake | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/arch/riscv/Kconfig.isa b/arch/riscv/Kconfig.isa index c5ee324464d..f5df9b85eef 100644 --- a/arch/riscv/Kconfig.isa +++ b/arch/riscv/Kconfig.isa @@ -237,6 +237,14 @@ config RISCV_ISA_EXT_ZBC The Zbc instructions can be used for carry-less multiplication that is the multiplication in the polynomial ring over GF(2). +config RISCV_ISA_EXT_ZBKB + bool + help + (Zbkb) - Zbkb BitManip Extension (Bit-manipulation for Cryptography) + + The Zbkb instructions can be used for accelerating cryptography workloads + and contain rotation, reversion, packing and some advanced bit-manipulation. + config RISCV_ISA_EXT_ZBS bool help diff --git a/cmake/compiler/gcc/target_riscv.cmake b/cmake/compiler/gcc/target_riscv.cmake index e440d4e2b15..656b597a393 100644 --- a/cmake/compiler/gcc/target_riscv.cmake +++ b/cmake/compiler/gcc/target_riscv.cmake @@ -118,6 +118,10 @@ if(CONFIG_RISCV_ISA_EXT_ZBC) string(CONCAT riscv_march ${riscv_march} "_zbc") endif() +if(CONFIG_RISCV_ISA_EXT_ZBKB) + string(CONCAT riscv_march ${riscv_march} "_zbkb") +endif() + if(CONFIG_RISCV_ISA_EXT_ZBS) string(CONCAT riscv_march ${riscv_march} "_zbs") endif()