Lines Matching refs:emit
245 static inline void emit(u32 inst, struct jit_ctx *ctx)
429 emit(ARM_LDR_I(rd, ARM_PC, imm_offset(val, ctx)), ctx);
431 emit(ARM_MOVW(rd, val & 0xffff), ctx);
433 emit(ARM_MOVT(rd, val >> 16), ctx);
442 emit(ARM_MOV_I(rd, imm12), ctx);
450 emit(ARM_BX(tgt_reg), ctx);
452 emit(ARM_MOV_R(ARM_PC, tgt_reg), ctx);
458 emit(ARM_MOV_R(ARM_LR, ARM_PC), ctx);
461 emit(ARM_BLX_R(tgt_reg), ctx);
485 emit(ARM_UDIV(rd, rm, rn), ctx);
487 emit(ARM_UDIV(ARM_IP, rm, rn), ctx);
488 emit(ARM_MLS(rd, rn, ARM_IP, rm), ctx);
503 emit(ARM_MOV_R(tmp[0], ARM_R1), ctx);
504 emit(ARM_MOV_R(ARM_R1, rn), ctx);
507 emit(ARM_MOV_R(tmp[1], ARM_R0), ctx);
508 emit(ARM_MOV_R(ARM_R0, rm), ctx);
512 emit(ARM_PUSH(CALLER_MASK & ~exclude_mask), ctx);
520 emit(ARM_POP(CALLER_MASK & ~exclude_mask), ctx);
524 emit(ARM_MOV_R(rd, ARM_R0), ctx);
528 emit(ARM_MOV_R(ARM_R1, tmp[0]), ctx);
530 emit(ARM_MOV_R(ARM_R0, tmp[1]), ctx);
546 emit(ARM_LDR_I(tmp, ARM_FP, EBPF_SCRATCH_TO_ARM_FP(reg)), ctx);
558 emit(ARM_LDRD_I(tmp[1], ARM_FP,
561 emit(ARM_LDR_I(tmp[1], ARM_FP,
563 emit(ARM_LDR_I(tmp[0], ARM_FP,
578 emit(ARM_STR_I(src, ARM_FP, EBPF_SCRATCH_TO_ARM_FP(reg)), ctx);
580 emit(ARM_MOV_R(reg, src), ctx);
589 emit(ARM_STRD_I(src[1], ARM_FP,
592 emit(ARM_STR_I(src[1], ARM_FP,
594 emit(ARM_STR_I(src[0], ARM_FP,
599 emit(ARM_MOV_R(reg[1], src[1]), ctx);
601 emit(ARM_MOV_R(reg[0], src[0]), ctx);
649 emit(ARM_ADDS_R(dst, dst, src), ctx);
651 emit(ARM_ADC_R(dst, dst, src), ctx);
653 emit(ARM_ADD_R(dst, dst, src), ctx);
666 emit(ARM_SUBS_R(dst, dst, src), ctx);
668 emit(ARM_SBC_R(dst, dst, src), ctx);
670 emit(ARM_SUB_R(dst, dst, src), ctx);
686 emit(ARM_ORR_R(dst, dst, src), ctx);
690 emit(ARM_AND_R(dst, dst, src), ctx);
694 emit(ARM_EOR_R(dst, dst, src), ctx);
698 emit(ARM_MUL(dst, dst, src), ctx);
702 emit(ARM_LSL_R(dst, dst, src), ctx);
706 emit(ARM_LSR_R(dst, dst, src), ctx);
710 emit(ARM_MOV_SR(dst, dst, SRTYPE_ASR, src), ctx);
789 emit(ARM_LDRD_I(tmp[1], ARM_FP, EBPF_SCRATCH_TO_ARM_FP(src_lo)), ctx);
790 emit(ARM_STRD_I(tmp[1], ARM_FP, EBPF_SCRATCH_TO_ARM_FP(dst_lo)), ctx);
792 emit(ARM_LDRD_I(dst[1], ARM_FP, EBPF_SCRATCH_TO_ARM_FP(src_lo)), ctx);
794 emit(ARM_STRD_I(src[1], ARM_FP, EBPF_SCRATCH_TO_ARM_FP(dst_lo)), ctx);
796 emit(ARM_MOV_R(dst[0], src[0]), ctx);
797 emit(ARM_MOV_R(dst[1], src[1]), ctx);
812 emit(ARM_LSL_I(rd, rd, val), ctx);
815 emit(ARM_LSR_I(rd, rd, val), ctx);
818 emit(ARM_ASR_I(rd, rd, val), ctx);
821 emit(ARM_RSB_I(rd, rd, val), ctx);
838 emit(ARM_RSBS_I(rd[1], rd[1], 0), ctx);
839 emit(ARM_RSC_I(rd[0], rd[0], 0), ctx);
857 emit(ARM_SUB_I(ARM_IP, rt, 32), ctx);
858 emit(ARM_RSB_I(tmp2[0], rt, 32), ctx);
859 emit(ARM_MOV_SR(ARM_LR, rd[0], SRTYPE_ASL, rt), ctx);
860 emit(ARM_ORR_SR(ARM_LR, ARM_LR, rd[1], SRTYPE_ASL, ARM_IP), ctx);
861 emit(ARM_ORR_SR(ARM_IP, ARM_LR, rd[1], SRTYPE_LSR, tmp2[0]), ctx);
862 emit(ARM_MOV_SR(ARM_LR, rd[1], SRTYPE_ASL, rt), ctx);
881 emit(ARM_RSB_I(ARM_IP, rt, 32), ctx);
882 emit(ARM_SUBS_I(tmp2[0], rt, 32), ctx);
883 emit(ARM_MOV_SR(ARM_LR, rd[1], SRTYPE_LSR, rt), ctx);
884 emit(ARM_ORR_SR(ARM_LR, ARM_LR, rd[0], SRTYPE_ASL, ARM_IP), ctx);
887 emit(ARM_MOV_SR(ARM_IP, rd[0], SRTYPE_ASR, rt), ctx);
906 emit(ARM_RSB_I(ARM_IP, rt, 32), ctx);
907 emit(ARM_SUBS_I(tmp2[0], rt, 32), ctx);
908 emit(ARM_MOV_SR(ARM_LR, rd[1], SRTYPE_LSR, rt), ctx);
909 emit(ARM_ORR_SR(ARM_LR, ARM_LR, rd[0], SRTYPE_ASL, ARM_IP), ctx);
910 emit(ARM_ORR_SR(ARM_LR, ARM_LR, rd[0], SRTYPE_LSR, tmp2[0]), ctx);
911 emit(ARM_MOV_SR(ARM_IP, rd[0], SRTYPE_LSR, rt), ctx);
929 emit(ARM_MOV_SI(tmp2[0], rd[0], SRTYPE_ASL, val), ctx);
930 emit(ARM_ORR_SI(rd[0], tmp2[0], rd[1], SRTYPE_LSR, 32 - val), ctx);
931 emit(ARM_MOV_SI(rd[1], rd[1], SRTYPE_ASL, val), ctx);
934 emit(ARM_MOV_R(rd[0], rd[1]), ctx);
936 emit(ARM_MOV_SI(rd[0], rd[1], SRTYPE_ASL, val - 32), ctx);
937 emit(ARM_EOR_R(rd[1], rd[1], rd[1]), ctx);
959 emit(ARM_MOV_SI(tmp2[1], rd[1], SRTYPE_LSR, val), ctx);
960 emit(ARM_ORR_SI(rd[1], tmp2[1], rd[0], SRTYPE_ASL, 32 - val), ctx);
961 emit(ARM_MOV_SI(rd[0], rd[0], SRTYPE_LSR, val), ctx);
963 emit(ARM_MOV_R(rd[1], rd[0]), ctx);
964 emit(ARM_MOV_I(rd[0], 0), ctx);
966 emit(ARM_MOV_SI(rd[1], rd[0], SRTYPE_LSR, val - 32), ctx);
967 emit(ARM_MOV_I(rd[0], 0), ctx);
989 emit(ARM_MOV_SI(tmp2[1], rd[1], SRTYPE_LSR, val), ctx);
990 emit(ARM_ORR_SI(rd[1], tmp2[1], rd[0], SRTYPE_ASL, 32 - val), ctx);
991 emit(ARM_MOV_SI(rd[0], rd[0], SRTYPE_ASR, val), ctx);
993 emit(ARM_MOV_R(rd[1], rd[0]), ctx);
994 emit(ARM_MOV_SI(rd[0], rd[0], SRTYPE_ASR, 31), ctx);
996 emit(ARM_MOV_SI(rd[1], rd[0], SRTYPE_ASR, val - 32), ctx);
997 emit(ARM_MOV_SI(rd[0], rd[0], SRTYPE_ASR, 31), ctx);
1014 emit(ARM_MUL(ARM_IP, rd[1], rt[0]), ctx);
1015 emit(ARM_MUL(ARM_LR, rd[0], rt[1]), ctx);
1016 emit(ARM_ADD_R(ARM_LR, ARM_IP, ARM_LR), ctx);
1018 emit(ARM_UMULL(ARM_IP, rd[0], rd[1], rt[1]), ctx);
1019 emit(ARM_ADD_R(rd[0], ARM_LR, rd[0]), ctx);
1055 emit(ARM_ADD_R(tmp[0], tmp[0], rd), ctx);
1062 emit(ARM_STRB_I(src_lo, rd, off), ctx);
1066 emit(ARM_STRH_I(src_lo, rd, off), ctx);
1070 emit(ARM_STR_I(src_lo, rd, off), ctx);
1074 emit(ARM_STR_I(src_lo, rd, off), ctx);
1075 emit(ARM_STR_I(src_hi, rd, off + 4), ctx);
1089 emit(ARM_ADD_R(tmp[0], tmp[0], src), ctx);
1093 emit(ARM_MOV_R(tmp[0], rm), ctx);
1099 emit(ARM_LDRB_I(rd[1], rm, off), ctx);
1105 emit(ARM_LDRH_I(rd[1], rm, off), ctx);
1111 emit(ARM_LDR_I(rd[1], rm, off), ctx);
1117 emit(ARM_LDR_I(rd[1], rm, off), ctx);
1118 emit(ARM_LDR_I(rd[0], rm, off + 4), ctx);
1131 emit(ARM_AND_R(ARM_IP, rt, rn), ctx);
1132 emit(ARM_AND_R(ARM_LR, rd, rm), ctx);
1133 emit(ARM_ORRS_R(ARM_IP, ARM_LR, ARM_IP), ctx);
1135 emit(ARM_ANDS_R(ARM_IP, rt, rn), ctx);
1145 emit(ARM_CMP_R(rd, rm), ctx);
1149 emit(ARM_CMP_R(rt, rn), ctx);
1154 emit(ARM_CMP_R(rn, rt), ctx);
1156 emit(ARM_SBCS_R(ARM_IP, rm, rd), ctx);
1160 emit(ARM_CMP_R(rt, rn), ctx);
1162 emit(ARM_SBCS_R(ARM_IP, rd, rm), ctx);
1195 emit(ARM_LDR_I(tmp[1], r_array, off), ctx);
1197 emit(ARM_CMP_R(r_index, tmp[1]), ctx);
1209 emit(ARM_CMP_I(tc[0], hi), ctx);
1212 emit(ARM_ADDS_I(tc[1], tc[1], 1), ctx);
1213 emit(ARM_ADC_I(tc[0], tc[0], 0), ctx);
1222 emit(ARM_ADD_I(tmp[1], r_array, off), ctx);
1223 emit(ARM_LDR_R_SI(tmp[1], tmp[1], r_index, SRTYPE_ASL, 2), ctx);
1224 emit(ARM_CMP_I(tmp[1], 0), ctx);
1231 emit(ARM_LDR_I(tmp[1], tmp[1], off), ctx);
1232 emit(ARM_ADD_I(tmp[1], tmp[1], ctx->prologue_bytes), ctx);
1254 emit(ARM_AND_I(tmp2[1], rn, 0xff), ctx);
1255 emit(ARM_MOV_SI(tmp2[0], rn, SRTYPE_LSR, 8), ctx);
1256 emit(ARM_AND_I(tmp2[0], tmp2[0], 0xff), ctx);
1257 emit(ARM_ORR_SI(rd, tmp2[0], tmp2[1], SRTYPE_LSL, 8), ctx);
1259 emit(ARM_REV16(rd, rn), ctx);
1269 emit(ARM_AND_I(tmp2[1], rn, 0xff), ctx);
1270 emit(ARM_MOV_SI(tmp2[0], rn, SRTYPE_LSR, 24), ctx);
1271 emit(ARM_ORR_SI(ARM_IP, tmp2[0], tmp2[1], SRTYPE_LSL, 24), ctx);
1273 emit(ARM_MOV_SI(tmp2[1], rn, SRTYPE_LSR, 8), ctx);
1274 emit(ARM_AND_I(tmp2[1], tmp2[1], 0xff), ctx);
1275 emit(ARM_MOV_SI(tmp2[0], rn, SRTYPE_LSR, 16), ctx);
1276 emit(ARM_AND_I(tmp2[0], tmp2[0], 0xff), ctx);
1277 emit(ARM_MOV_SI(tmp2[0], tmp2[0], SRTYPE_LSL, 8), ctx);
1278 emit(ARM_ORR_SI(tmp2[0], tmp2[0], tmp2[1], SRTYPE_LSL, 16), ctx);
1279 emit(ARM_ORR_R(rd, ARM_IP, tmp2[0]), ctx);
1282 emit(ARM_REV(rd, rn), ctx);
1296 emit(ARM_PUSH(reg_set), ctx);
1309 emit(ARM_MOV_R(ARM_IP, ARM_SP), ctx);
1310 emit(ARM_PUSH(reg_set), ctx);
1311 emit(ARM_SUB_I(ARM_FP, ARM_IP, 4), ctx);
1313 emit(ARM_PUSH(CALLEE_PUSH_MASK), ctx);
1314 emit(ARM_MOV_R(ARM_FP, ARM_SP), ctx);
1318 emit(ARM_MOV_I(bpf_r1[0], 0), ctx);
1319 emit(ARM_SUB_I(bpf_r1[1], ARM_SP, SCRATCH_SIZE), ctx);
1324 emit(ARM_SUB_I(ARM_SP, ARM_SP, ctx->stack_size), ctx);
1330 emit(ARM_MOV_I(bpf_r1[1], 0), ctx);
1334 emit(ARM_MOV_R(bpf_r1[1], arm_r0), ctx);
1346 emit(ARM_SUB_I(ARM_SP, ARM_FP, hweight16(reg_set) * 4), ctx);
1347 emit(ARM_LDM(ARM_SP, reg_set), ctx);
1350 emit(ARM_MOV_R(ARM_SP, ARM_FP), ctx);
1351 emit(ARM_POP(CALLEE_POP_MASK), ctx);
1578 emit(ARM_MOV_R(rd[0], ARM_LR), ctx);
1588 emit(ARM_AND_R(rd[1], rd[1], tmp2[1]), ctx);
1590 emit(ARM_UXTH(rd[1], rd[1]), ctx);
1593 emit(ARM_EOR_R(rd[0], rd[0], rd[0]), ctx);
1598 emit(ARM_EOR_R(rd[0], rd[0], rd[0]), ctx);
1785 emit(ARM_B(jmp_offset), ctx);
1813 emit(ARM_ADD_I(ARM_SP, ARM_SP, imm8m(24)), ctx); // callee clean
1825 emit(ARM_B(jmp_offset), ctx);