Lines Matching refs:rd
417 static inline void emit_mov_i_no8m(const u8 rd, u32 val, struct jit_ctx *ctx) in emit_mov_i_no8m() argument
420 emit(ARM_LDR_I(rd, ARM_PC, imm_offset(val, ctx)), ctx); in emit_mov_i_no8m()
422 emit(ARM_MOVW(rd, val & 0xffff), ctx); in emit_mov_i_no8m()
424 emit(ARM_MOVT(rd, val >> 16), ctx); in emit_mov_i_no8m()
428 static inline void emit_mov_i(const u8 rd, u32 val, struct jit_ctx *ctx) in emit_mov_i() argument
433 emit(ARM_MOV_I(rd, imm12), ctx); in emit_mov_i()
435 emit_mov_i_no8m(rd, val, ctx); in emit_mov_i()
468 static inline void emit_udivmod(u8 rd, u8 rm, u8 rn, struct jit_ctx *ctx, u8 op) in emit_udivmod() argument
475 emit(ARM_UDIV(rd, rm, rn), ctx); in emit_udivmod()
478 emit(ARM_MLS(rd, rn, ARM_IP, rm), ctx); in emit_udivmod()
507 if (rd != ARM_R0) in emit_udivmod()
508 emit(ARM_MOV_R(rd, ARM_R0), ctx); in emit_udivmod()
605 const s8 *rd = is_stacked(dst_lo) ? tmp : dst; in emit_a32_mov_i64() local
607 emit_mov_i(rd[1], (u32)val, ctx); in emit_a32_mov_i64()
608 emit_mov_i(rd[0], val >> 32, ctx); in emit_a32_mov_i64()
610 arm_bpf_put_reg64(dst, rd, ctx); in emit_a32_mov_i64()
706 s8 rn, rd; in emit_a32_alu_r() local
709 rd = arm_bpf_get_reg32(dst, tmp[0], ctx); in emit_a32_alu_r()
711 emit_alu_r(rd, rn, is64, hi, op, ctx); in emit_a32_alu_r()
712 arm_bpf_put_reg32(dst, rd, ctx); in emit_a32_alu_r()
721 const s8 *rd; in emit_a32_alu_r64() local
723 rd = arm_bpf_get_reg64(dst, tmp, ctx); in emit_a32_alu_r64()
730 emit_alu_r(rd[1], rs[1], true, false, op, ctx); in emit_a32_alu_r64()
731 emit_alu_r(rd[0], rs[0], true, true, op, ctx); in emit_a32_alu_r64()
738 emit_alu_r(rd[1], rs, true, false, op, ctx); in emit_a32_alu_r64()
739 emit_a32_mov_i(rd[0], 0, ctx); in emit_a32_alu_r64()
742 arm_bpf_put_reg64(dst, rd, ctx); in emit_a32_alu_r64()
787 s8 rd; in emit_a32_alu_i() local
789 rd = arm_bpf_get_reg32(dst, tmp[0], ctx); in emit_a32_alu_i()
794 emit(ARM_LSL_I(rd, rd, val), ctx); in emit_a32_alu_i()
797 emit(ARM_LSR_I(rd, rd, val), ctx); in emit_a32_alu_i()
800 emit(ARM_RSB_I(rd, rd, val), ctx); in emit_a32_alu_i()
804 arm_bpf_put_reg32(dst, rd, ctx); in emit_a32_alu_i()
811 const s8 *rd; in emit_a32_neg64() local
814 rd = arm_bpf_get_reg64(dst, tmp, ctx); in emit_a32_neg64()
817 emit(ARM_RSBS_I(rd[1], rd[1], 0), ctx); in emit_a32_neg64()
818 emit(ARM_RSC_I(rd[0], rd[0], 0), ctx); in emit_a32_neg64()
820 arm_bpf_put_reg64(dst, rd, ctx); in emit_a32_neg64()
828 const s8 *rd; in emit_a32_lsh_r64() local
833 rd = arm_bpf_get_reg64(dst, tmp, ctx); in emit_a32_lsh_r64()
838 emit(ARM_MOV_SR(ARM_LR, rd[0], SRTYPE_ASL, rt), ctx); in emit_a32_lsh_r64()
839 emit(ARM_ORR_SR(ARM_LR, ARM_LR, rd[1], SRTYPE_ASL, ARM_IP), ctx); in emit_a32_lsh_r64()
840 emit(ARM_ORR_SR(ARM_IP, ARM_LR, rd[1], SRTYPE_LSR, tmp2[0]), ctx); in emit_a32_lsh_r64()
841 emit(ARM_MOV_SR(ARM_LR, rd[1], SRTYPE_ASL, rt), ctx); in emit_a32_lsh_r64()
852 const s8 *rd; in emit_a32_arsh_r64() local
857 rd = arm_bpf_get_reg64(dst, tmp, ctx); in emit_a32_arsh_r64()
862 emit(ARM_MOV_SR(ARM_LR, rd[1], SRTYPE_LSR, rt), ctx); in emit_a32_arsh_r64()
863 emit(ARM_ORR_SR(ARM_LR, ARM_LR, rd[0], SRTYPE_ASL, ARM_IP), ctx); in emit_a32_arsh_r64()
865 emit(ARM_ORR_SR(ARM_LR, ARM_LR, rd[0], SRTYPE_ASR, tmp2[0]), ctx); in emit_a32_arsh_r64()
866 emit(ARM_MOV_SR(ARM_IP, rd[0], SRTYPE_ASR, rt), ctx); in emit_a32_arsh_r64()
877 const s8 *rd; in emit_a32_rsh_r64() local
882 rd = arm_bpf_get_reg64(dst, tmp, ctx); in emit_a32_rsh_r64()
887 emit(ARM_MOV_SR(ARM_LR, rd[1], SRTYPE_LSR, rt), ctx); in emit_a32_rsh_r64()
888 emit(ARM_ORR_SR(ARM_LR, ARM_LR, rd[0], SRTYPE_ASL, ARM_IP), ctx); in emit_a32_rsh_r64()
889 emit(ARM_ORR_SR(ARM_LR, ARM_LR, rd[0], SRTYPE_LSR, tmp2[0]), ctx); in emit_a32_rsh_r64()
890 emit(ARM_MOV_SR(ARM_IP, rd[0], SRTYPE_LSR, rt), ctx); in emit_a32_rsh_r64()
901 const s8 *rd; in emit_a32_lsh_i64() local
904 rd = arm_bpf_get_reg64(dst, tmp, ctx); in emit_a32_lsh_i64()
908 emit(ARM_MOV_SI(tmp2[0], rd[0], SRTYPE_ASL, val), ctx); in emit_a32_lsh_i64()
909 emit(ARM_ORR_SI(rd[0], tmp2[0], rd[1], SRTYPE_LSR, 32 - val), ctx); in emit_a32_lsh_i64()
910 emit(ARM_MOV_SI(rd[1], rd[1], SRTYPE_ASL, val), ctx); in emit_a32_lsh_i64()
913 emit(ARM_MOV_R(rd[0], rd[1]), ctx); in emit_a32_lsh_i64()
915 emit(ARM_MOV_SI(rd[0], rd[1], SRTYPE_ASL, val - 32), ctx); in emit_a32_lsh_i64()
916 emit(ARM_EOR_R(rd[1], rd[1], rd[1]), ctx); in emit_a32_lsh_i64()
919 arm_bpf_put_reg64(dst, rd, ctx); in emit_a32_lsh_i64()
927 const s8 *rd; in emit_a32_rsh_i64() local
930 rd = arm_bpf_get_reg64(dst, tmp, ctx); in emit_a32_rsh_i64()
934 emit(ARM_MOV_SI(tmp2[1], rd[1], SRTYPE_LSR, val), ctx); in emit_a32_rsh_i64()
935 emit(ARM_ORR_SI(rd[1], tmp2[1], rd[0], SRTYPE_ASL, 32 - val), ctx); in emit_a32_rsh_i64()
936 emit(ARM_MOV_SI(rd[0], rd[0], SRTYPE_LSR, val), ctx); in emit_a32_rsh_i64()
938 emit(ARM_MOV_R(rd[1], rd[0]), ctx); in emit_a32_rsh_i64()
939 emit(ARM_MOV_I(rd[0], 0), ctx); in emit_a32_rsh_i64()
941 emit(ARM_MOV_SI(rd[1], rd[0], SRTYPE_LSR, val - 32), ctx); in emit_a32_rsh_i64()
942 emit(ARM_MOV_I(rd[0], 0), ctx); in emit_a32_rsh_i64()
945 arm_bpf_put_reg64(dst, rd, ctx); in emit_a32_rsh_i64()
953 const s8 *rd; in emit_a32_arsh_i64() local
956 rd = arm_bpf_get_reg64(dst, tmp, ctx); in emit_a32_arsh_i64()
960 emit(ARM_MOV_SI(tmp2[1], rd[1], SRTYPE_LSR, val), ctx); in emit_a32_arsh_i64()
961 emit(ARM_ORR_SI(rd[1], tmp2[1], rd[0], SRTYPE_ASL, 32 - val), ctx); in emit_a32_arsh_i64()
962 emit(ARM_MOV_SI(rd[0], rd[0], SRTYPE_ASR, val), ctx); in emit_a32_arsh_i64()
964 emit(ARM_MOV_R(rd[1], rd[0]), ctx); in emit_a32_arsh_i64()
965 emit(ARM_MOV_SI(rd[0], rd[0], SRTYPE_ASR, 31), ctx); in emit_a32_arsh_i64()
967 emit(ARM_MOV_SI(rd[1], rd[0], SRTYPE_ASR, val - 32), ctx); in emit_a32_arsh_i64()
968 emit(ARM_MOV_SI(rd[0], rd[0], SRTYPE_ASR, 31), ctx); in emit_a32_arsh_i64()
971 arm_bpf_put_reg64(dst, rd, ctx); in emit_a32_arsh_i64()
978 const s8 *rd, *rt; in emit_a32_mul_r64() local
981 rd = arm_bpf_get_reg64(dst, tmp, ctx); in emit_a32_mul_r64()
985 emit(ARM_MUL(ARM_IP, rd[1], rt[0]), ctx); in emit_a32_mul_r64()
986 emit(ARM_MUL(ARM_LR, rd[0], rt[1]), ctx); in emit_a32_mul_r64()
989 emit(ARM_UMULL(ARM_IP, rd[0], rd[1], rt[1]), ctx); in emit_a32_mul_r64()
990 emit(ARM_ADD_R(rd[0], ARM_LR, rd[0]), ctx); in emit_a32_mul_r64()
993 arm_bpf_put_reg32(dst_hi, rd[0], ctx); in emit_a32_mul_r64()
1001 s8 rd; in emit_str_r() local
1003 rd = arm_bpf_get_reg32(dst, tmp[1], ctx); in emit_str_r()
1012 emit(ARM_ADD_R(tmp[0], tmp[0], rd), ctx); in emit_str_r()
1013 rd = tmp[0]; in emit_str_r()
1019 emit(ARM_STRB_I(src_lo, rd, off), ctx); in emit_str_r()
1023 emit(ARM_STRH_I(src_lo, rd, off), ctx); in emit_str_r()
1027 emit(ARM_STR_I(src_lo, rd, off), ctx); in emit_str_r()
1031 emit(ARM_STR_I(src_lo, rd, off), ctx); in emit_str_r()
1032 emit(ARM_STR_I(src_hi, rd, off + 4), ctx); in emit_str_r()
1041 const s8 *rd = is_stacked(dst_lo) ? tmp : dst; in emit_ldx_r() local
1055 } else if (rd[1] == rm) { in emit_ldx_r()
1062 emit(ARM_LDRB_I(rd[1], rm, off), ctx); in emit_ldx_r()
1063 emit_a32_mov_i(rd[0], 0, ctx); in emit_ldx_r()
1067 emit(ARM_LDRH_I(rd[1], rm, off), ctx); in emit_ldx_r()
1068 emit_a32_mov_i(rd[0], 0, ctx); in emit_ldx_r()
1072 emit(ARM_LDR_I(rd[1], rm, off), ctx); in emit_ldx_r()
1073 emit_a32_mov_i(rd[0], 0, ctx); in emit_ldx_r()
1077 emit(ARM_LDR_I(rd[1], rm, off), ctx); in emit_ldx_r()
1078 emit(ARM_LDR_I(rd[0], rm, off + 4), ctx); in emit_ldx_r()
1081 arm_bpf_put_reg64(dst, rd, ctx); in emit_ldx_r()
1085 static inline void emit_ar_r(const u8 rd, const u8 rt, const u8 rm, in emit_ar_r() argument
1090 emit(ARM_AND_R(ARM_LR, rd, rm), ctx); in emit_ar_r()
1099 emit(ARM_CMP_R(rd, rm), ctx); in emit_ar_r()
1105 emit(ARM_SBCS_R(ARM_IP, rm, rd), ctx); in emit_ar_r()
1110 emit(ARM_SBCS_R(ARM_IP, rd, rm), ctx); in emit_ar_r()
1197 static inline void emit_rev16(const u8 rd, const u8 rn, struct jit_ctx *ctx) in emit_rev16() argument
1205 emit(ARM_ORR_SI(rd, tmp2[0], tmp2[1], SRTYPE_LSL, 8), ctx); in emit_rev16()
1207 emit(ARM_REV16(rd, rn), ctx); in emit_rev16()
1212 static inline void emit_rev32(const u8 rd, const u8 rn, struct jit_ctx *ctx) in emit_rev32() argument
1227 emit(ARM_ORR_R(rd, ARM_IP, tmp2[0]), ctx); in emit_rev32()
1230 emit(ARM_REV(rd, rn), ctx); in emit_rev32()
1326 const s8 *rd, *rs; in build_insn() local
1508 rd = arm_bpf_get_reg64(dst, tmp, ctx); in build_insn()
1513 emit_rev16(rd[1], rd[1], ctx); in build_insn()
1516 emit_rev32(rd[1], rd[1], ctx); in build_insn()
1519 emit_rev32(ARM_LR, rd[1], ctx); in build_insn()
1520 emit_rev32(rd[1], rd[0], ctx); in build_insn()
1521 emit(ARM_MOV_R(rd[0], ARM_LR), ctx); in build_insn()
1531 emit(ARM_AND_R(rd[1], rd[1], tmp2[1]), ctx); in build_insn()
1533 emit(ARM_UXTH(rd[1], rd[1]), ctx); in build_insn()
1535 emit(ARM_EOR_R(rd[0], rd[0], rd[0]), ctx); in build_insn()
1539 emit(ARM_EOR_R(rd[0], rd[0], rd[0]), ctx); in build_insn()
1546 arm_bpf_put_reg64(dst, rd, ctx); in build_insn()
1652 rd = arm_bpf_get_reg64(dst, tmp, ctx); in build_insn()
1655 emit_ar_r(rd[0], rd[1], rm, rn, ctx, BPF_OP(code)); in build_insn()