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 <hengqi.chen@gmail.com> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
This commit is contained in:
parent
f48012f161
commit
4ebf9216e7
@ -731,6 +731,7 @@ static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx, bool ext
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case BPF_ALU | BPF_END | BPF_FROM_BE:
|
case BPF_ALU | BPF_END | BPF_FROM_BE:
|
||||||
|
case BPF_ALU64 | BPF_END | BPF_FROM_LE:
|
||||||
switch (imm) {
|
switch (imm) {
|
||||||
case 16:
|
case 16:
|
||||||
emit_insn(ctx, revb2h, dst, dst);
|
emit_insn(ctx, revb2h, dst, dst);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user