riscv, bpf: Simplify sext and zext logics in branch instructions
authorPu Lehui <pulehui@huawei.com>
Mon, 15 Jan 2024 13:12:32 +0000 (13:12 +0000)
committerDaniel Borkmann <daniel@iogearbox.net>
Mon, 29 Jan 2024 15:25:33 +0000 (16:25 +0100)
commit361db44c3c59cde05e9926647f16255e274a37f4
tree5a95a54d3a7fbc93b9d4dbf3205b4f854f562ace
parent914c7a5ff18a225f7df254ae3433574f3d47b711
riscv, bpf: Simplify sext and zext logics in branch instructions

There are many extension helpers in the current branch instructions, and
the implementation is a bit complicated. We simplify this logic through
two simple extension helpers with alternate register.

Signed-off-by: Pu Lehui <pulehui@huawei.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Tested-by: Björn Töpel <bjorn@rivosinc.com>
Acked-by: Björn Töpel <bjorn@kernel.org>
Link: https://lore.kernel.org/bpf/20240115131235.2914289-4-pulehui@huaweicloud.com
arch/riscv/net/bpf_jit_comp64.c