Skip to content

Backport subject : "bpf JIT optimization based on Zba and Zbb extension" #127

Description

@uestc-gr

为 RV64 JIT 添加 Zbb 支持,以优化代码大小和性能。同时,对代码进行调整以实现统一和简化。合入以下补丁
06a33d0 riscv, bpf: Optimize bswap insns with Zbb support
519fb72 riscv, bpf: Optimize sign-extention mov insns with Zbb support
647b93f riscv, bpf: Add necessary Zbb instructions
361db44 riscv, bpf: Simplify sext and zext logics in branch instructions
914c7a5 riscv, bpf: Unify 32-bit zero-extension to emit_zextw
e33758f riscv, bpf: Unify 32-bit sign-extension to emit_sextw

RISC-V 的 Zba 扩展提供了用于加速对基本数据类型数组进行索引的地址生成的指令。通过利用 Zba 进行地址计算,可以减少 BPF JIT 生成的指令数量。

第一个补丁引入了 RISCV_ISA_ZBA Kconfig 选项,并使用 Zba 的 add.uw 指令来优化 zextw 操作。
c12603e riscv, bpf: Optimize zextw insn with Zba extension

第二个补丁使用 Zba 的移位和加法指令来优化对无符号长整型数据数组的地址计算。
96a27ee riscv, bpf: Introduce shift add helper with Zba optimization

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions