Lines Matching defs:rvoff

254 static void emit_bcc(u8 cond, u8 rd, u8 rs, int rvoff,
259 emit(rv_beq(rd, rs, rvoff >> 1), ctx);
262 emit(rv_bltu(rs, rd, rvoff >> 1), ctx);
265 emit(rv_bltu(rd, rs, rvoff >> 1), ctx);
268 emit(rv_bgeu(rd, rs, rvoff >> 1), ctx);
271 emit(rv_bgeu(rs, rd, rvoff >> 1), ctx);
274 emit(rv_bne(rd, rs, rvoff >> 1), ctx);
277 emit(rv_blt(rs, rd, rvoff >> 1), ctx);
280 emit(rv_blt(rd, rs, rvoff >> 1), ctx);
283 emit(rv_bge(rd, rs, rvoff >> 1), ctx);
286 emit(rv_bge(rs, rd, rvoff >> 1), ctx);
290 static void emit_branch(u8 cond, u8 rd, u8 rs, int rvoff,
295 if (is_13b_int(rvoff)) {
296 emit_bcc(cond, rd, rs, rvoff, ctx);
301 rvoff -= 4;
312 if (is_21b_int(rvoff)) {
314 emit(rv_jal(RV_REG_ZERO, rvoff >> 1), ctx);
318 /* 32b No need for an additional rvoff adjustment, since we
321 upper = (rvoff + (1 << 11)) >> 12;
322 lower = rvoff & 0xfff;
440 static int emit_jump_and_link(u8 rd, s64 rvoff, bool fixed_addr,
445 if (rvoff && fixed_addr && is_21b_int(rvoff)) {
446 emit(rv_jal(rd, rvoff >> 1), ctx);
448 } else if (in_auipc_jalr_range(rvoff)) {
449 upper = (rvoff + (1 << 11)) >> 12;
450 lower = rvoff & 0xfff;
456 pr_err("bpf-jit: target offset 0x%llx is out of range\n", rvoff);
653 s64 rvoff;
665 rvoff = (s64)(target - ip);
666 return emit_jump_and_link(is_call ? RV_REG_T0 : RV_REG_ZERO, rvoff, false, &ctx);
1074 int s, e, rvoff, ret, i = insn - ctx->prog->insnsi;
1388 rvoff = rv_offset(i, off, ctx);
1390 rvoff = rv_offset(i, imm, ctx);
1391 ret = emit_jump_and_link(RV_REG_ZERO, rvoff, true, ctx);
1419 rvoff = rv_offset(i, off, ctx);
1429 rvoff -= ninsns_rvoff(e - s);
1434 rvoff -= 4;
1436 emit_branch(BPF_JNE, RV_REG_T1, RV_REG_ZERO, rvoff,
1439 emit_branch(BPF_OP(code), rd, rs, rvoff, ctx);
1464 rvoff = rv_offset(i, off, ctx);
1482 rvoff -= ninsns_rvoff(e - s);
1483 emit_branch(BPF_OP(code), rd, rs, rvoff, ctx);
1488 rvoff = rv_offset(i, off, ctx);
1503 rvoff -= ninsns_rvoff(e - s);
1504 emit_branch(BPF_JNE, RV_REG_T1, RV_REG_ZERO, rvoff, ctx);
1538 rvoff = epilogue_offset(ctx);
1539 ret = emit_jump_and_link(RV_REG_ZERO, rvoff, true, ctx);