Skip to content

Commit 4ebf921

Browse files
chenhengqichenhuacai
authored andcommitted
LoongArch: BPF: Support unconditional bswap instructions
Add support for unconditional bswap instruction. Since LoongArch is always little-endian, just treat unconditional bswap the same as big- endian conversion. Signed-off-by: Hengqi Chen <[email protected]> Signed-off-by: Huacai Chen <[email protected]>
1 parent f48012f commit 4ebf921

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

arch/loongarch/net/bpf_jit.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -731,6 +731,7 @@ static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx, bool ext
731731
break;
732732

733733
case BPF_ALU | BPF_END | BPF_FROM_BE:
734+
case BPF_ALU64 | BPF_END | BPF_FROM_LE:
734735
switch (imm) {
735736
case 16:
736737
emit_insn(ctx, revb2h, dst, dst);

0 commit comments

Comments
 (0)