Lines Matching refs:emit

93 static inline void emit(const u32 insn, struct jit_ctx *ctx)
109 emit(A64_MOVN(is64, reg, (u16)~lo, 0), ctx);
111 emit(A64_MOVN(is64, reg, (u16)~hi, 16), ctx);
113 emit(A64_MOVK(is64, reg, lo, 0), ctx);
116 emit(A64_MOVZ(is64, reg, lo, 0), ctx);
118 emit(A64_MOVK(is64, reg, hi, 16), ctx);
144 emit(A64_MOVN(1, reg, (rev_tmp >> shift) & 0xffff, shift), ctx);
146 emit(A64_MOVZ(1, reg, (nrm_tmp >> shift) & 0xffff, shift), ctx);
150 emit(A64_MOVK(1, reg, (nrm_tmp >> shift) & 0xffff, shift), ctx);
158 emit(insn, ctx);
172 emit(A64_MOVN(1, reg, ~tmp & 0xffff, shift), ctx);
176 emit(A64_MOVK(1, reg, tmp & 0xffff, shift), ctx);
185 emit(A64_BLR(tmp), ctx);
343 emit(A64_MOV(1, A64_R(9), A64_LR), ctx);
344 emit(A64_NOP, ctx);
349 emit(A64_PACIASP, ctx);
351 emit(A64_PUSH(A64_FP, A64_LR, A64_SP), ctx);
352 emit(A64_MOV(1, A64_FP, A64_SP), ctx);
355 emit(A64_PUSH(r6, r7, A64_SP), ctx);
356 emit(A64_PUSH(r8, r9, A64_SP), ctx);
357 emit(A64_PUSH(fp, tcc, A64_SP), ctx);
358 emit(A64_PUSH(fpb, A64_R(28), A64_SP), ctx);
364 emit(A64_MOV(1, A64_FP, A64_R(2)), ctx);
372 emit(A64_SUB_I(1, A64_SP, A64_FP, 80), ctx);
376 emit(A64_MOV(1, fp, A64_SP), ctx);
380 emit(A64_MOVZ(1, tcc, 0, 0), ctx);
403 emit(A64_SUB_I(1, fp, fp, 16), ctx);
404 emit(A64_PUSH(A64_R(23), A64_R(24), A64_SP), ctx);
407 emit(A64_SUB_I(1, fpb, fp, ctx->fpb_offset), ctx);
413 emit(A64_SUB_I(1, A64_SP, A64_SP, ctx->stack_size), ctx);
437 emit(A64_LDR32(tmp, r2, tmp), ctx);
438 emit(A64_MOV(0, r3, r3), ctx);
439 emit(A64_CMP(0, r3, tmp), ctx);
440 emit(A64_B_(A64_COND_CS, jmp_offset), ctx);
448 emit(A64_CMP(1, tcc, tmp), ctx);
449 emit(A64_B_(A64_COND_CS, jmp_offset), ctx);
450 emit(A64_ADD_I(1, tcc, tcc, 1), ctx);
458 emit(A64_ADD(1, tmp, r2, tmp), ctx);
459 emit(A64_LSL(1, prg, r3, 3), ctx);
460 emit(A64_LDR64(prg, tmp, prg), ctx);
461 emit(A64_CBZ(1, prg, jmp_offset), ctx);
466 emit(A64_LDR64(tmp, prg, tmp), ctx);
467 emit(A64_ADD_I(1, tmp, tmp, sizeof(u32) * PROLOGUE_OFFSET), ctx);
468 emit(A64_ADD_I(1, A64_SP, A64_SP, ctx->stack_size), ctx);
469 emit(A64_BR(tmp), ctx);
500 emit(A64_ADD(1, tmp, tmp, dst), ctx);
507 emit(A64_STADD(isdw, reg, src), ctx);
510 emit(A64_MVN(isdw, tmp2, src), ctx);
511 emit(A64_STCLR(isdw, reg, tmp2), ctx);
514 emit(A64_STSET(isdw, reg, src), ctx);
517 emit(A64_STEOR(isdw, reg, src), ctx);
521 emit(A64_LDADDAL(isdw, src, reg, src), ctx);
524 emit(A64_MVN(isdw, tmp2, src), ctx);
525 emit(A64_LDCLRAL(isdw, src, reg, tmp2), ctx);
528 emit(A64_LDSETAL(isdw, src, reg, src), ctx);
531 emit(A64_LDEORAL(isdw, src, reg, src), ctx);
535 emit(A64_SWPAL(isdw, src, reg, src), ctx);
539 emit(A64_CASAL(isdw, src, reg, bpf2a64[BPF_REG_0]), ctx);
574 emit(A64_ADD(1, tmp, tmp, dst), ctx);
581 emit(A64_LDXR(isdw, tmp2, reg), ctx);
583 emit(A64_ADD(isdw, tmp2, tmp2, src), ctx);
585 emit(A64_AND(isdw, tmp2, tmp2, src), ctx);
587 emit(A64_ORR(isdw, tmp2, tmp2, src), ctx);
589 emit(A64_EOR(isdw, tmp2, tmp2, src), ctx);
590 emit(A64_STXR(isdw, tmp2, reg, tmp3), ctx);
593 emit(A64_CBNZ(0, tmp3, jmp_offset), ctx);
601 emit(A64_MOV(isdw, ax, src), ctx);
602 emit(A64_LDXR(isdw, src, reg), ctx);
604 emit(A64_ADD(isdw, tmp2, src, ax), ctx);
606 emit(A64_AND(isdw, tmp2, src, ax), ctx);
608 emit(A64_ORR(isdw, tmp2, src, ax), ctx);
610 emit(A64_EOR(isdw, tmp2, src, ax), ctx);
611 emit(A64_STLXR(isdw, tmp2, reg, tmp3), ctx);
614 emit(A64_CBNZ(0, tmp3, jmp_offset), ctx);
615 emit(A64_DMB_ISH, ctx);
618 emit(A64_MOV(isdw, tmp2, src), ctx);
619 emit(A64_LDXR(isdw, src, reg), ctx);
620 emit(A64_STLXR(isdw, tmp2, reg, tmp3), ctx);
623 emit(A64_CBNZ(0, tmp3, jmp_offset), ctx);
624 emit(A64_DMB_ISH, ctx);
629 emit(A64_MOV(isdw, tmp2, r0), ctx);
630 emit(A64_LDXR(isdw, r0, reg), ctx);
631 emit(A64_EOR(isdw, tmp3, r0, tmp2), ctx);
634 emit(A64_CBNZ(isdw, tmp3, jmp_offset), ctx);
635 emit(A64_STLXR(isdw, src, reg, tmp3), ctx);
638 emit(A64_CBNZ(0, tmp3, jmp_offset), ctx);
639 emit(A64_DMB_ISH, ctx);
684 emit(A64_NOP, ctx);
688 emit(A64_LDR64LIT(tmp, 2 * AARCH64_INSN_SIZE), ctx);
689 emit(A64_BR(tmp), ctx);
706 emit(A64_ADD_I(1, A64_SP, A64_SP, ctx->stack_size), ctx);
715 emit(A64_POP(A64_R(23), A64_R(24), A64_SP), ctx);
718 emit(A64_POP(fpb, A64_R(28), A64_SP), ctx);
720 emit(A64_POP(fp, A64_R(26), A64_SP), ctx);
723 emit(A64_POP(r8, r9, A64_SP), ctx);
724 emit(A64_POP(r6, r7, A64_SP), ctx);
727 emit(A64_POP(A64_FP, A64_LR, A64_SP), ctx);
730 emit(A64_MOV(1, A64_R(0), r0), ctx);
734 emit(A64_AUTIASP, ctx);
736 emit(A64_RET(A64_LR), ctx);
858 emit(A64_MOV(is64, dst, src), ctx);
861 emit(A64_SXTB(is64, dst, src), ctx);
864 emit(A64_SXTH(is64, dst, src), ctx);
867 emit(A64_SXTW(is64, dst, src), ctx);
874 emit(A64_ADD(is64, dst, dst, src), ctx);
878 emit(A64_SUB(is64, dst, dst, src), ctx);
882 emit(A64_AND(is64, dst, dst, src), ctx);
886 emit(A64_ORR(is64, dst, dst, src), ctx);
890 emit(A64_EOR(is64, dst, dst, src), ctx);
894 emit(A64_MUL(is64, dst, dst, src), ctx);
899 emit(A64_UDIV(is64, dst, dst, src), ctx);
901 emit(A64_SDIV(is64, dst, dst, src), ctx);
906 emit(A64_UDIV(is64, tmp, dst, src), ctx);
908 emit(A64_SDIV(is64, tmp, dst, src), ctx);
909 emit(A64_MSUB(is64, dst, dst, tmp, src), ctx);
913 emit(A64_LSLV(is64, dst, dst, src), ctx);
917 emit(A64_LSRV(is64, dst, dst, src), ctx);
921 emit(A64_ASRV(is64, dst, dst, src), ctx);
926 emit(A64_NEG(is64, dst, dst), ctx);
941 emit(A64_REV16(is64, dst, dst), ctx);
943 emit(A64_UXTH(is64, dst, dst), ctx);
946 emit(A64_REV32(0, dst, dst), ctx);
950 emit(A64_REV64(dst, dst), ctx);
958 emit(A64_UXTH(is64, dst, dst), ctx);
962 emit(A64_UXTW(is64, dst, dst), ctx);
978 emit(A64_ADD_I(is64, dst, dst, imm), ctx);
980 emit(A64_SUB_I(is64, dst, dst, -imm), ctx);
983 emit(A64_ADD(is64, dst, dst, tmp), ctx);
989 emit(A64_SUB_I(is64, dst, dst, imm), ctx);
991 emit(A64_ADD_I(is64, dst, dst, -imm), ctx);
994 emit(A64_SUB(is64, dst, dst, tmp), ctx);
1001 emit(a64_insn, ctx);
1004 emit(A64_AND(is64, dst, dst, tmp), ctx);
1011 emit(a64_insn, ctx);
1014 emit(A64_ORR(is64, dst, dst, tmp), ctx);
1021 emit(a64_insn, ctx);
1024 emit(A64_EOR(is64, dst, dst, tmp), ctx);
1030 emit(A64_MUL(is64, dst, dst, tmp), ctx);
1036 emit(A64_UDIV(is64, dst, dst, tmp), ctx);
1038 emit(A64_SDIV(is64, dst, dst, tmp), ctx);
1044 emit(A64_UDIV(is64, tmp, dst, tmp2), ctx);
1046 emit(A64_SDIV(is64, tmp, dst, tmp2), ctx);
1047 emit(A64_MSUB(is64, dst, dst, tmp, tmp2), ctx);
1051 emit(A64_LSL(is64, dst, dst, imm), ctx);
1055 emit(A64_LSR(is64, dst, dst, imm), ctx);
1059 emit(A64_ASR(is64, dst, dst, imm), ctx);
1070 emit(A64_B(jmp_offset), ctx);
1093 emit(A64_CMP(is64, dst, src), ctx);
1132 emit(A64_B_(jmp_cond, jmp_offset), ctx);
1136 emit(A64_TST(is64, dst, src), ctx);
1160 emit(A64_CMP_I(is64, dst, imm), ctx);
1162 emit(A64_CMN_I(is64, dst, -imm), ctx);
1165 emit(A64_CMP(is64, dst, tmp), ctx);
1172 emit(a64_insn, ctx);
1175 emit(A64_TST(is64, dst, tmp), ctx);
1190 emit(A64_MOV(1, r0, A64_R(0)), ctx);
1206 emit(A64_B(jmp_offset), ctx);
1253 emit(A64_LDRSWI(dst, src_adj, off_adj), ctx);
1255 emit(A64_LDR32I(dst, src_adj, off_adj), ctx);
1259 emit(A64_LDRSW(dst, src, tmp), ctx);
1261 emit(A64_LDR32(dst, src, tmp), ctx);
1267 emit(A64_LDRSHI(dst, src_adj, off_adj), ctx);
1269 emit(A64_LDRHI(dst, src_adj, off_adj), ctx);
1273 emit(A64_LDRSH(dst, src, tmp), ctx);
1275 emit(A64_LDRH(dst, src, tmp), ctx);
1281 emit(A64_LDRSBI(dst, src_adj, off_adj), ctx);
1283 emit(A64_LDRBI(dst, src_adj, off_adj), ctx);
1287 emit(A64_LDRSB(dst, src, tmp), ctx);
1289 emit(A64_LDRB(dst, src, tmp), ctx);
1294 emit(A64_LDR64I(dst, src_adj, off_adj), ctx);
1297 emit(A64_LDR64(dst, src, tmp), ctx);
1337 emit(A64_STR32I(tmp, dst_adj, off_adj), ctx);
1340 emit(A64_STR32(tmp, dst, tmp2), ctx);
1345 emit(A64_STRHI(tmp, dst_adj, off_adj), ctx);
1348 emit(A64_STRH(tmp, dst, tmp2), ctx);
1353 emit(A64_STRBI(tmp, dst_adj, off_adj), ctx);
1356 emit(A64_STRB(tmp, dst, tmp2), ctx);
1361 emit(A64_STR64I(tmp, dst_adj, off_adj), ctx);
1364 emit(A64_STR64(tmp, dst, tmp2), ctx);
1385 emit(A64_STR32I(src, dst_adj, off_adj), ctx);
1388 emit(A64_STR32(src, dst, tmp), ctx);
1393 emit(A64_STRHI(src, dst_adj, off_adj), ctx);
1396 emit(A64_STRH(src, dst, tmp), ctx);
1401 emit(A64_STRBI(src, dst_adj, off_adj), ctx);
1404 emit(A64_STRB(src, dst, tmp), ctx);
1409 emit(A64_STR64I(src, dst_adj, off_adj), ctx);
1412 emit(A64_STR64(src, dst, tmp), ctx);
1828 emit(A64_STR64I(A64_ZR, A64_SP, run_ctx_off + cookie_off), ctx);
1831 emit(A64_STR64I(A64_R(10), A64_SP, run_ctx_off + cookie_off),
1841 emit(A64_MOV(1, A64_R(0), A64_R(19)), ctx);
1843 emit(A64_ADD_I(1, A64_R(1), A64_SP, run_ctx_off), ctx);
1848 emit(A64_MOV(1, A64_R(20), A64_R(0)), ctx);
1854 emit(A64_NOP, ctx);
1856 emit(A64_ADD_I(1, A64_R(0), A64_SP, args_off), ctx);
1863 emit(A64_STR64I(A64_R(0), A64_SP, retval_off), ctx);
1871 emit(A64_MOV(1, A64_R(0), A64_R(19)), ctx);
1873 emit(A64_MOV(1, A64_R(1), A64_R(20)), ctx);
1875 emit(A64_ADD_I(1, A64_R(2), A64_SP, run_ctx_off), ctx);
1889 emit(A64_STR64I(A64_ZR, A64_SP, retval_off), ctx);
1896 emit(A64_LDR64I(A64_R(10), A64_SP, retval_off), ctx);
1901 emit(A64_NOP, ctx);
1910 emit(A64_STR64I(i, A64_SP, args_off), ctx);
1920 emit(A64_LDR64I(i, A64_SP, args_off), ctx);
2023 emit(A64_PUSH(A64_FP, A64_R(9), A64_SP), ctx);
2024 emit(A64_MOV(1, A64_FP, A64_SP), ctx);
2027 emit(A64_PUSH(A64_FP, A64_LR, A64_SP), ctx);
2028 emit(A64_MOV(1, A64_FP, A64_SP), ctx);
2031 emit(A64_SUB_I(1, A64_SP, A64_SP, stack_size), ctx);
2036 emit(A64_STR64I(A64_R(10), A64_SP, ip_off), ctx);
2040 emit(A64_MOVZ(1, A64_R(10), nregs, 0), ctx);
2041 emit(A64_STR64I(A64_R(10), A64_SP, nregs_off), ctx);
2047 emit(A64_STR64I(A64_R(19), A64_SP, regs_off), ctx);
2048 emit(A64_STR64I(A64_R(20), A64_SP, regs_off + 8), ctx);
2073 emit(A64_LDR64I(A64_R(10), A64_SP, retaddr_off), ctx);
2074 emit(A64_ADR(A64_LR, AARCH64_INSN_SIZE * 2), ctx);
2075 emit(A64_RET(A64_R(10)), ctx);
2077 emit(A64_STR64I(A64_R(0), A64_SP, retval_off), ctx);
2080 emit(A64_NOP, ctx);
2103 emit(A64_LDR64I(A64_R(19), A64_SP, regs_off), ctx);
2104 emit(A64_LDR64I(A64_R(20), A64_SP, regs_off + 8), ctx);
2107 emit(A64_LDR64I(A64_R(0), A64_SP, retval_off), ctx);
2110 emit(A64_MOV(1, A64_SP, A64_FP), ctx);
2113 emit(A64_POP(A64_FP, A64_LR, A64_SP), ctx);
2114 emit(A64_POP(A64_FP, A64_R(9), A64_SP), ctx);
2118 emit(A64_MOV(1, A64_LR, A64_R(9)), ctx);
2119 emit(A64_RET(A64_R(9)), ctx);
2122 emit(A64_MOV(1, A64_R(10), A64_LR), ctx);
2123 emit(A64_MOV(1, A64_LR, A64_R(9)), ctx);
2124 emit(A64_RET(A64_R(10)), ctx);