Home GnuPG

Require RISC-V B extension for vector intrinsics implementations

Description

Require RISC-V B extension for vector intrinsics implementations

* cipher/Makefile.am (riscv_vector_cflags, riscv_vector_crypto_aes_cflags)
(riscv_vector_crypto_sha_cflags, riscv_vector_crypto_gcm_cflags): Use
MARCH_RVA22U64_WITH_VEC and MARCH_RVA23U64_BASE.
* cipher/chacha20.c (chacha20_do_setkey) [USE_RISCV_V]: Require HWF_RISCV_B.
* cipher/cipher-gcm.c (setupM) [GCM_UNSE_RISCV_ZVKG]: Likewise.
* cipher/rijndael.c (do_setkey) [USE_RISCV_V_CRYPTO]: Likewise.
(do_setkey) [USE_VP_RISCV]: Likewise.
* cipher/sha256.c (sha256_common_init) [USE_RISCV_V_CRYPTO]: Likewise.
* cipher/sha512.c (sha512_init_common) [USE_RISCV_V_CRYPTO]: Likewise.
* doc/gcrypt.texi: Document riscv-imafdc, riscv-b, riscv-v, riscv-zbb,
riscv-zbc, riscv-zvkb, riscv-zvkg, riscv-zvkned, riscv-zvknha and
riscv-zvknhb as supported hardware features.
* configure.ac (MARCH_RVA22U64_WITH_VEC, MARCH_RVA23U64_BASE)
(MARCH_RVA23U64_WITH_VEC_CRYPTO): New.
* src/g10lib.h (HWF_RISCV_B): Insert before HWF_RISCV_V.
* src/hwf-riscv.c (hwcap_features, hwprobe_features): Add HWF_RISCV_V.
(detect_riscv_hwf_by_toolchain) [__riscv_zba&&__riscv_zbb&&__riscv_zbs]: Add
faulty toolchain check for B extension.
* src/hwfeatures.c (hwflist) [HAVE_CPU_ARCH_RISCV]: Add "riscv-b".

Patch adds B extension as requirement for vector intrinsics implementations
to improve code generation. B extension is mandatory in RVA22U64 profile.
It is unlikely to encounter V extension (optional in RVA22U64, mandatory
in RVA23U64) without B extension.

  • Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>

Details

Provenance
jukiviliAuthored on Sat, Aug 16, 8:14 PM
Parents
rCab4fa2a19c9f: Add RISC-V Zbb+Zbc implementation of CRC
Branches
Unknown
Tags
Unknown