Lines Matching refs:rd
414 static inline void emit_mov_i_no8m(const u8 rd, u32 val, struct jit_ctx *ctx) in emit_mov_i_no8m() argument
417 emit(ARM_LDR_I(rd, ARM_PC, imm_offset(val, ctx)), ctx); in emit_mov_i_no8m()
419 emit(ARM_MOVW(rd, val & 0xffff), ctx); in emit_mov_i_no8m()
421 emit(ARM_MOVT(rd, val >> 16), ctx); in emit_mov_i_no8m()
425 static inline void emit_mov_i(const u8 rd, u32 val, struct jit_ctx *ctx) in emit_mov_i() argument
430 emit(ARM_MOV_I(rd, imm12), ctx); in emit_mov_i()
432 emit_mov_i_no8m(rd, val, ctx); in emit_mov_i()
465 static inline void emit_udivmod(u8 rd, u8 rm, u8 rn, struct jit_ctx *ctx, u8 op) in emit_udivmod() argument
472 emit(ARM_UDIV(rd, rm, rn), ctx); in emit_udivmod()
475 emit(ARM_MLS(rd, rn, ARM_IP, rm), ctx); in emit_udivmod()
504 if (rd != ARM_R0) in emit_udivmod()
505 emit(ARM_MOV_R(rd, ARM_R0), ctx); in emit_udivmod()
602 const s8 *rd = is_stacked(dst_lo) ? tmp : dst; in emit_a32_mov_i64() local
604 emit_mov_i(rd[1], (u32)val, ctx); in emit_a32_mov_i64()
605 emit_mov_i(rd[0], val >> 32, ctx); in emit_a32_mov_i64()
607 arm_bpf_put_reg64(dst, rd, ctx); in emit_a32_mov_i64()
703 s8 rn, rd; in emit_a32_alu_r() local
706 rd = arm_bpf_get_reg32(dst, tmp[0], ctx); in emit_a32_alu_r()
708 emit_alu_r(rd, rn, is64, hi, op, ctx); in emit_a32_alu_r()
709 arm_bpf_put_reg32(dst, rd, ctx); in emit_a32_alu_r()
718 const s8 *rd; in emit_a32_alu_r64() local
720 rd = arm_bpf_get_reg64(dst, tmp, ctx); in emit_a32_alu_r64()
727 emit_alu_r(rd[1], rs[1], true, false, op, ctx); in emit_a32_alu_r64()
728 emit_alu_r(rd[0], rs[0], true, true, op, ctx); in emit_a32_alu_r64()
735 emit_alu_r(rd[1], rs, true, false, op, ctx); in emit_a32_alu_r64()
737 emit_a32_mov_i(rd[0], 0, ctx); in emit_a32_alu_r64()
740 arm_bpf_put_reg64(dst, rd, ctx); in emit_a32_alu_r64()
786 s8 rd; in emit_a32_alu_i() local
788 rd = arm_bpf_get_reg32(dst, tmp[0], ctx); in emit_a32_alu_i()
793 emit(ARM_LSL_I(rd, rd, val), ctx); in emit_a32_alu_i()
796 emit(ARM_LSR_I(rd, rd, val), ctx); in emit_a32_alu_i()
799 emit(ARM_RSB_I(rd, rd, val), ctx); in emit_a32_alu_i()
803 arm_bpf_put_reg32(dst, rd, ctx); in emit_a32_alu_i()
810 const s8 *rd; in emit_a32_neg64() local
813 rd = arm_bpf_get_reg64(dst, tmp, ctx); in emit_a32_neg64()
816 emit(ARM_RSBS_I(rd[1], rd[1], 0), ctx); in emit_a32_neg64()
817 emit(ARM_RSC_I(rd[0], rd[0], 0), ctx); in emit_a32_neg64()
819 arm_bpf_put_reg64(dst, rd, ctx); in emit_a32_neg64()
827 const s8 *rd; in emit_a32_lsh_r64() local
832 rd = arm_bpf_get_reg64(dst, tmp, ctx); in emit_a32_lsh_r64()
837 emit(ARM_MOV_SR(ARM_LR, rd[0], SRTYPE_ASL, rt), ctx); in emit_a32_lsh_r64()
838 emit(ARM_ORR_SR(ARM_LR, ARM_LR, rd[1], SRTYPE_ASL, ARM_IP), ctx); in emit_a32_lsh_r64()
839 emit(ARM_ORR_SR(ARM_IP, ARM_LR, rd[1], SRTYPE_LSR, tmp2[0]), ctx); in emit_a32_lsh_r64()
840 emit(ARM_MOV_SR(ARM_LR, rd[1], SRTYPE_ASL, rt), ctx); in emit_a32_lsh_r64()
851 const s8 *rd; in emit_a32_arsh_r64() local
856 rd = arm_bpf_get_reg64(dst, tmp, ctx); in emit_a32_arsh_r64()
861 emit(ARM_MOV_SR(ARM_LR, rd[1], SRTYPE_LSR, rt), ctx); in emit_a32_arsh_r64()
862 emit(ARM_ORR_SR(ARM_LR, ARM_LR, rd[0], SRTYPE_ASL, ARM_IP), ctx); in emit_a32_arsh_r64()
864 emit(ARM_ORR_SR(ARM_LR, ARM_LR, rd[0], SRTYPE_ASR, tmp2[0]), ctx); in emit_a32_arsh_r64()
865 emit(ARM_MOV_SR(ARM_IP, rd[0], SRTYPE_ASR, rt), ctx); in emit_a32_arsh_r64()
876 const s8 *rd; in emit_a32_rsh_r64() local
881 rd = arm_bpf_get_reg64(dst, tmp, ctx); in emit_a32_rsh_r64()
886 emit(ARM_MOV_SR(ARM_LR, rd[1], SRTYPE_LSR, rt), ctx); in emit_a32_rsh_r64()
887 emit(ARM_ORR_SR(ARM_LR, ARM_LR, rd[0], SRTYPE_ASL, ARM_IP), ctx); in emit_a32_rsh_r64()
888 emit(ARM_ORR_SR(ARM_LR, ARM_LR, rd[0], SRTYPE_LSR, tmp2[0]), ctx); in emit_a32_rsh_r64()
889 emit(ARM_MOV_SR(ARM_IP, rd[0], SRTYPE_LSR, rt), ctx); in emit_a32_rsh_r64()
900 const s8 *rd; in emit_a32_lsh_i64() local
903 rd = arm_bpf_get_reg64(dst, tmp, ctx); in emit_a32_lsh_i64()
907 emit(ARM_MOV_SI(tmp2[0], rd[0], SRTYPE_ASL, val), ctx); in emit_a32_lsh_i64()
908 emit(ARM_ORR_SI(rd[0], tmp2[0], rd[1], SRTYPE_LSR, 32 - val), ctx); in emit_a32_lsh_i64()
909 emit(ARM_MOV_SI(rd[1], rd[1], SRTYPE_ASL, val), ctx); in emit_a32_lsh_i64()
912 emit(ARM_MOV_R(rd[0], rd[1]), ctx); in emit_a32_lsh_i64()
914 emit(ARM_MOV_SI(rd[0], rd[1], SRTYPE_ASL, val - 32), ctx); in emit_a32_lsh_i64()
915 emit(ARM_EOR_R(rd[1], rd[1], rd[1]), ctx); in emit_a32_lsh_i64()
918 arm_bpf_put_reg64(dst, rd, ctx); in emit_a32_lsh_i64()
926 const s8 *rd; in emit_a32_rsh_i64() local
929 rd = arm_bpf_get_reg64(dst, tmp, ctx); in emit_a32_rsh_i64()
933 emit(ARM_MOV_SI(tmp2[1], rd[1], SRTYPE_LSR, val), ctx); in emit_a32_rsh_i64()
934 emit(ARM_ORR_SI(rd[1], tmp2[1], rd[0], SRTYPE_ASL, 32 - val), ctx); in emit_a32_rsh_i64()
935 emit(ARM_MOV_SI(rd[0], rd[0], SRTYPE_LSR, val), ctx); in emit_a32_rsh_i64()
937 emit(ARM_MOV_R(rd[1], rd[0]), ctx); in emit_a32_rsh_i64()
938 emit(ARM_MOV_I(rd[0], 0), ctx); in emit_a32_rsh_i64()
940 emit(ARM_MOV_SI(rd[1], rd[0], SRTYPE_LSR, val - 32), ctx); in emit_a32_rsh_i64()
941 emit(ARM_MOV_I(rd[0], 0), ctx); in emit_a32_rsh_i64()
944 arm_bpf_put_reg64(dst, rd, ctx); in emit_a32_rsh_i64()
952 const s8 *rd; in emit_a32_arsh_i64() local
955 rd = arm_bpf_get_reg64(dst, tmp, ctx); in emit_a32_arsh_i64()
959 emit(ARM_MOV_SI(tmp2[1], rd[1], SRTYPE_LSR, val), ctx); in emit_a32_arsh_i64()
960 emit(ARM_ORR_SI(rd[1], tmp2[1], rd[0], SRTYPE_ASL, 32 - val), ctx); in emit_a32_arsh_i64()
961 emit(ARM_MOV_SI(rd[0], rd[0], SRTYPE_ASR, val), ctx); in emit_a32_arsh_i64()
963 emit(ARM_MOV_R(rd[1], rd[0]), ctx); in emit_a32_arsh_i64()
964 emit(ARM_MOV_SI(rd[0], rd[0], SRTYPE_ASR, 31), ctx); in emit_a32_arsh_i64()
966 emit(ARM_MOV_SI(rd[1], rd[0], SRTYPE_ASR, val - 32), ctx); in emit_a32_arsh_i64()
967 emit(ARM_MOV_SI(rd[0], rd[0], SRTYPE_ASR, 31), ctx); in emit_a32_arsh_i64()
970 arm_bpf_put_reg64(dst, rd, ctx); in emit_a32_arsh_i64()
977 const s8 *rd, *rt; in emit_a32_mul_r64() local
980 rd = arm_bpf_get_reg64(dst, tmp, ctx); in emit_a32_mul_r64()
984 emit(ARM_MUL(ARM_IP, rd[1], rt[0]), ctx); in emit_a32_mul_r64()
985 emit(ARM_MUL(ARM_LR, rd[0], rt[1]), ctx); in emit_a32_mul_r64()
988 emit(ARM_UMULL(ARM_IP, rd[0], rd[1], rt[1]), ctx); in emit_a32_mul_r64()
989 emit(ARM_ADD_R(rd[0], ARM_LR, rd[0]), ctx); in emit_a32_mul_r64()
992 arm_bpf_put_reg32(dst_hi, rd[0], ctx); in emit_a32_mul_r64()
1000 s8 rd; in emit_str_r() local
1002 rd = arm_bpf_get_reg32(dst, tmp[1], ctx); in emit_str_r()
1011 emit(ARM_ADD_R(tmp[0], tmp[0], rd), ctx); in emit_str_r()
1012 rd = tmp[0]; in emit_str_r()
1018 emit(ARM_STRB_I(src_lo, rd, off), ctx); in emit_str_r()
1022 emit(ARM_STRH_I(src_lo, rd, off), ctx); in emit_str_r()
1026 emit(ARM_STR_I(src_lo, rd, off), ctx); in emit_str_r()
1030 emit(ARM_STR_I(src_lo, rd, off), ctx); in emit_str_r()
1031 emit(ARM_STR_I(src_hi, rd, off + 4), ctx); in emit_str_r()
1040 const s8 *rd = is_stacked(dst_lo) ? tmp : dst; in emit_ldx_r() local
1054 } else if (rd[1] == rm) { in emit_ldx_r()
1061 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()
1069 emit_a32_mov_i(rd[0], 0, ctx); in emit_ldx_r()
1073 emit(ARM_LDR_I(rd[1], rm, off), ctx); in emit_ldx_r()
1075 emit_a32_mov_i(rd[0], 0, ctx); in emit_ldx_r()
1079 emit(ARM_LDR_I(rd[1], rm, off), ctx); in emit_ldx_r()
1080 emit(ARM_LDR_I(rd[0], rm, off + 4), ctx); in emit_ldx_r()
1083 arm_bpf_put_reg64(dst, rd, ctx); in emit_ldx_r()
1087 static inline void emit_ar_r(const u8 rd, const u8 rt, const u8 rm, in emit_ar_r() argument
1094 emit(ARM_AND_R(ARM_LR, rd, rm), ctx); in emit_ar_r()
1107 emit(ARM_CMP_R(rd, rm), ctx); in emit_ar_r()
1118 emit(ARM_SBCS_R(ARM_IP, rm, rd), ctx); in emit_ar_r()
1124 emit(ARM_SBCS_R(ARM_IP, rd, rm), ctx); in emit_ar_r()
1211 static inline void emit_rev16(const u8 rd, const u8 rn, struct jit_ctx *ctx) in emit_rev16() argument
1219 emit(ARM_ORR_SI(rd, tmp2[0], tmp2[1], SRTYPE_LSL, 8), ctx); in emit_rev16()
1221 emit(ARM_REV16(rd, rn), ctx); in emit_rev16()
1226 static inline void emit_rev32(const u8 rd, const u8 rn, struct jit_ctx *ctx) in emit_rev32() argument
1241 emit(ARM_ORR_R(rd, ARM_IP, tmp2[0]), ctx); in emit_rev32()
1244 emit(ARM_REV(rd, rn), ctx); in emit_rev32()
1340 const s8 *rd, *rs; in build_insn() local
1530 rd = arm_bpf_get_reg64(dst, tmp, ctx); in build_insn()
1535 emit_rev16(rd[1], rd[1], ctx); in build_insn()
1538 emit_rev32(rd[1], rd[1], ctx); in build_insn()
1541 emit_rev32(ARM_LR, rd[1], ctx); in build_insn()
1542 emit_rev32(rd[1], rd[0], ctx); in build_insn()
1543 emit(ARM_MOV_R(rd[0], ARM_LR), ctx); in build_insn()
1553 emit(ARM_AND_R(rd[1], rd[1], tmp2[1]), ctx); in build_insn()
1555 emit(ARM_UXTH(rd[1], rd[1]), ctx); in build_insn()
1558 emit(ARM_EOR_R(rd[0], rd[0], rd[0]), ctx); in build_insn()
1563 emit(ARM_EOR_R(rd[0], rd[0], rd[0]), ctx); in build_insn()
1570 arm_bpf_put_reg64(dst, rd, ctx); in build_insn()
1698 rd = arm_bpf_get_reg64(dst, tmp, ctx); in build_insn()
1701 emit_ar_r(rd[0], rd[1], rm, rn, ctx, BPF_OP(code), in build_insn()