Lines Matching refs:rd
120 static void emit_hppa_copy(const s8 rs, const s8 rd, struct hppa_jit_context *ctx) in emit_hppa_copy() argument
122 REG_SET_SEEN(ctx, rd); in emit_hppa_copy()
123 if (OPTIMIZE_HPPA && (rs == rd)) in emit_hppa_copy()
126 emit(hppa_copy(rs, rd), ctx); in emit_hppa_copy()
141 static void emit_imm(const s8 rd, s32 imm, struct hppa_jit_context *ctx) in emit_imm() argument
145 REG_SET_SEEN(ctx, rd); in emit_imm()
147 emit(hppa_ldi(imm, rd), ctx); in emit_imm()
150 emit(hppa_ldil(imm, rd), ctx); in emit_imm()
153 emit(hppa_ldo(lower, rd, rd), ctx); in emit_imm()
156 static void emit_imm32(const s8 *rd, s32 imm, struct hppa_jit_context *ctx) in emit_imm32() argument
159 REG_SET_SEEN(ctx, lo(rd)); in emit_imm32()
160 emit_imm(lo(rd), imm, ctx); in emit_imm32()
163 REG_SET_SEEN(ctx, hi(rd)); in emit_imm32()
165 emit_hppa_copy(HPPA_REG_ZERO, hi(rd), ctx); in emit_imm32()
167 emit(hppa_ldi(-1, hi(rd)), ctx); in emit_imm32()
170 static void emit_imm64(const s8 *rd, s32 imm_hi, s32 imm_lo, in emit_imm64() argument
173 emit_imm(hi(rd), imm_hi, ctx); in emit_imm64()
174 emit_imm(lo(rd), imm_lo, ctx); in emit_imm64()
425 const s8 *rd; in emit_alu_i64() local
428 rd = bpf_get_reg64_ref(dst, tmp1, false, ctx); in emit_alu_i64()
430 rd = bpf_get_reg64(dst, tmp1, ctx); in emit_alu_i64()
435 emit_imm32(rd, imm, ctx); in emit_alu_i64()
439 emit(hppa_and(lo(rd), HPPA_REG_T0, lo(rd)), ctx); in emit_alu_i64()
441 emit_hppa_copy(HPPA_REG_ZERO, hi(rd), ctx); in emit_alu_i64()
445 emit(hppa_or(lo(rd), HPPA_REG_T0, lo(rd)), ctx); in emit_alu_i64()
447 emit_imm(hi(rd), -1, ctx); in emit_alu_i64()
451 emit_hppa_xor(lo(rd), HPPA_REG_T0, lo(rd), ctx); in emit_alu_i64()
454 emit_hppa_xor(hi(rd), HPPA_REG_T0, hi(rd), ctx); in emit_alu_i64()
462 emit(hppa_zdep(lo(rd), imm, imm, hi(rd)), ctx); in emit_alu_i64()
463 emit_hppa_copy(HPPA_REG_ZERO, lo(rd), ctx); in emit_alu_i64()
465 emit_hppa_copy(lo(rd), hi(rd), ctx); in emit_alu_i64()
466 emit_hppa_copy(HPPA_REG_ZERO, lo(rd), ctx); in emit_alu_i64()
468 emit(hppa_shd(hi(rd), lo(rd), 32 - imm, hi(rd)), ctx); in emit_alu_i64()
469 emit(hppa_zdep(lo(rd), imm, imm, lo(rd)), ctx); in emit_alu_i64()
477 emit(hppa_shr(hi(rd), imm, lo(rd)), ctx); in emit_alu_i64()
478 emit_hppa_copy(HPPA_REG_ZERO, hi(rd), ctx); in emit_alu_i64()
480 emit_hppa_copy(hi(rd), lo(rd), ctx); in emit_alu_i64()
481 emit_hppa_copy(HPPA_REG_ZERO, hi(rd), ctx); in emit_alu_i64()
483 emit(hppa_shrpw(hi(rd), lo(rd), imm, lo(rd)), ctx); in emit_alu_i64()
484 emit(hppa_shr(hi(rd), imm, hi(rd)), ctx); in emit_alu_i64()
492 emit(hppa_extrws(hi(rd), 31 - imm, imm, lo(rd)), ctx); in emit_alu_i64()
493 emit(hppa_extrws(hi(rd), 0, 31, hi(rd)), ctx); in emit_alu_i64()
495 emit_hppa_copy(hi(rd), lo(rd), ctx); in emit_alu_i64()
496 emit(hppa_extrws(hi(rd), 0, 31, hi(rd)), ctx); in emit_alu_i64()
498 emit(hppa_shrpw(hi(rd), lo(rd), imm, lo(rd)), ctx); in emit_alu_i64()
499 emit(hppa_extrws(hi(rd), 31 - imm, imm, hi(rd)), ctx); in emit_alu_i64()
506 bpf_put_reg64(dst, rd, ctx); in emit_alu_i64()
513 const s8 *rd = bpf_get_reg32(dst, tmp1, ctx); in emit_alu_i32() local
516 rd = bpf_get_reg32_ref(dst, tmp1, ctx); in emit_alu_i32()
518 rd = bpf_get_reg32(dst, tmp1, ctx); in emit_alu_i32()
523 emit_imm(lo(rd), imm, ctx); in emit_alu_i32()
527 emit(hppa_add(lo(rd), HPPA_REG_T0, lo(rd)), ctx); in emit_alu_i32()
531 emit(hppa_sub(lo(rd), HPPA_REG_T0, lo(rd)), ctx); in emit_alu_i32()
535 emit(hppa_and(lo(rd), HPPA_REG_T0, lo(rd)), ctx); in emit_alu_i32()
539 emit(hppa_or(lo(rd), HPPA_REG_T0, lo(rd)), ctx); in emit_alu_i32()
543 emit_hppa_xor(lo(rd), HPPA_REG_T0, lo(rd), ctx); in emit_alu_i32()
547 emit(hppa_zdep(lo(rd), imm, imm, lo(rd)), ctx); in emit_alu_i32()
551 emit(hppa_shr(lo(rd), imm, lo(rd)), ctx); in emit_alu_i32()
555 emit(hppa_extrws(lo(rd), 31 - imm, imm, lo(rd)), ctx); in emit_alu_i32()
561 bpf_put_reg32(dst, rd, ctx); in emit_alu_i32()
569 const s8 *rd; in emit_alu_r64() local
573 rd = bpf_get_reg64_ref(dst, tmp1, false, ctx); in emit_alu_r64()
575 rd = bpf_get_reg64(dst, tmp1, ctx); in emit_alu_r64()
580 emit_hppa_copy(lo(rs), lo(rd), ctx); in emit_alu_r64()
581 emit_hppa_copy(hi(rs), hi(rd), ctx); in emit_alu_r64()
584 emit(hppa_add(lo(rd), lo(rs), lo(rd)), ctx); in emit_alu_r64()
585 emit(hppa_addc(hi(rd), hi(rs), hi(rd)), ctx); in emit_alu_r64()
588 emit(hppa_sub(lo(rd), lo(rs), lo(rd)), ctx); in emit_alu_r64()
589 emit(hppa_subb(hi(rd), hi(rs), hi(rd)), ctx); in emit_alu_r64()
592 emit(hppa_and(lo(rd), lo(rs), lo(rd)), ctx); in emit_alu_r64()
593 emit(hppa_and(hi(rd), hi(rs), hi(rd)), ctx); in emit_alu_r64()
596 emit(hppa_or(lo(rd), lo(rs), lo(rd)), ctx); in emit_alu_r64()
597 emit(hppa_or(hi(rd), hi(rs), hi(rd)), ctx); in emit_alu_r64()
600 emit_hppa_xor(lo(rd), lo(rs), lo(rd), ctx); in emit_alu_r64()
601 emit_hppa_xor(hi(rd), hi(rs), hi(rd), ctx); in emit_alu_r64()
604 emit_call_libgcc_ll(__muldi3, rd, rs, op, ctx); in emit_alu_r64()
607 emit_call_libgcc_ll(&hppa_div64, rd, rs, op, ctx); in emit_alu_r64()
610 emit_call_libgcc_ll(&hppa_div64_rem, rd, rs, op, ctx); in emit_alu_r64()
613 emit_call_libgcc_ll(__ashldi3, rd, rs, op, ctx); in emit_alu_r64()
616 emit_call_libgcc_ll(__lshrdi3, rd, rs, op, ctx); in emit_alu_r64()
619 emit_call_libgcc_ll(__ashrdi3, rd, rs, op, ctx); in emit_alu_r64()
622 emit(hppa_sub(HPPA_REG_ZERO, lo(rd), lo(rd)), ctx); in emit_alu_r64()
623 emit(hppa_subb(HPPA_REG_ZERO, hi(rd), hi(rd)), ctx); in emit_alu_r64()
629 bpf_put_reg64(dst, rd, ctx); in emit_alu_r64()
637 const s8 *rd; in emit_alu_r32() local
641 rd = bpf_get_reg32_ref(dst, tmp1, ctx); in emit_alu_r32()
643 rd = bpf_get_reg32(dst, tmp1, ctx); in emit_alu_r32()
648 emit_hppa_copy(lo(rs), lo(rd), ctx); in emit_alu_r32()
651 emit(hppa_add(lo(rd), lo(rs), lo(rd)), ctx); in emit_alu_r32()
654 emit(hppa_sub(lo(rd), lo(rs), lo(rd)), ctx); in emit_alu_r32()
657 emit(hppa_and(lo(rd), lo(rs), lo(rd)), ctx); in emit_alu_r32()
660 emit(hppa_or(lo(rd), lo(rs), lo(rd)), ctx); in emit_alu_r32()
663 emit_hppa_xor(lo(rd), lo(rs), lo(rd), ctx); in emit_alu_r32()
666 emit_call_millicode($$mulI, lo(rd), lo(rs), op, ctx); in emit_alu_r32()
669 emit_call_millicode($$divU, lo(rd), lo(rs), op, ctx); in emit_alu_r32()
672 emit_call_millicode($$remU, lo(rd), lo(rs), op, ctx); in emit_alu_r32()
677 emit(hppa_depwz_sar(lo(rd), lo(rd)), ctx); in emit_alu_r32()
681 emit(hppa_shrpw_sar(lo(rd), lo(rd)), ctx); in emit_alu_r32()
687 emit(hppa_extrws_sar(lo(rd), lo(rd)), ctx); in emit_alu_r32()
690 emit(hppa_sub(HPPA_REG_ZERO, lo(rd), lo(rd)), ctx); // sub r0,rd,rd in emit_alu_r32()
696 bpf_put_reg32(dst, rd, ctx); in emit_alu_r32()
789 static int emit_bcc(u8 op, u8 rd, u8 rs, int paoff, struct hppa_jit_context *ctx) in emit_bcc() argument
800 emit(hppa_and(rd, rs, HPPA_REG_T0), ctx); in emit_bcc()
802 rd = HPPA_REG_T0; in emit_bcc()
824 emit(hppa_beq(rd, rs, off), ctx); in emit_bcc()
827 emit(hppa_bgtu(rd, rs, off), ctx); in emit_bcc()
830 emit(hppa_bltu(rd, rs, off), ctx); in emit_bcc()
833 emit(hppa_bgeu(rd, rs, off), ctx); in emit_bcc()
836 emit(hppa_bleu(rd, rs, off), ctx); in emit_bcc()
839 emit(hppa_bne(rd, rs, off), ctx); in emit_bcc()
842 emit(hppa_bgt(rd, rs, off), ctx); in emit_bcc()
845 emit(hppa_blt(rd, rs, off), ctx); in emit_bcc()
848 emit(hppa_bge(rd, rs, off), ctx); in emit_bcc()
851 emit(hppa_ble(rd, rs, off), ctx); in emit_bcc()
1011 const s8 *rd = bpf_get_reg64_ref(dst, tmp1, ctx->prog->aux->verifier_zext, ctx); in emit_load_r64() local
1028 emit(hppa_ldb(off + 0, srcreg, lo(rd)), ctx); in emit_load_r64()
1030 emit_hppa_copy(HPPA_REG_ZERO, hi(rd), ctx); in emit_load_r64()
1033 emit(hppa_ldh(off + 0, srcreg, lo(rd)), ctx); in emit_load_r64()
1035 emit_hppa_copy(HPPA_REG_ZERO, hi(rd), ctx); in emit_load_r64()
1038 emit(hppa_ldw(off + 0, srcreg, lo(rd)), ctx); in emit_load_r64()
1040 emit_hppa_copy(HPPA_REG_ZERO, hi(rd), ctx); in emit_load_r64()
1043 emit(hppa_ldw(off + 0, srcreg, hi(rd)), ctx); in emit_load_r64()
1044 emit(hppa_ldw(off + 4, srcreg, lo(rd)), ctx); in emit_load_r64()
1048 bpf_put_reg64(dst, rd, ctx); in emit_load_r64()
1058 const s8 *rd = bpf_get_reg64(dst, tmp1, ctx); in emit_store_r64() local
1064 dstreg = lo(rd); in emit_store_r64()
1068 emit(hppa_addil(off, lo(rd)), ctx); in emit_store_r64()
1092 static void emit_rev16(const s8 rd, struct hppa_jit_context *ctx) in emit_rev16() argument
1094 emit(hppa_extru(rd, 23, 8, HPPA_REG_T1), ctx); in emit_rev16()
1095 emit(hppa_depwz(rd, 23, 8, HPPA_REG_T1), ctx); in emit_rev16()
1096 emit(hppa_extru(HPPA_REG_T1, 31, 16, rd), ctx); in emit_rev16()
1099 static void emit_rev32(const s8 rs, const s8 rd, struct hppa_jit_context *ctx) in emit_rev32() argument
1103 emit(hppa_shrpw(rs, HPPA_REG_T1, 8, rd), ctx); in emit_rev32()
1108 const s8 *rd; in emit_zext64() local
1111 rd = bpf_get_reg64(dst, tmp1, ctx); in emit_zext64()
1112 emit_hppa_copy(HPPA_REG_ZERO, hi(rd), ctx); in emit_zext64()
1113 bpf_put_reg64(dst, rd, ctx); in emit_zext64()
1245 const s8 *rd = bpf_get_reg64(dst, tmp1, ctx); in bpf_jit_emit_insn() local
1250 emit(hppa_extru(lo(rd), 31, 16, lo(rd)), ctx); in bpf_jit_emit_insn()
1255 emit_hppa_copy(HPPA_REG_ZERO, hi(rd), ctx); in bpf_jit_emit_insn()
1265 bpf_put_reg64(dst, rd, ctx); in bpf_jit_emit_insn()
1271 const s8 *rd = bpf_get_reg64(dst, tmp1, ctx); in bpf_jit_emit_insn() local
1275 emit_rev16(lo(rd), ctx); in bpf_jit_emit_insn()
1277 emit_hppa_copy(HPPA_REG_ZERO, hi(rd), ctx); in bpf_jit_emit_insn()
1280 emit_rev32(lo(rd), lo(rd), ctx); in bpf_jit_emit_insn()
1282 emit_hppa_copy(HPPA_REG_ZERO, hi(rd), ctx); in bpf_jit_emit_insn()
1286 emit_hppa_copy(hi(rd), HPPA_REG_T0, ctx); in bpf_jit_emit_insn()
1287 emit_rev32(lo(rd), hi(rd), ctx); in bpf_jit_emit_insn()
1288 emit_rev32(HPPA_REG_T0, lo(rd), ctx); in bpf_jit_emit_insn()
1295 bpf_put_reg64(dst, rd, ctx); in bpf_jit_emit_insn()
1406 const s8 *rd = bpf_get_reg64_ref(dst, tmp1, false, ctx); in bpf_jit_emit_insn() local
1414 emit_imm64(rd, upper, lower, ctx); in bpf_jit_emit_insn()
1415 bpf_put_reg64(dst, rd, ctx); in bpf_jit_emit_insn()