Lines Matching refs:rd

70 static void emit_hppa_copy(const s8 rs, const s8 rd, struct hppa_jit_context *ctx)  in emit_hppa_copy()  argument
72 REG_SET_SEEN(ctx, rd); in emit_hppa_copy()
73 if (OPTIMIZE_HPPA && (rs == rd)) in emit_hppa_copy()
76 emit(hppa_copy(rs, rd), ctx); in emit_hppa_copy()
135 static void emit_imm32(u8 rd, s32 imm, struct hppa_jit_context *ctx) in emit_imm32() argument
139 REG_SET_SEEN(ctx, rd); in emit_imm32()
141 emit(hppa_ldi(imm, rd), ctx); in emit_imm32()
145 emit(hppa_ldo(lower, HPPA_REG_ZERO, rd), ctx); in emit_imm32()
148 emit(hppa_ldil(imm, rd), ctx); in emit_imm32()
151 emit(hppa_ldo(lower, rd, rd), ctx); in emit_imm32()
160 static void emit_imm(u8 rd, s64 imm, u8 tmpreg, struct hppa_jit_context *ctx) in emit_imm() argument
165 emit_imm32(rd, imm, ctx); in emit_imm()
175 emit_hppa64_depd(tmpreg, 31, 32, rd, 1, ctx); in emit_imm()
177 emit_hppa64_depd(HPPA_REG_ZERO, 31, 32, rd, 1, ctx); in emit_imm()
248 static int emit_branch(u8 op, u8 rd, u8 rs, signed long paoff, in emit_branch() argument
260 emit(hppa_and(rd, rs, HPPA_REG_T0), ctx); in emit_branch()
262 rd = HPPA_REG_T0; in emit_branch()
285 emit(hppa_beq(rd, rs, off), ctx); in emit_branch()
288 emit(hppa_bgtu(rd, rs, off), ctx); in emit_branch()
291 emit(hppa_bltu(rd, rs, off), ctx); in emit_branch()
294 emit(hppa_bgeu(rd, rs, off), ctx); in emit_branch()
297 emit(hppa_bleu(rd, rs, off), ctx); in emit_branch()
300 emit(hppa_bne(rd, rs, off), ctx); in emit_branch()
303 emit(hppa_bgt(rd, rs, off), ctx); in emit_branch()
306 emit(hppa_blt(rd, rs, off), ctx); in emit_branch()
309 emit(hppa_bge(rd, rs, off), ctx); in emit_branch()
312 emit(hppa_ble(rd, rs, off), ctx); in emit_branch()
407 static void init_regs(u8 *rd, u8 *rs, const struct bpf_insn *insn, in init_regs() argument
419 *rd = bpf_to_hppa_reg(insn->dst_reg, ctx); in init_regs()
428 static void emit_zext_32_rd_rs(u8 *rd, u8 *rs, struct hppa_jit_context *ctx) in emit_zext_32_rd_rs() argument
430 emit_hppa64_zext32(*rd, HPPA_REG_T2, ctx); in emit_zext_32_rd_rs()
431 *rd = HPPA_REG_T2; in emit_zext_32_rd_rs()
436 static void emit_sext_32_rd_rs(u8 *rd, u8 *rs, struct hppa_jit_context *ctx) in emit_sext_32_rd_rs() argument
438 emit_hppa64_sext32(*rd, HPPA_REG_T2, ctx); in emit_sext_32_rd_rs()
439 *rd = HPPA_REG_T2; in emit_sext_32_rd_rs()
444 static void emit_zext_32_rd_t1(u8 *rd, struct hppa_jit_context *ctx) in emit_zext_32_rd_t1() argument
446 emit_hppa64_zext32(*rd, HPPA_REG_T2, ctx); in emit_zext_32_rd_t1()
447 *rd = HPPA_REG_T2; in emit_zext_32_rd_t1()
451 static void emit_sext_32_rd(u8 *rd, struct hppa_jit_context *ctx) in emit_sext_32_rd() argument
453 emit_hppa64_sext32(*rd, HPPA_REG_T2, ctx); in emit_sext_32_rd()
454 *rd = HPPA_REG_T2; in emit_sext_32_rd()
554 static void emit_store(const s8 rd, const s8 rs, s16 off, in emit_store() argument
562 dstreg = rd; in emit_store()
566 emit(hppa_addil(off, rd), ctx); in emit_store()
600 u8 rd = -1, rs = -1, code = insn->code; in bpf_jit_emit_insn() local
604 init_regs(&rd, &rs, insn, ctx); in bpf_jit_emit_insn()
612 emit_zext_32(rd, ctx); in bpf_jit_emit_insn()
616 emit_hppa64_zext32(rs, rd, ctx); in bpf_jit_emit_insn()
618 emit_hppa_copy(rs, rd, ctx); in bpf_jit_emit_insn()
624 emit(hppa_add(rd, rs, rd), ctx); in bpf_jit_emit_insn()
626 emit_zext_32(rd, ctx); in bpf_jit_emit_insn()
630 emit(hppa_sub(rd, rs, rd), ctx); in bpf_jit_emit_insn()
632 emit_zext_32(rd, ctx); in bpf_jit_emit_insn()
636 emit(hppa_and(rd, rs, rd), ctx); in bpf_jit_emit_insn()
638 emit_zext_32(rd, ctx); in bpf_jit_emit_insn()
642 emit(hppa_or(rd, rs, rd), ctx); in bpf_jit_emit_insn()
644 emit_zext_32(rd, ctx); in bpf_jit_emit_insn()
648 emit(hppa_xor(rd, rs, rd), ctx); in bpf_jit_emit_insn()
649 if (!is64 && !aux->verifier_zext && rs != rd) in bpf_jit_emit_insn()
650 emit_zext_32(rd, ctx); in bpf_jit_emit_insn()
659 emit_call_libgcc_ll(__muldi3, rd, rs, code, ctx); in bpf_jit_emit_insn()
661 emit_zext_32(rd, ctx); in bpf_jit_emit_insn()
670 emit_call_libgcc_ll(&hppa_div64, rd, rs, code, ctx); in bpf_jit_emit_insn()
672 emit_zext_32(rd, ctx); in bpf_jit_emit_insn()
681 emit_call_libgcc_ll(&hppa_div64_rem, rd, rs, code, ctx); in bpf_jit_emit_insn()
683 emit_zext_32(rd, ctx); in bpf_jit_emit_insn()
691 emit(hppa64_depdz_sar(rd, rd), ctx); in bpf_jit_emit_insn()
693 emit(hppa_depwz_sar(rd, rd), ctx); in bpf_jit_emit_insn()
695 emit_zext_32(rd, ctx); in bpf_jit_emit_insn()
701 emit(hppa64_shrpd_sar(rd, rd), ctx); in bpf_jit_emit_insn()
703 emit(hppa_shrpw_sar(rd, rd), ctx); in bpf_jit_emit_insn()
705 emit_zext_32(rd, ctx); in bpf_jit_emit_insn()
712 emit(hppa_extrd_sar(rd, rd, 1), ctx); in bpf_jit_emit_insn()
714 emit(hppa_extrws_sar(rd, rd), ctx); in bpf_jit_emit_insn()
716 emit_zext_32(rd, ctx); in bpf_jit_emit_insn()
722 emit(hppa_sub(HPPA_REG_ZERO, rd, rd), ctx); in bpf_jit_emit_insn()
724 emit_zext_32(rd, ctx); in bpf_jit_emit_insn()
732 emit_hppa64_depd(HPPA_REG_ZERO, 63-16, 64-16, rd, 1, ctx); in bpf_jit_emit_insn()
736 emit_zext_32(rd, ctx); in bpf_jit_emit_insn()
747 emit(hppa_extru(rd, 31 - 8, 8, HPPA_REG_T1), ctx); in bpf_jit_emit_insn()
748 emit(hppa_depwz(rd, 23, 8, HPPA_REG_T1), ctx); in bpf_jit_emit_insn()
749 emit(hppa_extru(HPPA_REG_T1, 31, 16, rd), ctx); in bpf_jit_emit_insn()
750 emit_hppa64_extrd(HPPA_REG_T1, 63, 16, rd, 0, ctx); in bpf_jit_emit_insn()
753 emit(hppa_shrpw(rd, rd, 16, HPPA_REG_T1), ctx); in bpf_jit_emit_insn()
755 emit(hppa_shrpw(rd, HPPA_REG_T1, 8, HPPA_REG_T1), ctx); in bpf_jit_emit_insn()
756 emit_hppa64_extrd(HPPA_REG_T1, 63, 32, rd, 0, ctx); in bpf_jit_emit_insn()
759 emit(hppa64_permh_3210(rd, HPPA_REG_T1), ctx); in bpf_jit_emit_insn()
762 emit(hppa_or(HPPA_REG_T2, HPPA_REG_T1, rd), ctx); in bpf_jit_emit_insn()
773 emit_imm(rd, imm, HPPA_REG_T2, ctx); in bpf_jit_emit_insn()
775 emit_zext_32(rd, ctx); in bpf_jit_emit_insn()
782 emit(hppa_ldo(imm, rd, rd), ctx); in bpf_jit_emit_insn()
785 emit(hppa_add(rd, HPPA_REG_T1, rd), ctx); in bpf_jit_emit_insn()
788 emit_zext_32(rd, ctx); in bpf_jit_emit_insn()
793 emit(hppa_ldo(-imm, rd, rd), ctx); in bpf_jit_emit_insn()
796 emit(hppa_sub(rd, HPPA_REG_T1, rd), ctx); in bpf_jit_emit_insn()
799 emit_zext_32(rd, ctx); in bpf_jit_emit_insn()
804 emit(hppa_and(rd, HPPA_REG_T1, rd), ctx); in bpf_jit_emit_insn()
806 emit_zext_32(rd, ctx); in bpf_jit_emit_insn()
811 emit(hppa_or(rd, HPPA_REG_T1, rd), ctx); in bpf_jit_emit_insn()
813 emit_zext_32(rd, ctx); in bpf_jit_emit_insn()
818 emit(hppa_xor(rd, HPPA_REG_T1, rd), ctx); in bpf_jit_emit_insn()
820 emit_zext_32(rd, ctx); in bpf_jit_emit_insn()
825 emit_hppa64_shld(rd, imm, rd, ctx); in bpf_jit_emit_insn()
829 emit_zext_32(rd, ctx); in bpf_jit_emit_insn()
835 emit_hppa64_shrd(rd, imm, rd, false, ctx); in bpf_jit_emit_insn()
837 emit_hppa64_shrw(rd, imm, rd, false, ctx); in bpf_jit_emit_insn()
841 emit_zext_32(rd, ctx); in bpf_jit_emit_insn()
847 emit_hppa64_shrd(rd, imm, rd, true, ctx); in bpf_jit_emit_insn()
849 emit_hppa64_shrw(rd, imm, rd, true, ctx); in bpf_jit_emit_insn()
853 emit_zext_32(rd, ctx); in bpf_jit_emit_insn()
891 emit_sext_32_rd_rs(&rd, &rs, ctx); in bpf_jit_emit_insn()
893 emit_zext_32_rd_rs(&rd, &rs, ctx); in bpf_jit_emit_insn()
902 emit(hppa_and(rs, rd, HPPA_REG_T1), ctx); in bpf_jit_emit_insn()
906 emit_branch(BPF_OP(code), rd, rs, paoff, ctx); in bpf_jit_emit_insn()
941 emit_sext_32_rd(&rd, ctx); in bpf_jit_emit_insn()
943 emit_zext_32_rd_t1(&rd, ctx); in bpf_jit_emit_insn()
949 emit_branch(BPF_OP(code), rd, rs, paoff, ctx); in bpf_jit_emit_insn()
956 emit(hppa_and(HPPA_REG_T1, rd, HPPA_REG_T1), ctx); in bpf_jit_emit_insn()
1005 emit_imm(rd, imm64, HPPA_REG_T2, ctx); in bpf_jit_emit_insn()
1029 BUG_ON(rd == HPPA_REG_R1); in bpf_jit_emit_insn()
1036 emit(hppa_ldb(off, srcreg, rd), ctx); in bpf_jit_emit_insn()
1041 emit(hppa_ldh(off, srcreg, rd), ctx); in bpf_jit_emit_insn()
1046 emit(hppa_ldw(off, srcreg, rd), ctx); in bpf_jit_emit_insn()
1053 emit(hppa64_ldd_reg(HPPA_REG_ZERO, HPPA_REG_R1, rd), ctx); in bpf_jit_emit_insn()
1055 emit(hppa64_ldd_im5(off, srcreg, rd), ctx); in bpf_jit_emit_insn()
1057 emit(hppa64_ldd_im16(off, srcreg, rd), ctx); in bpf_jit_emit_insn()
1082 emit_store(rd, rs, off, ctx, BPF_SIZE(code), BPF_MODE(code)); in bpf_jit_emit_insn()