Loading arch/loongarch/net/bpf_jit.c +25 −9 Original line number Diff line number Diff line Loading @@ -553,20 +553,36 @@ static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx, bool ext /* dst = dst / src */ case BPF_ALU | BPF_DIV | BPF_X: case BPF_ALU64 | BPF_DIV | BPF_X: if (!off) { emit_zext_32(ctx, dst, is32); move_reg(ctx, t1, src); emit_zext_32(ctx, t1, is32); emit_insn(ctx, divdu, dst, dst, t1); emit_zext_32(ctx, dst, is32); } else { emit_sext_32(ctx, dst, is32); move_reg(ctx, t1, src); emit_sext_32(ctx, t1, is32); emit_insn(ctx, divd, dst, dst, t1); emit_sext_32(ctx, dst, is32); } break; /* dst = dst / imm */ case BPF_ALU | BPF_DIV | BPF_K: case BPF_ALU64 | BPF_DIV | BPF_K: if (!off) { move_imm(ctx, t1, imm, is32); emit_zext_32(ctx, dst, is32); emit_insn(ctx, divdu, dst, dst, t1); emit_zext_32(ctx, dst, is32); } else { move_imm(ctx, t1, imm, false); emit_sext_32(ctx, t1, is32); emit_sext_32(ctx, dst, is32); emit_insn(ctx, divd, dst, dst, t1); emit_sext_32(ctx, dst, is32); } break; /* dst = dst % src */ Loading Loading
arch/loongarch/net/bpf_jit.c +25 −9 Original line number Diff line number Diff line Loading @@ -553,20 +553,36 @@ static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx, bool ext /* dst = dst / src */ case BPF_ALU | BPF_DIV | BPF_X: case BPF_ALU64 | BPF_DIV | BPF_X: if (!off) { emit_zext_32(ctx, dst, is32); move_reg(ctx, t1, src); emit_zext_32(ctx, t1, is32); emit_insn(ctx, divdu, dst, dst, t1); emit_zext_32(ctx, dst, is32); } else { emit_sext_32(ctx, dst, is32); move_reg(ctx, t1, src); emit_sext_32(ctx, t1, is32); emit_insn(ctx, divd, dst, dst, t1); emit_sext_32(ctx, dst, is32); } break; /* dst = dst / imm */ case BPF_ALU | BPF_DIV | BPF_K: case BPF_ALU64 | BPF_DIV | BPF_K: if (!off) { move_imm(ctx, t1, imm, is32); emit_zext_32(ctx, dst, is32); emit_insn(ctx, divdu, dst, dst, t1); emit_zext_32(ctx, dst, is32); } else { move_imm(ctx, t1, imm, false); emit_sext_32(ctx, t1, is32); emit_sext_32(ctx, dst, is32); emit_insn(ctx, divd, dst, dst, t1); emit_sext_32(ctx, dst, is32); } break; /* dst = dst % src */ Loading