Lines Matching defs:rd

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