Lines Matching refs:rd

426 static inline void emit_mov_i_no8m(const u8 rd, u32 val, struct jit_ctx *ctx)  in emit_mov_i_no8m()  argument
429 emit(ARM_LDR_I(rd, ARM_PC, imm_offset(val, ctx)), ctx); in emit_mov_i_no8m()
431 emit(ARM_MOVW(rd, val & 0xffff), ctx); in emit_mov_i_no8m()
433 emit(ARM_MOVT(rd, val >> 16), ctx); in emit_mov_i_no8m()
437 static inline void emit_mov_i(const u8 rd, u32 val, struct jit_ctx *ctx) in emit_mov_i() argument
442 emit(ARM_MOV_I(rd, imm12), ctx); in emit_mov_i()
444 emit_mov_i_no8m(rd, val, ctx); in emit_mov_i()
477 static inline void emit_udivmod(u8 rd, u8 rm, u8 rn, struct jit_ctx *ctx, u8 op) in emit_udivmod() argument
485 emit(ARM_UDIV(rd, rm, rn), ctx); in emit_udivmod()
488 emit(ARM_MLS(rd, rn, ARM_IP, rm), ctx); in emit_udivmod()
523 if (rd != ARM_R0) in emit_udivmod()
524 emit(ARM_MOV_R(rd, ARM_R0), ctx); in emit_udivmod()
621 const s8 *rd = is_stacked(dst_lo) ? tmp : dst; in emit_a32_mov_i64() local
623 emit_mov_i(rd[1], (u32)val, ctx); in emit_a32_mov_i64()
624 emit_mov_i(rd[0], val >> 32, ctx); in emit_a32_mov_i64()
626 arm_bpf_put_reg64(dst, rd, ctx); in emit_a32_mov_i64()
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()
740 emit_a32_mov_i(rd[0], 0, ctx); in emit_a32_alu_r64()
743 arm_bpf_put_reg64(dst, rd, ctx); in emit_a32_alu_r64()
789 s8 rd; in emit_a32_alu_i() local
791 rd = arm_bpf_get_reg32(dst, tmp[0], ctx); in emit_a32_alu_i()
796 emit(ARM_LSL_I(rd, rd, val), ctx); in emit_a32_alu_i()
799 emit(ARM_LSR_I(rd, rd, val), ctx); in emit_a32_alu_i()
802 emit(ARM_ASR_I(rd, rd, val), ctx); in emit_a32_alu_i()
805 emit(ARM_RSB_I(rd, rd, val), ctx); in emit_a32_alu_i()
809 arm_bpf_put_reg32(dst, rd, ctx); in emit_a32_alu_i()
816 const s8 *rd; in emit_a32_neg64() local
819 rd = arm_bpf_get_reg64(dst, tmp, ctx); in emit_a32_neg64()
822 emit(ARM_RSBS_I(rd[1], rd[1], 0), ctx); in emit_a32_neg64()
823 emit(ARM_RSC_I(rd[0], rd[0], 0), ctx); in emit_a32_neg64()
825 arm_bpf_put_reg64(dst, rd, ctx); in emit_a32_neg64()
833 const s8 *rd; in emit_a32_lsh_r64() local
838 rd = arm_bpf_get_reg64(dst, tmp, ctx); in emit_a32_lsh_r64()
843 emit(ARM_MOV_SR(ARM_LR, rd[0], SRTYPE_ASL, rt), ctx); in emit_a32_lsh_r64()
844 emit(ARM_ORR_SR(ARM_LR, ARM_LR, rd[1], SRTYPE_ASL, ARM_IP), ctx); in emit_a32_lsh_r64()
845 emit(ARM_ORR_SR(ARM_IP, ARM_LR, rd[1], SRTYPE_LSR, tmp2[0]), ctx); in emit_a32_lsh_r64()
846 emit(ARM_MOV_SR(ARM_LR, rd[1], SRTYPE_ASL, rt), ctx); in emit_a32_lsh_r64()
857 const s8 *rd; in emit_a32_arsh_r64() local
862 rd = arm_bpf_get_reg64(dst, tmp, ctx); in emit_a32_arsh_r64()
867 emit(ARM_MOV_SR(ARM_LR, rd[1], SRTYPE_LSR, rt), ctx); in emit_a32_arsh_r64()
868 emit(ARM_ORR_SR(ARM_LR, ARM_LR, rd[0], SRTYPE_ASL, ARM_IP), ctx); in emit_a32_arsh_r64()
870 ARM_ORR_SR(ARM_LR, ARM_LR, rd[0], SRTYPE_ASR, tmp2[0]), ctx); in emit_a32_arsh_r64()
871 emit(ARM_MOV_SR(ARM_IP, rd[0], SRTYPE_ASR, rt), ctx); in emit_a32_arsh_r64()
882 const s8 *rd; in emit_a32_rsh_r64() local
887 rd = arm_bpf_get_reg64(dst, tmp, ctx); in emit_a32_rsh_r64()
892 emit(ARM_MOV_SR(ARM_LR, rd[1], SRTYPE_LSR, rt), ctx); in emit_a32_rsh_r64()
893 emit(ARM_ORR_SR(ARM_LR, ARM_LR, rd[0], SRTYPE_ASL, ARM_IP), ctx); in emit_a32_rsh_r64()
894 emit(ARM_ORR_SR(ARM_LR, ARM_LR, rd[0], SRTYPE_LSR, tmp2[0]), ctx); in emit_a32_rsh_r64()
895 emit(ARM_MOV_SR(ARM_IP, rd[0], SRTYPE_LSR, rt), ctx); in emit_a32_rsh_r64()
906 const s8 *rd; in emit_a32_lsh_i64() local
909 rd = arm_bpf_get_reg64(dst, tmp, ctx); in emit_a32_lsh_i64()
913 emit(ARM_MOV_SI(tmp2[0], rd[0], SRTYPE_ASL, val), ctx); in emit_a32_lsh_i64()
914 emit(ARM_ORR_SI(rd[0], tmp2[0], rd[1], SRTYPE_LSR, 32 - val), ctx); in emit_a32_lsh_i64()
915 emit(ARM_MOV_SI(rd[1], rd[1], SRTYPE_ASL, val), ctx); in emit_a32_lsh_i64()
918 emit(ARM_MOV_R(rd[0], rd[1]), ctx); in emit_a32_lsh_i64()
920 emit(ARM_MOV_SI(rd[0], rd[1], SRTYPE_ASL, val - 32), ctx); in emit_a32_lsh_i64()
921 emit(ARM_EOR_R(rd[1], rd[1], rd[1]), ctx); in emit_a32_lsh_i64()
924 arm_bpf_put_reg64(dst, rd, ctx); in emit_a32_lsh_i64()
932 const s8 *rd; in emit_a32_rsh_i64() local
935 rd = arm_bpf_get_reg64(dst, tmp, ctx); in emit_a32_rsh_i64()
943 emit(ARM_MOV_SI(tmp2[1], rd[1], SRTYPE_LSR, val), ctx); in emit_a32_rsh_i64()
944 emit(ARM_ORR_SI(rd[1], tmp2[1], rd[0], SRTYPE_ASL, 32 - val), ctx); in emit_a32_rsh_i64()
945 emit(ARM_MOV_SI(rd[0], rd[0], SRTYPE_LSR, val), ctx); in emit_a32_rsh_i64()
947 emit(ARM_MOV_R(rd[1], rd[0]), ctx); in emit_a32_rsh_i64()
948 emit(ARM_MOV_I(rd[0], 0), ctx); in emit_a32_rsh_i64()
950 emit(ARM_MOV_SI(rd[1], rd[0], SRTYPE_LSR, val - 32), ctx); in emit_a32_rsh_i64()
951 emit(ARM_MOV_I(rd[0], 0), ctx); in emit_a32_rsh_i64()
954 arm_bpf_put_reg64(dst, rd, ctx); in emit_a32_rsh_i64()
962 const s8 *rd; in emit_a32_arsh_i64() local
965 rd = arm_bpf_get_reg64(dst, tmp, ctx); in emit_a32_arsh_i64()
973 emit(ARM_MOV_SI(tmp2[1], rd[1], SRTYPE_LSR, val), ctx); in emit_a32_arsh_i64()
974 emit(ARM_ORR_SI(rd[1], tmp2[1], rd[0], SRTYPE_ASL, 32 - val), ctx); in emit_a32_arsh_i64()
975 emit(ARM_MOV_SI(rd[0], rd[0], SRTYPE_ASR, val), ctx); in emit_a32_arsh_i64()
977 emit(ARM_MOV_R(rd[1], rd[0]), ctx); in emit_a32_arsh_i64()
978 emit(ARM_MOV_SI(rd[0], rd[0], SRTYPE_ASR, 31), ctx); in emit_a32_arsh_i64()
980 emit(ARM_MOV_SI(rd[1], rd[0], SRTYPE_ASR, val - 32), ctx); in emit_a32_arsh_i64()
981 emit(ARM_MOV_SI(rd[0], rd[0], SRTYPE_ASR, 31), ctx); in emit_a32_arsh_i64()
984 arm_bpf_put_reg64(dst, rd, ctx); in emit_a32_arsh_i64()
991 const s8 *rd, *rt; in emit_a32_mul_r64() local
994 rd = arm_bpf_get_reg64(dst, tmp, ctx); in emit_a32_mul_r64()
998 emit(ARM_MUL(ARM_IP, rd[1], rt[0]), ctx); in emit_a32_mul_r64()
999 emit(ARM_MUL(ARM_LR, rd[0], rt[1]), ctx); in emit_a32_mul_r64()
1002 emit(ARM_UMULL(ARM_IP, rd[0], rd[1], rt[1]), ctx); in emit_a32_mul_r64()
1003 emit(ARM_ADD_R(rd[0], ARM_LR, rd[0]), ctx); in emit_a32_mul_r64()
1006 arm_bpf_put_reg32(dst_hi, rd[0], ctx); in emit_a32_mul_r64()
1033 s8 rd; in emit_str_r() local
1035 rd = arm_bpf_get_reg32(dst, tmp[1], ctx); in emit_str_r()
1039 emit(ARM_ADD_R(tmp[0], tmp[0], rd), ctx); in emit_str_r()
1040 rd = tmp[0]; in emit_str_r()
1046 emit(ARM_STRB_I(src_lo, rd, off), ctx); in emit_str_r()
1050 emit(ARM_STRH_I(src_lo, rd, off), ctx); in emit_str_r()
1054 emit(ARM_STR_I(src_lo, rd, off), ctx); in emit_str_r()
1058 emit(ARM_STR_I(src_lo, rd, off), ctx); in emit_str_r()
1059 emit(ARM_STR_I(src_hi, rd, off + 4), ctx); in emit_str_r()
1068 const s8 *rd = is_stacked(dst_lo) ? tmp : dst; in emit_ldx_r() local
1076 } else if (rd[1] == rm) { in emit_ldx_r()
1083 emit(ARM_LDRB_I(rd[1], rm, off), ctx); in emit_ldx_r()
1085 emit_a32_mov_i(rd[0], 0, ctx); in emit_ldx_r()
1089 emit(ARM_LDRH_I(rd[1], rm, off), ctx); in emit_ldx_r()
1091 emit_a32_mov_i(rd[0], 0, ctx); in emit_ldx_r()
1095 emit(ARM_LDR_I(rd[1], rm, off), ctx); in emit_ldx_r()
1097 emit_a32_mov_i(rd[0], 0, ctx); in emit_ldx_r()
1101 emit(ARM_LDR_I(rd[1], rm, off), ctx); in emit_ldx_r()
1102 emit(ARM_LDR_I(rd[0], rm, off + 4), ctx); in emit_ldx_r()
1105 arm_bpf_put_reg64(dst, rd, ctx); in emit_ldx_r()
1109 static inline void emit_ar_r(const u8 rd, const u8 rt, const u8 rm, in emit_ar_r() argument
1116 emit(ARM_AND_R(ARM_LR, rd, rm), ctx); in emit_ar_r()
1129 emit(ARM_CMP_R(rd, rm), ctx); in emit_ar_r()
1140 emit(ARM_SBCS_R(ARM_IP, rm, rd), ctx); in emit_ar_r()
1146 emit(ARM_SBCS_R(ARM_IP, rd, rm), ctx); in emit_ar_r()
1234 static inline void emit_rev16(const u8 rd, const u8 rn, struct jit_ctx *ctx) in emit_rev16() argument
1242 emit(ARM_ORR_SI(rd, tmp2[0], tmp2[1], SRTYPE_LSL, 8), ctx); in emit_rev16()
1244 emit(ARM_REV16(rd, rn), ctx); in emit_rev16()
1249 static inline void emit_rev32(const u8 rd, const u8 rn, struct jit_ctx *ctx) in emit_rev32() argument
1264 emit(ARM_ORR_R(rd, ARM_IP, tmp2[0]), ctx); in emit_rev32()
1267 emit(ARM_REV(rd, rn), ctx); in emit_rev32()
1359 const s8 *rd, *rs; in build_insn() local
1550 rd = arm_bpf_get_reg64(dst, tmp, ctx); in build_insn()
1555 emit_rev16(rd[1], rd[1], ctx); in build_insn()
1558 emit_rev32(rd[1], rd[1], ctx); in build_insn()
1561 emit_rev32(ARM_LR, rd[1], ctx); in build_insn()
1562 emit_rev32(rd[1], rd[0], ctx); in build_insn()
1563 emit(ARM_MOV_R(rd[0], ARM_LR), ctx); in build_insn()
1573 emit(ARM_AND_R(rd[1], rd[1], tmp2[1]), ctx); in build_insn()
1575 emit(ARM_UXTH(rd[1], rd[1]), ctx); in build_insn()
1578 emit(ARM_EOR_R(rd[0], rd[0], rd[0]), ctx); in build_insn()
1583 emit(ARM_EOR_R(rd[0], rd[0], rd[0]), ctx); in build_insn()
1590 arm_bpf_put_reg64(dst, rd, ctx); in build_insn()
1720 rd = arm_bpf_get_reg64(dst, tmp, ctx); in build_insn()
1723 emit_ar_r(rd[0], rd[1], rm, rn, ctx, BPF_OP(code), in build_insn()