Lines Matching refs:emit
92 static inline void emit(const u32 insn, struct jit_ctx *ctx)
108 emit(A64_MOVN(is64, reg, (u16)~lo, 0), ctx);
110 emit(A64_MOVN(is64, reg, (u16)~hi, 16), ctx);
112 emit(A64_MOVK(is64, reg, lo, 0), ctx);
115 emit(A64_MOVZ(is64, reg, lo, 0), ctx);
117 emit(A64_MOVK(is64, reg, hi, 16), ctx);
143 emit(A64_MOVN(1, reg, (rev_tmp >> shift) & 0xffff, shift), ctx);
145 emit(A64_MOVZ(1, reg, (nrm_tmp >> shift) & 0xffff, shift), ctx);
149 emit(A64_MOVK(1, reg, (nrm_tmp >> shift) & 0xffff, shift), ctx);
157 emit(insn, ctx);
171 emit(A64_MOVN(1, reg, ~tmp & 0xffff, shift), ctx);
175 emit(A64_MOVK(1, reg, tmp & 0xffff, shift), ctx);
184 emit(A64_BLR(tmp), ctx);
333 emit(A64_MOV(1, A64_R(9), A64_LR), ctx);
334 emit(A64_NOP, ctx);
338 emit(A64_PACIASP, ctx);
341 emit(A64_PUSH(A64_FP, A64_LR, A64_SP), ctx);
342 emit(A64_MOV(1, A64_FP, A64_SP), ctx);
345 emit(A64_PUSH(r6, r7, A64_SP), ctx);
346 emit(A64_PUSH(r8, r9, A64_SP), ctx);
347 emit(A64_PUSH(fp, tcc, A64_SP), ctx);
348 emit(A64_PUSH(fpb, A64_R(28), A64_SP), ctx);
351 emit(A64_MOV(1, fp, A64_SP), ctx);
355 emit(A64_MOVZ(1, tcc, 0, 0), ctx);
368 emit(A64_SUB_I(1, fpb, fp, ctx->fpb_offset), ctx);
374 emit(A64_SUB_I(1, A64_SP, A64_SP, ctx->stack_size), ctx);
398 emit(A64_LDR32(tmp, r2, tmp), ctx);
399 emit(A64_MOV(0, r3, r3), ctx);
400 emit(A64_CMP(0, r3, tmp), ctx);
401 emit(A64_B_(A64_COND_CS, jmp_offset), ctx);
409 emit(A64_CMP(1, tcc, tmp), ctx);
410 emit(A64_B_(A64_COND_CS, jmp_offset), ctx);
411 emit(A64_ADD_I(1, tcc, tcc, 1), ctx);
419 emit(A64_ADD(1, tmp, r2, tmp), ctx);
420 emit(A64_LSL(1, prg, r3, 3), ctx);
421 emit(A64_LDR64(prg, tmp, prg), ctx);
422 emit(A64_CBZ(1, prg, jmp_offset), ctx);
427 emit(A64_LDR64(tmp, prg, tmp), ctx);
428 emit(A64_ADD_I(1, tmp, tmp, sizeof(u32) * PROLOGUE_OFFSET), ctx);
429 emit(A64_ADD_I(1, A64_SP, A64_SP, ctx->stack_size), ctx);
430 emit(A64_BR(tmp), ctx);
461 emit(A64_ADD(1, tmp, tmp, dst), ctx);
468 emit(A64_STADD(isdw, reg, src), ctx);
471 emit(A64_MVN(isdw, tmp2, src), ctx);
472 emit(A64_STCLR(isdw, reg, tmp2), ctx);
475 emit(A64_STSET(isdw, reg, src), ctx);
478 emit(A64_STEOR(isdw, reg, src), ctx);
482 emit(A64_LDADDAL(isdw, src, reg, src), ctx);
485 emit(A64_MVN(isdw, tmp2, src), ctx);
486 emit(A64_LDCLRAL(isdw, src, reg, tmp2), ctx);
489 emit(A64_LDSETAL(isdw, src, reg, src), ctx);
492 emit(A64_LDEORAL(isdw, src, reg, src), ctx);
496 emit(A64_SWPAL(isdw, src, reg, src), ctx);
500 emit(A64_CASAL(isdw, src, reg, bpf2a64[BPF_REG_0]), ctx);
535 emit(A64_ADD(1, tmp, tmp, dst), ctx);
542 emit(A64_LDXR(isdw, tmp2, reg), ctx);
544 emit(A64_ADD(isdw, tmp2, tmp2, src), ctx);
546 emit(A64_AND(isdw, tmp2, tmp2, src), ctx);
548 emit(A64_ORR(isdw, tmp2, tmp2, src), ctx);
550 emit(A64_EOR(isdw, tmp2, tmp2, src), ctx);
551 emit(A64_STXR(isdw, tmp2, reg, tmp3), ctx);
554 emit(A64_CBNZ(0, tmp3, jmp_offset), ctx);
562 emit(A64_MOV(isdw, ax, src), ctx);
563 emit(A64_LDXR(isdw, src, reg), ctx);
565 emit(A64_ADD(isdw, tmp2, src, ax), ctx);
567 emit(A64_AND(isdw, tmp2, src, ax), ctx);
569 emit(A64_ORR(isdw, tmp2, src, ax), ctx);
571 emit(A64_EOR(isdw, tmp2, src, ax), ctx);
572 emit(A64_STLXR(isdw, tmp2, reg, tmp3), ctx);
575 emit(A64_CBNZ(0, tmp3, jmp_offset), ctx);
576 emit(A64_DMB_ISH, ctx);
579 emit(A64_MOV(isdw, tmp2, src), ctx);
580 emit(A64_LDXR(isdw, src, reg), ctx);
581 emit(A64_STLXR(isdw, tmp2, reg, tmp3), ctx);
584 emit(A64_CBNZ(0, tmp3, jmp_offset), ctx);
585 emit(A64_DMB_ISH, ctx);
590 emit(A64_MOV(isdw, tmp2, r0), ctx);
591 emit(A64_LDXR(isdw, r0, reg), ctx);
592 emit(A64_EOR(isdw, tmp3, r0, tmp2), ctx);
595 emit(A64_CBNZ(isdw, tmp3, jmp_offset), ctx);
596 emit(A64_STLXR(isdw, src, reg, tmp3), ctx);
599 emit(A64_CBNZ(0, tmp3, jmp_offset), ctx);
600 emit(A64_DMB_ISH, ctx);
645 emit(A64_NOP, ctx);
649 emit(A64_LDR64LIT(tmp, 2 * AARCH64_INSN_SIZE), ctx);
650 emit(A64_BR(tmp), ctx);
667 emit(A64_ADD_I(1, A64_SP, A64_SP, ctx->stack_size), ctx);
670 emit(A64_POP(fpb, A64_R(28), A64_SP), ctx);
672 emit(A64_POP(fp, A64_R(26), A64_SP), ctx);
675 emit(A64_POP(r8, r9, A64_SP), ctx);
676 emit(A64_POP(r6, r7, A64_SP), ctx);
679 emit(A64_POP(A64_FP, A64_LR, A64_SP), ctx);
682 emit(A64_MOV(1, A64_R(0), r0), ctx);
686 emit(A64_AUTIASP, ctx);
688 emit(A64_RET(A64_LR), ctx);
791 emit(A64_MOV(is64, dst, src), ctx);
794 emit(A64_SXTB(is64, dst, src), ctx);
797 emit(A64_SXTH(is64, dst, src), ctx);
800 emit(A64_SXTW(is64, dst, src), ctx);
807 emit(A64_ADD(is64, dst, dst, src), ctx);
811 emit(A64_SUB(is64, dst, dst, src), ctx);
815 emit(A64_AND(is64, dst, dst, src), ctx);
819 emit(A64_ORR(is64, dst, dst, src), ctx);
823 emit(A64_EOR(is64, dst, dst, src), ctx);
827 emit(A64_MUL(is64, dst, dst, src), ctx);
832 emit(A64_UDIV(is64, dst, dst, src), ctx);
834 emit(A64_SDIV(is64, dst, dst, src), ctx);
839 emit(A64_UDIV(is64, tmp, dst, src), ctx);
841 emit(A64_SDIV(is64, tmp, dst, src), ctx);
842 emit(A64_MSUB(is64, dst, dst, tmp, src), ctx);
846 emit(A64_LSLV(is64, dst, dst, src), ctx);
850 emit(A64_LSRV(is64, dst, dst, src), ctx);
854 emit(A64_ASRV(is64, dst, dst, src), ctx);
859 emit(A64_NEG(is64, dst, dst), ctx);
874 emit(A64_REV16(is64, dst, dst), ctx);
876 emit(A64_UXTH(is64, dst, dst), ctx);
879 emit(A64_REV32(is64, dst, dst), ctx);
883 emit(A64_REV64(dst, dst), ctx);
891 emit(A64_UXTH(is64, dst, dst), ctx);
895 emit(A64_UXTW(is64, dst, dst), ctx);
911 emit(A64_ADD_I(is64, dst, dst, imm), ctx);
913 emit(A64_SUB_I(is64, dst, dst, -imm), ctx);
916 emit(A64_ADD(is64, dst, dst, tmp), ctx);
922 emit(A64_SUB_I(is64, dst, dst, imm), ctx);
924 emit(A64_ADD_I(is64, dst, dst, -imm), ctx);
927 emit(A64_SUB(is64, dst, dst, tmp), ctx);
934 emit(a64_insn, ctx);
937 emit(A64_AND(is64, dst, dst, tmp), ctx);
944 emit(a64_insn, ctx);
947 emit(A64_ORR(is64, dst, dst, tmp), ctx);
954 emit(a64_insn, ctx);
957 emit(A64_EOR(is64, dst, dst, tmp), ctx);
963 emit(A64_MUL(is64, dst, dst, tmp), ctx);
969 emit(A64_UDIV(is64, dst, dst, tmp), ctx);
971 emit(A64_SDIV(is64, dst, dst, tmp), ctx);
977 emit(A64_UDIV(is64, tmp, dst, tmp2), ctx);
979 emit(A64_SDIV(is64, tmp, dst, tmp2), ctx);
980 emit(A64_MSUB(is64, dst, dst, tmp, tmp2), ctx);
984 emit(A64_LSL(is64, dst, dst, imm), ctx);
988 emit(A64_LSR(is64, dst, dst, imm), ctx);
992 emit(A64_ASR(is64, dst, dst, imm), ctx);
1003 emit(A64_B(jmp_offset), ctx);
1026 emit(A64_CMP(is64, dst, src), ctx);
1065 emit(A64_B_(jmp_cond, jmp_offset), ctx);
1069 emit(A64_TST(is64, dst, src), ctx);
1093 emit(A64_CMP_I(is64, dst, imm), ctx);
1095 emit(A64_CMN_I(is64, dst, -imm), ctx);
1098 emit(A64_CMP(is64, dst, tmp), ctx);
1105 emit(a64_insn, ctx);
1108 emit(A64_TST(is64, dst, tmp), ctx);
1123 emit(A64_MOV(1, r0, A64_R(0)), ctx);
1139 emit(A64_B(jmp_offset), ctx);
1186 emit(A64_LDRSWI(dst, src_adj, off_adj), ctx);
1188 emit(A64_LDR32I(dst, src_adj, off_adj), ctx);
1192 emit(A64_LDRSW(dst, src_adj, off_adj), ctx);
1194 emit(A64_LDR32(dst, src, tmp), ctx);
1200 emit(A64_LDRSHI(dst, src_adj, off_adj), ctx);
1202 emit(A64_LDRHI(dst, src_adj, off_adj), ctx);
1206 emit(A64_LDRSH(dst, src, tmp), ctx);
1208 emit(A64_LDRH(dst, src, tmp), ctx);
1214 emit(A64_LDRSBI(dst, src_adj, off_adj), ctx);
1216 emit(A64_LDRBI(dst, src_adj, off_adj), ctx);
1220 emit(A64_LDRSB(dst, src, tmp), ctx);
1222 emit(A64_LDRB(dst, src, tmp), ctx);
1227 emit(A64_LDR64I(dst, src_adj, off_adj), ctx);
1230 emit(A64_LDR64(dst, src, tmp), ctx);
1270 emit(A64_STR32I(tmp, dst_adj, off_adj), ctx);
1273 emit(A64_STR32(tmp, dst, tmp2), ctx);
1278 emit(A64_STRHI(tmp, dst_adj, off_adj), ctx);
1281 emit(A64_STRH(tmp, dst, tmp2), ctx);
1286 emit(A64_STRBI(tmp, dst_adj, off_adj), ctx);
1289 emit(A64_STRB(tmp, dst, tmp2), ctx);
1294 emit(A64_STR64I(tmp, dst_adj, off_adj), ctx);
1297 emit(A64_STR64(tmp, dst, tmp2), ctx);
1318 emit(A64_STR32I(src, dst_adj, off_adj), ctx);
1321 emit(A64_STR32(src, dst, tmp), ctx);
1326 emit(A64_STRHI(src, dst_adj, off_adj), ctx);
1329 emit(A64_STRH(src, dst, tmp), ctx);
1334 emit(A64_STRBI(src, dst_adj, off_adj), ctx);
1337 emit(A64_STRB(src, dst, tmp), ctx);
1342 emit(A64_STR64I(src, dst_adj, off_adj), ctx);
1345 emit(A64_STR64(src, dst, tmp), ctx);
1722 emit(A64_STR64I(A64_ZR, A64_SP, run_ctx_off + cookie_off), ctx);
1725 emit(A64_STR64I(A64_R(10), A64_SP, run_ctx_off + cookie_off),
1735 emit(A64_MOV(1, A64_R(0), A64_R(19)), ctx);
1737 emit(A64_ADD_I(1, A64_R(1), A64_SP, run_ctx_off), ctx);
1745 emit(A64_NOP, ctx);
1748 emit(A64_MOV(1, A64_R(20), A64_R(0)), ctx);
1750 emit(A64_ADD_I(1, A64_R(0), A64_SP, args_off), ctx);
1757 emit(A64_STR64I(A64_R(0), A64_SP, retval_off), ctx);
1765 emit(A64_MOV(1, A64_R(0), A64_R(19)), ctx);
1767 emit(A64_MOV(1, A64_R(1), A64_R(20)), ctx);
1769 emit(A64_ADD_I(1, A64_R(2), A64_SP, run_ctx_off), ctx);
1783 emit(A64_STR64I(A64_ZR, A64_SP, retval_off), ctx);
1790 emit(A64_LDR64I(A64_R(10), A64_SP, retval_off), ctx);
1795 emit(A64_NOP, ctx);
1804 emit(A64_STR64I(i, A64_SP, args_off), ctx);
1814 emit(A64_LDR64I(i, A64_SP, args_off), ctx);
1917 emit(A64_PUSH(A64_FP, A64_R(9), A64_SP), ctx);
1918 emit(A64_MOV(1, A64_FP, A64_SP), ctx);
1921 emit(A64_PUSH(A64_FP, A64_LR, A64_SP), ctx);
1922 emit(A64_MOV(1, A64_FP, A64_SP), ctx);
1925 emit(A64_SUB_I(1, A64_SP, A64_SP, stack_size), ctx);
1930 emit(A64_STR64I(A64_R(10), A64_SP, ip_off), ctx);
1934 emit(A64_MOVZ(1, A64_R(10), nregs, 0), ctx);
1935 emit(A64_STR64I(A64_R(10), A64_SP, nregs_off), ctx);
1941 emit(A64_STR64I(A64_R(19), A64_SP, regs_off), ctx);
1942 emit(A64_STR64I(A64_R(20), A64_SP, regs_off + 8), ctx);
1967 emit(A64_LDR64I(A64_R(10), A64_SP, retaddr_off), ctx);
1968 emit(A64_ADR(A64_LR, AARCH64_INSN_SIZE * 2), ctx);
1969 emit(A64_RET(A64_R(10)), ctx);
1971 emit(A64_STR64I(A64_R(0), A64_SP, retval_off), ctx);
1974 emit(A64_NOP, ctx);
1997 emit(A64_LDR64I(A64_R(19), A64_SP, regs_off), ctx);
1998 emit(A64_LDR64I(A64_R(20), A64_SP, regs_off + 8), ctx);
2001 emit(A64_LDR64I(A64_R(0), A64_SP, retval_off), ctx);
2004 emit(A64_MOV(1, A64_SP, A64_FP), ctx);
2007 emit(A64_POP(A64_FP, A64_LR, A64_SP), ctx);
2008 emit(A64_POP(A64_FP, A64_R(9), A64_SP), ctx);
2012 emit(A64_MOV(1, A64_LR, A64_R(9)), ctx);
2013 emit(A64_RET(A64_R(9)), ctx);
2016 emit(A64_MOV(1, A64_R(10), A64_LR), ctx);
2017 emit(A64_MOV(1, A64_LR, A64_R(9)), ctx);
2018 emit(A64_RET(A64_R(10)), ctx);