Lines Matching refs:compiler

144 static sljit_s32 push_inst(struct sljit_compiler *compiler, sljit_ins ins)  in push_inst()  argument
146 sljit_ins *ptr = (sljit_ins*)ensure_buf(compiler, sizeof(sljit_ins)); in push_inst()
149 compiler->size++; in push_inst()
153 static SLJIT_INLINE sljit_s32 emit_imm64_const(struct sljit_compiler *compiler, sljit_s32 dst, slji… in emit_imm64_const() argument
155 FAIL_IF(push_inst(compiler, MOVZ | RD(dst) | ((sljit_ins)(imm & 0xffff) << 5))); in emit_imm64_const()
156 …FAIL_IF(push_inst(compiler, MOVK | RD(dst) | (((sljit_ins)(imm >> 16) & 0xffff) << 5) | (1 << 21))… in emit_imm64_const()
157 …FAIL_IF(push_inst(compiler, MOVK | RD(dst) | (((sljit_ins)(imm >> 32) & 0xffff) << 5) | (2 << 21))… in emit_imm64_const()
158 return push_inst(compiler, MOVK | RD(dst) | ((sljit_ins)(imm >> 48) << 5) | (3 << 21)); in emit_imm64_const()
231 SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compiler) in sljit_generate_code() argument
250 CHECK_PTR(check_sljit_generate_code(compiler)); in sljit_generate_code()
251 reverse_buf(compiler); in sljit_generate_code()
253 …code = (sljit_ins*)SLJIT_MALLOC_EXEC(compiler->size * sizeof(sljit_ins), compiler->exec_allocator_… in sljit_generate_code()
255 buf = compiler->buf; in sljit_generate_code()
262 label = compiler->labels; in sljit_generate_code()
263 jump = compiler->jumps; in sljit_generate_code()
264 const_ = compiler->consts; in sljit_generate_code()
265 put_label = compiler->put_labels; in sljit_generate_code()
318 SLJIT_ASSERT(code_ptr - code <= (sljit_sw)compiler->size); in sljit_generate_code()
320 jump = compiler->jumps; in sljit_generate_code()
355 put_label = compiler->put_labels; in sljit_generate_code()
372 compiler->error = SLJIT_ERR_COMPILED; in sljit_generate_code()
373 compiler->executable_offset = executable_offset; in sljit_generate_code()
374 compiler->executable_size = (sljit_uw)(code_ptr - code) * sizeof(sljit_ins); in sljit_generate_code()
507 static sljit_s32 load_immediate(struct sljit_compiler *compiler, sljit_s32 dst, sljit_sw simm) in load_immediate() argument
515 return push_inst(compiler, MOVZ | RD(dst) | ((sljit_ins)imm << 5)); in load_immediate()
518 return push_inst(compiler, MOVN | RD(dst) | (((sljit_ins)~imm & 0xffff) << 5)); in load_immediate()
522 return push_inst(compiler, MOVZ | RD(dst) | ((sljit_ins)(imm >> 16) << 5) | (1 << 21)); in load_immediate()
524 return push_inst(compiler, (MOVN ^ W_OP) | RD(dst) | (((sljit_ins)~imm & 0xffff) << 5)); in load_immediate()
526 …return push_inst(compiler, (MOVN ^ W_OP) | RD(dst) | (((sljit_ins)~imm & 0xffff0000u) >> (16 - 5))… in load_immediate()
530 return push_inst(compiler, (ORRI ^ W_OP) | RD(dst) | RN(TMP_ZERO) | bitmask); in load_immediate()
532 FAIL_IF(push_inst(compiler, MOVZ | RD(dst) | (((sljit_ins)imm & 0xffff) << 5))); in load_immediate()
533 …return push_inst(compiler, MOVK | RD(dst) | (((sljit_ins)imm & 0xffff0000u) >> (16 - 5)) | (1 << 2… in load_immediate()
538 return push_inst(compiler, ORRI | RD(dst) | RN(TMP_ZERO) | bitmask); in load_immediate()
542 …return push_inst(compiler, MOVN | RD(dst) | (((sljit_ins)~imm & 0xffff0000u) >> (16 - 5)) | (1 << … in load_immediate()
544 FAIL_IF(push_inst(compiler, MOVN | RD(dst) | (((sljit_ins)~imm & 0xffff) << 5))); in load_immediate()
545 …return push_inst(compiler, MOVK | RD(dst) | (((sljit_ins)imm & 0xffff0000u) >> (16 - 5)) | (1 << 2… in load_immediate()
571 FAIL_IF(push_inst(compiler, MOVN | RD(dst) | (((sljit_ins)simm & 0xffff) << 5) | (i << 21))); in load_immediate()
574 FAIL_IF(push_inst(compiler, MOVK | RD(dst) | (((sljit_ins)~simm & 0xffff) << 5) | (i << 21))); in load_immediate()
587 FAIL_IF(push_inst(compiler, MOVZ | RD(dst) | (((sljit_ins)simm & 0xffff) << 5) | (i << 21))); in load_immediate()
590 FAIL_IF(push_inst(compiler, MOVK | RD(dst) | (((sljit_ins)simm & 0xffff) << 5) | (i << 21))); in load_immediate()
609 static sljit_s32 emit_op_imm(struct sljit_compiler *compiler, sljit_s32 flags, sljit_s32 dst, sljit… in emit_op_imm() argument
626 FAIL_IF(load_immediate(compiler, TMP_REG1, arg1)); in emit_op_imm()
646 return load_immediate(compiler, dst, imm); in emit_op_imm()
649 FAIL_IF(load_immediate(compiler, dst, (flags & INT_OP) ? (~imm & 0xffffffff) : ~imm)); in emit_op_imm()
652 compiler->status_flags_state = SLJIT_CURRENT_FLAGS_SUB; in emit_op_imm()
659 compiler->status_flags_state = SLJIT_CURRENT_FLAGS_ADD; in emit_op_imm()
663 return push_inst(compiler, ((op == SLJIT_ADD ? ADDI : SUBI) ^ inv_bits) | RD(dst) | RN(reg)); in emit_op_imm()
667 return push_inst(compiler, (ADDI ^ inv_bits) | RD(dst) | RN(reg) | ((sljit_ins)imm << 10)); in emit_op_imm()
672 return push_inst(compiler, (SUBI ^ inv_bits) | RD(dst) | RN(reg) | ((sljit_ins)nimm << 10)); in emit_op_imm()
676 …return push_inst(compiler, (ADDI ^ inv_bits) | RD(dst) | RN(reg) | (((sljit_ins)imm >> 12) << 10) … in emit_op_imm()
680 …return push_inst(compiler, (SUBI ^ inv_bits) | RD(dst) | RN(reg) | (((sljit_ins)nimm >> 12) << 10)… in emit_op_imm()
683 …FAIL_IF(push_inst(compiler, (ADDI ^ inv_bits) | RD(dst) | RN(reg) | (((sljit_ins)imm >> 12) << 10)… in emit_op_imm()
684 …return push_inst(compiler, (ADDI ^ inv_bits) | RD(dst) | RN(dst) | (((sljit_ins)imm & 0xfff) << 10… in emit_op_imm()
687 …FAIL_IF(push_inst(compiler, (SUBI ^ inv_bits) | RD(dst) | RN(reg) | (((sljit_ins)nimm >> 12) << 10… in emit_op_imm()
688 …return push_inst(compiler, (SUBI ^ inv_bits) | RD(dst) | RN(dst) | (((sljit_ins)nimm & 0xfff) << 1… in emit_op_imm()
696 return push_inst(compiler, (ANDI ^ inv_bits) | RD(dst) | RN(reg) | inst_bits); in emit_op_imm()
706 FAIL_IF(push_inst(compiler, (inst_bits ^ inv_bits) | RD(dst) | RN(reg))); in emit_op_imm()
721 FAIL_IF(push_inst(compiler, (UBFM ^ inv_bits) | RD(dst) | RN(arg1) | inst_bits)); in emit_op_imm()
741 FAIL_IF(push_inst(compiler, (UBFM ^ inv_bits) | RD(dst) | RN(arg1) | inst_bits)); in emit_op_imm()
752 …return push_inst(compiler, (EXTR ^ (inv_bits | (inv_bits >> 9))) | RD(dst) | RN(arg1) | RM(arg1) |… in emit_op_imm()
762 FAIL_IF(load_immediate(compiler, TMP_REG2, arg2)); in emit_op_imm()
770 FAIL_IF(load_immediate(compiler, TMP_REG1, arg1)); in emit_op_imm()
783 return push_inst(compiler, ORR | RD(dst) | RN(TMP_ZERO) | RM(arg2)); in emit_op_imm()
786 return push_inst(compiler, (UBFM ^ W_OP) | RD(dst) | RN(arg2) | (7 << 10)); in emit_op_imm()
791 return push_inst(compiler, (SBFM ^ inv_bits) | RD(dst) | RN(arg2) | (7 << 10)); in emit_op_imm()
794 return push_inst(compiler, (UBFM ^ W_OP) | RD(dst) | RN(arg2) | (15 << 10)); in emit_op_imm()
799 return push_inst(compiler, (SBFM ^ inv_bits) | RD(dst) | RN(arg2) | (15 << 10)); in emit_op_imm()
807 return push_inst(compiler, (ORR ^ W_OP) | RD(dst) | RN(TMP_ZERO) | RM(arg2)); in emit_op_imm()
810 return push_inst(compiler, SBFM | (1 << 22) | RD(dst) | RN(arg2) | (31 << 10)); in emit_op_imm()
813 FAIL_IF(push_inst(compiler, (ORN ^ inv_bits) | RD(dst) | RN(TMP_ZERO) | RM(arg2))); in emit_op_imm()
817 return push_inst(compiler, (CLZ ^ inv_bits) | RD(dst) | RN(arg2)); in emit_op_imm()
820 FAIL_IF(push_inst(compiler, (RBIT ^ inv_bits) | RD(dst) | RN(arg2))); in emit_op_imm()
821 return push_inst(compiler, (CLZ ^ inv_bits) | RD(dst) | RN(dst)); in emit_op_imm()
823 compiler->status_flags_state = SLJIT_CURRENT_FLAGS_ADD; in emit_op_imm()
825 return push_inst(compiler, (ADD ^ inv_bits) | RD(dst) | RN(arg1) | RM(arg2)); in emit_op_imm()
827 compiler->status_flags_state = SLJIT_CURRENT_FLAGS_ADD; in emit_op_imm()
829 return push_inst(compiler, (ADC ^ inv_bits) | RD(dst) | RN(arg1) | RM(arg2)); in emit_op_imm()
831 compiler->status_flags_state = SLJIT_CURRENT_FLAGS_SUB; in emit_op_imm()
833 return push_inst(compiler, (SUB ^ inv_bits) | RD(dst) | RN(arg1) | RM(arg2)); in emit_op_imm()
835 compiler->status_flags_state = SLJIT_CURRENT_FLAGS_SUB; in emit_op_imm()
837 return push_inst(compiler, (SBC ^ inv_bits) | RD(dst) | RN(arg1) | RM(arg2)); in emit_op_imm()
839 compiler->status_flags_state = 0; in emit_op_imm()
841 return push_inst(compiler, (MADD ^ inv_bits) | RD(dst) | RN(arg1) | RM(arg2) | RT2(TMP_ZERO)); in emit_op_imm()
843 FAIL_IF(push_inst(compiler, SMADDL | RD(dst) | RN(arg1) | RM(arg2) | (31 << 10))); in emit_op_imm()
844 FAIL_IF(push_inst(compiler, ADD | RD(TMP_LR) | RN(TMP_ZERO) | RM(dst) | (2 << 22) | (31 << 10))); in emit_op_imm()
845 return push_inst(compiler, SUBS | RD(TMP_ZERO) | RN(TMP_LR) | RM(dst) | (2 << 22) | (63 << 10)); in emit_op_imm()
847 FAIL_IF(push_inst(compiler, SMULH | RD(TMP_LR) | RN(arg1) | RM(arg2))); in emit_op_imm()
848 FAIL_IF(push_inst(compiler, MADD | RD(dst) | RN(arg1) | RM(arg2) | RT2(TMP_ZERO))); in emit_op_imm()
849 return push_inst(compiler, SUBS | RD(TMP_ZERO) | RN(TMP_LR) | RM(dst) | (2 << 22) | (63 << 10)); in emit_op_imm()
852 return push_inst(compiler, (AND ^ inv_bits) | RD(dst) | RN(arg1) | RM(arg2)); in emit_op_imm()
854 FAIL_IF(push_inst(compiler, (ORR ^ inv_bits) | RD(dst) | RN(arg1) | RM(arg2))); in emit_op_imm()
857 FAIL_IF(push_inst(compiler, (EOR ^ inv_bits) | RD(dst) | RN(arg1) | RM(arg2))); in emit_op_imm()
861 FAIL_IF(push_inst(compiler, (LSLV ^ inv_bits) | RD(dst) | RN(arg1) | RM(arg2))); in emit_op_imm()
865 FAIL_IF(push_inst(compiler, (LSRV ^ inv_bits) | RD(dst) | RN(arg1) | RM(arg2))); in emit_op_imm()
869 FAIL_IF(push_inst(compiler, (ASRV ^ inv_bits) | RD(dst) | RN(arg1) | RM(arg2))); in emit_op_imm()
872 FAIL_IF(push_inst(compiler, (SUB ^ inv_bits) | RD(TMP_REG2) | RN(TMP_ZERO) | RM(arg2))); in emit_op_imm()
876 return push_inst(compiler, (RORV ^ inv_bits) | RD(dst) | RN(arg1) | RM(arg2)); in emit_op_imm()
884 return push_inst(compiler, (SUBS ^ inv_bits) | RD(TMP_ZERO) | RN(dst) | RM(TMP_ZERO)); in emit_op_imm()
898 static sljit_s32 emit_op_mem(struct sljit_compiler *compiler, sljit_s32 flags, sljit_s32 reg, in emit_op_mem() argument
913 return push_inst(compiler, STRB | type | RT(reg) in emit_op_mem()
916 …FAIL_IF(push_inst(compiler, ADD | RD(tmp_reg) | RN(arg & REG_MASK) | RM(OFFS_REG(arg)) | ((sljit_i… in emit_op_mem()
917 return push_inst(compiler, STRBI | type | RT(reg) | RN(tmp_reg)); in emit_op_mem()
923 FAIL_IF(load_immediate(compiler, tmp_reg, argw & ~(0xfff << shift))); in emit_op_mem()
927 return push_inst(compiler, STRBI | type | RT(reg) | RN(tmp_reg) | ((sljit_ins)argw << 10)); in emit_op_mem()
933 … return push_inst(compiler, STRBI | type | RT(reg) | RN(arg) | ((sljit_ins)argw << (10 - shift))); in emit_op_mem()
936 …FAIL_IF(push_inst(compiler, ADDI | (1 << 22) | RD(tmp_reg) | RN(arg) | (((sljit_ins)argw >> 12) <<… in emit_op_mem()
939 return push_inst(compiler, STRBI | type | RT(reg) | RN(tmp_reg) | ((sljit_ins)argw << 10)); in emit_op_mem()
942 …FAIL_IF(push_inst(compiler, SUBI | (1 << 22) | RD(tmp_reg) | RN(arg) | (((sljit_ins)(-argw + 0xfff… in emit_op_mem()
944 return push_inst(compiler, STRBI | type | RT(reg) | RN(tmp_reg) | ((sljit_ins)argw << 10)); in emit_op_mem()
949 return push_inst(compiler, STURBI | type | RT(reg) | RN(arg) | (((sljit_ins)argw & 0x1ff) << 12)); in emit_op_mem()
953 …FAIL_IF(push_inst(compiler, ADDI | (1 << 22) | RD(tmp_reg) | RN(arg) | (((sljit_ins)argw >> 12) <<… in emit_op_mem()
954 …return push_inst(compiler, STURBI | type | RT(reg) | RN(tmp_reg) | (((sljit_ins)argw & 0x1ff) << 1… in emit_op_mem()
957 …FAIL_IF(push_inst(compiler, SUBI | (1 << 22) | RD(tmp_reg) | RN(arg) | (((sljit_ins)-argw >> 12) <… in emit_op_mem()
958 …return push_inst(compiler, STURBI | type | RT(reg) | RN(tmp_reg) | (((sljit_ins)argw & 0x1ff) << 1… in emit_op_mem()
961 FAIL_IF(load_immediate(compiler, tmp_reg, argw)); in emit_op_mem()
963 return push_inst(compiler, STRB | type | RT(reg) | RN(arg) | RM(tmp_reg)); in emit_op_mem()
970 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_enter(struct sljit_compiler *compiler, in sljit_emit_enter() argument
979 …CHECK(check_sljit_emit_enter(compiler, options, arg_types, scratches, saveds, fscratches, fsaveds,… in sljit_emit_enter()
980 set_emit_enter(compiler, options, arg_types, scratches, saveds, fscratches, fsaveds, local_size); in sljit_emit_enter()
986 compiler->local_size = local_size; in sljit_emit_enter()
989 FAIL_IF(push_inst(compiler, STP_PRE | RT(TMP_FP) | RT2(TMP_LR) in sljit_emit_enter()
996 …FAIL_IF(push_inst(compiler, SUBI | RD(SLJIT_SP) | RN(SLJIT_SP) | ((sljit_ins)saved_regs_size << 10… in sljit_emit_enter()
1010 FAIL_IF(push_inst(compiler, STP | RT(prev) | RT2(i) | RN(SLJIT_SP) | offs)); in sljit_emit_enter()
1020 FAIL_IF(push_inst(compiler, STP | RT(prev) | RT2(i) | RN(SLJIT_SP) | offs)); in sljit_emit_enter()
1033 FAIL_IF(push_inst(compiler, STP_F64 | VT(fprev) | VT2(i) | RN(SLJIT_SP) | offs)); in sljit_emit_enter()
1043 FAIL_IF(push_inst(compiler, STP_F64 | VT(fprev) | VT2(i) | RN(SLJIT_SP) | offs)); in sljit_emit_enter()
1049 FAIL_IF(push_inst(compiler, STRI_F64 | VT(fprev) | RN(SLJIT_SP) | (offs >> 5) | (1 << 10))); in sljit_emit_enter()
1052 …FAIL_IF(push_inst(compiler, STRI | RT(prev) | RN(SLJIT_SP) | (offs >> 5) | ((fprev == -1) ? (1 << … in sljit_emit_enter()
1057 FAIL_IF(push_inst(compiler, SUBI | RD(SLJIT_SP) | RN(SLJIT_SP) | (1 << 10) | (1 << 22))); in sljit_emit_enter()
1068 FAIL_IF(push_inst(compiler, ORR | RD(SLJIT_S0 - saved_arg_count) | RN(TMP_ZERO) | RM(tmp))); in sljit_emit_enter()
1084 FAIL_IF(push_inst(compiler, LDRI | RT(TMP_ZERO) | RN(SLJIT_SP))); in sljit_emit_enter()
1085 FAIL_IF(push_inst(compiler, SUBI | RD(SLJIT_SP) | RN(SLJIT_SP) | (1 << 10) | (1 << 22))); in sljit_emit_enter()
1088 FAIL_IF(push_inst(compiler, LDRI | RT(TMP_ZERO) | RN(SLJIT_SP))); in sljit_emit_enter()
1089 FAIL_IF(push_inst(compiler, SUBI | RD(SLJIT_SP) | RN(SLJIT_SP) | (1 << 10) | (1 << 22))); in sljit_emit_enter()
1093 FAIL_IF(push_inst(compiler, MOVZ | RD(TMP_REG1) | ((((sljit_ins)local_size >> 12) - 1) << 5))); in sljit_emit_enter()
1094 FAIL_IF(push_inst(compiler, LDRI | RT(TMP_ZERO) | RN(SLJIT_SP))); in sljit_emit_enter()
1095 FAIL_IF(push_inst(compiler, SUBI | RD(SLJIT_SP) | RN(SLJIT_SP) | (1 << 10) | (1 << 22))); in sljit_emit_enter()
1096 FAIL_IF(push_inst(compiler, SUBI | (1 << 29) | RD(TMP_REG1) | RN(TMP_REG1) | (1 << 10))); in sljit_emit_enter()
1097 FAIL_IF(push_inst(compiler, B_CC | ((((sljit_ins) -3) & 0x7ffff) << 5) | 0x1 /* not-equal */)); in sljit_emit_enter()
1103 FAIL_IF(push_inst(compiler, LDRI | RT(TMP_ZERO) | RN(SLJIT_SP))); in sljit_emit_enter()
1105 FAIL_IF(push_inst(compiler, STP | RT(TMP_FP) | RT2(TMP_LR) | RN(SLJIT_SP))); in sljit_emit_enter()
1110 FAIL_IF(push_inst(compiler, STP_PRE | RT(TMP_FP) | RT2(TMP_LR) in sljit_emit_enter()
1116 FAIL_IF(push_inst(compiler, SUBI | RD(SLJIT_SP) | RN(SLJIT_SP) | ((sljit_ins)local_size << 10))); in sljit_emit_enter()
1117 FAIL_IF(push_inst(compiler, STP | RT(TMP_FP) | RT2(TMP_LR) | RN(SLJIT_SP))); in sljit_emit_enter()
1126 …FAIL_IF(push_inst(compiler, SUBI | RD(SLJIT_SP) | RN(SLJIT_SP) | (((sljit_ins)local_size >> 12) <<… in sljit_emit_enter()
1132 … FAIL_IF(push_inst(compiler, SUBI | RD(SLJIT_SP) | RN(SLJIT_SP) | ((sljit_ins)local_size << 10))); in sljit_emit_enter()
1134 FAIL_IF(push_inst(compiler, STP | RT(TMP_FP) | RT2(TMP_LR) | RN(SLJIT_SP))); in sljit_emit_enter()
1136 FAIL_IF(push_inst(compiler, STP_PRE | RT(TMP_FP) | RT2(TMP_LR) in sljit_emit_enter()
1142 return push_inst(compiler, ADDI | RD(TMP_FP) | RN(SLJIT_SP) | (0 << 10)); in sljit_emit_enter()
1145 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_set_context(struct sljit_compiler *compiler, in sljit_set_context() argument
1152 …CHECK(check_sljit_set_context(compiler, options, arg_types, scratches, saveds, fscratches, fsaveds… in sljit_set_context()
1153 set_set_context(compiler, options, arg_types, scratches, saveds, fscratches, fsaveds, local_size); in sljit_set_context()
1158 compiler->local_size = (local_size + saved_regs_size + 0xf) & ~0xf; in sljit_set_context()
1162 static sljit_s32 emit_stack_frame_release(struct sljit_compiler *compiler, sljit_s32 is_return_to) in emit_stack_frame_release() argument
1167 local_size = compiler->local_size; in emit_stack_frame_release()
1171 FAIL_IF(push_inst(compiler, LDP_POST | RT(TMP_FP) | RT2(TMP_LR) in emit_stack_frame_release()
1175 FAIL_IF(push_inst(compiler, LDP | RT(TMP_FP) | RT2(TMP_LR) | RN(SLJIT_SP))); in emit_stack_frame_release()
1178 …FAIL_IF(push_inst(compiler, LDRI_POST | RT(TMP_FP) | RN(SLJIT_SP) | ((sljit_ins)(local_size - 512)… in emit_stack_frame_release()
1181 FAIL_IF(push_inst(compiler, LDRI | RT(TMP_FP) | RN(SLJIT_SP) | 0)); in emit_stack_frame_release()
1187 FAIL_IF(push_inst(compiler, ADDI | RD(SLJIT_SP) | RN(SLJIT_SP) in emit_stack_frame_release()
1192 FAIL_IF(push_inst(compiler, ADDI | RD(SLJIT_SP) | RN(SLJIT_SP) | ((sljit_ins)local_size << 10))); in emit_stack_frame_release()
1199 tmp = SLJIT_S0 - compiler->saveds; in emit_stack_frame_release()
1200 for (i = SLJIT_S0 - SLJIT_KEPT_SAVEDS_COUNT(compiler->options); i > tmp; i--) { in emit_stack_frame_release()
1205 FAIL_IF(push_inst(compiler, LDP | RT(prev) | RT2(i) | RN(SLJIT_SP) | offs)); in emit_stack_frame_release()
1210 for (i = compiler->scratches; i >= SLJIT_FIRST_SAVED_REG; i--) { in emit_stack_frame_release()
1215 FAIL_IF(push_inst(compiler, LDP | RT(prev) | RT2(i) | RN(SLJIT_SP) | offs)); in emit_stack_frame_release()
1222 tmp = SLJIT_FS0 - compiler->fsaveds; in emit_stack_frame_release()
1228 FAIL_IF(push_inst(compiler, LDP_F64 | VT(fprev) | VT2(i) | RN(SLJIT_SP) | offs)); in emit_stack_frame_release()
1233 for (i = compiler->fscratches; i >= SLJIT_FIRST_SAVED_FLOAT_REG; i--) { in emit_stack_frame_release()
1238 FAIL_IF(push_inst(compiler, LDP_F64 | VT(fprev) | VT2(i) | RN(SLJIT_SP) | offs)); in emit_stack_frame_release()
1244 FAIL_IF(push_inst(compiler, LDRI_F64 | VT(fprev) | RN(SLJIT_SP) | (offs >> 5) | (1 << 10))); in emit_stack_frame_release()
1247 …FAIL_IF(push_inst(compiler, LDRI | RT(prev) | RN(SLJIT_SP) | (offs >> 5) | ((fprev == -1) ? (1 << … in emit_stack_frame_release()
1250 return push_inst(compiler, ADDI | RD(SLJIT_SP) | RN(SLJIT_SP) | (sljit_ins)(local_size << 10)); in emit_stack_frame_release()
1253 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_return_void(struct sljit_compiler *compiler) in sljit_emit_return_void() argument
1256 CHECK(check_sljit_emit_return_void(compiler)); in sljit_emit_return_void()
1258 FAIL_IF(emit_stack_frame_release(compiler, 0)); in sljit_emit_return_void()
1260 return push_inst(compiler, RET | RN(TMP_LR)); in sljit_emit_return_void()
1263 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_return_to(struct sljit_compiler *compiler, in sljit_emit_return_to() argument
1267 CHECK(check_sljit_emit_return_to(compiler, src, srcw)); in sljit_emit_return_to()
1271 FAIL_IF(emit_op_mem(compiler, WORD_SIZE, TMP_REG1, src, srcw, TMP_REG1)); in sljit_emit_return_to()
1274 …} else if (src >= SLJIT_FIRST_SAVED_REG && src <= (SLJIT_S0 - SLJIT_KEPT_SAVEDS_COUNT(compiler->op… in sljit_emit_return_to()
1275 FAIL_IF(push_inst(compiler, ORR | RD(TMP_REG1) | RN(TMP_ZERO) | RM(src))); in sljit_emit_return_to()
1280 FAIL_IF(emit_stack_frame_release(compiler, 1)); in sljit_emit_return_to()
1282 SLJIT_SKIP_CHECKS(compiler); in sljit_emit_return_to()
1283 return sljit_emit_ijump(compiler, SLJIT_JUMP, src, srcw); in sljit_emit_return_to()
1290 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op0(struct sljit_compiler *compiler, sljit_s32 op) in sljit_emit_op0() argument
1295 CHECK(check_sljit_emit_op0(compiler, op)); in sljit_emit_op0()
1300 return push_inst(compiler, BRK); in sljit_emit_op0()
1302 return push_inst(compiler, NOP); in sljit_emit_op0()
1305 FAIL_IF(push_inst(compiler, ORR | RD(TMP_REG1) | RN(TMP_ZERO) | RM(SLJIT_R0))); in sljit_emit_op0()
1306 FAIL_IF(push_inst(compiler, MADD | RD(SLJIT_R0) | RN(SLJIT_R0) | RM(SLJIT_R1) | RT2(TMP_ZERO))); in sljit_emit_op0()
1307 …return push_inst(compiler, (op == SLJIT_LMUL_UW ? UMULH : SMULH) | RD(SLJIT_R1) | RN(TMP_REG1) | R… in sljit_emit_op0()
1310 FAIL_IF(push_inst(compiler, (ORR ^ inv_bits) | RD(TMP_REG1) | RN(TMP_ZERO) | RM(SLJIT_R0))); in sljit_emit_op0()
1311 …FAIL_IF(push_inst(compiler, ((op == SLJIT_DIVMOD_UW ? UDIV : SDIV) ^ inv_bits) | RD(SLJIT_R0) | RN… in sljit_emit_op0()
1312 …FAIL_IF(push_inst(compiler, (MADD ^ inv_bits) | RD(SLJIT_R1) | RN(SLJIT_R0) | RM(SLJIT_R1) | RT2(T… in sljit_emit_op0()
1313 return push_inst(compiler, (SUB ^ inv_bits) | RD(SLJIT_R1) | RN(TMP_REG1) | RM(SLJIT_R1)); in sljit_emit_op0()
1316 …return push_inst(compiler, ((op == SLJIT_DIV_UW ? UDIV : SDIV) ^ inv_bits) | RD(SLJIT_R0) | RN(SLJ… in sljit_emit_op0()
1325 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op1(struct sljit_compiler *compiler, sljit_s32 op, in sljit_emit_op1() argument
1333 CHECK(check_sljit_emit_op1(compiler, op, dst, dstw, src, srcw)); in sljit_emit_op1()
1343 return emit_op_imm(compiler, op | ((op_flags & SLJIT_32) ? INT_OP : 0), dst_r, TMP_REG1, src); in sljit_emit_op1()
1388 FAIL_IF(emit_op_imm(compiler, SLJIT_MOV | ARG2_IMM, dst_r, TMP_REG1, srcw)); in sljit_emit_op1()
1392 FAIL_IF(emit_op_mem(compiler, mem_flags, dst_r, src, srcw, TMP_REG1)); in sljit_emit_op1()
1395 return emit_op_mem(compiler, mem_flags | STORE, dst_r, dst, dstw, TMP_REG2); in sljit_emit_op1()
1408 FAIL_IF(emit_op_mem(compiler, mem_flags, TMP_REG2, src, srcw, TMP_REG2)); in sljit_emit_op1()
1412 emit_op_imm(compiler, flags | op, dst_r, TMP_REG1, src); in sljit_emit_op1()
1415 return emit_op_mem(compiler, mem_flags | STORE, dst_r, dst, dstw, TMP_REG2); in sljit_emit_op1()
1419 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op2(struct sljit_compiler *compiler, sljit_s32 op, in sljit_emit_op2() argument
1427 CHECK(check_sljit_emit_op2(compiler, op, 0, dst, dstw, src1, src1w, src2, src2w)); in sljit_emit_op2()
1445 FAIL_IF(emit_op_mem(compiler, mem_flags, TMP_REG1, src1, src1w, TMP_REG1)); in sljit_emit_op2()
1450 FAIL_IF(emit_op_mem(compiler, mem_flags, TMP_REG2, src2, src2w, TMP_REG2)); in sljit_emit_op2()
1464 emit_op_imm(compiler, flags | GET_OPCODE(op), dst_r, src1w, src2w); in sljit_emit_op2()
1467 return emit_op_mem(compiler, mem_flags | STORE, dst_r, dst, dstw, TMP_REG2); in sljit_emit_op2()
1471 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op2u(struct sljit_compiler *compiler, sljit_s32 op, in sljit_emit_op2u() argument
1476 CHECK(check_sljit_emit_op2(compiler, op, 1, 0, 0, src1, src1w, src2, src2w)); in sljit_emit_op2u()
1478 SLJIT_SKIP_CHECKS(compiler); in sljit_emit_op2u()
1479 return sljit_emit_op2(compiler, op, TMP_REG1, 0, src1, src1w, src2, src2w); in sljit_emit_op2u()
1482 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_shift_into(struct sljit_compiler *compiler, sljit_s32… in sljit_emit_shift_into() argument
1492 CHECK(check_sljit_emit_shift_into(compiler, op, src_dst, src1, src1w, src2, src2w)); in sljit_emit_shift_into()
1497 SLJIT_SKIP_CHECKS(compiler); in sljit_emit_shift_into()
1498 …return sljit_emit_op2(compiler, (is_left ? SLJIT_ROTL : SLJIT_ROTR) | (op & SLJIT_32), src_dst, 0,… in sljit_emit_shift_into()
1513 FAIL_IF(emit_op_mem(compiler, inv_bits ? INT_SIZE : WORD_SIZE, TMP_REG2, src2, src2w, TMP_REG2)); in sljit_emit_shift_into()
1518 FAIL_IF(emit_op_mem(compiler, inv_bits ? INT_SIZE : WORD_SIZE, TMP_REG1, src1, src1w, TMP_REG1)); in sljit_emit_shift_into()
1521 FAIL_IF(load_immediate(compiler, TMP_REG1, src1w)); in sljit_emit_shift_into()
1529 return push_inst(compiler, (EXTR ^ (inv_bits | (inv_bits >> 9))) | RD(src_dst) in sljit_emit_shift_into()
1533 …FAIL_IF(push_inst(compiler, ((is_left ? LSLV : LSRV) ^ inv_bits) | RD(src_dst) | RN(src_dst) | RM(… in sljit_emit_shift_into()
1542 FAIL_IF(push_inst(compiler, (UBFM ^ inv_bits) | RD(TMP_REG1) | RN(src1) | imm)); in sljit_emit_shift_into()
1546 FAIL_IF(push_inst(compiler, (EORI ^ inv_bits) | RD(TMP_REG2) | RN(src2) | imm)); in sljit_emit_shift_into()
1550 FAIL_IF(push_inst(compiler, (SUB ^ inv_bits) | RD(TMP_REG2) | RN(TMP_ZERO) | RM(src2))); in sljit_emit_shift_into()
1552 …FAIL_IF(push_inst(compiler, ((is_left ? LSRV : LSLV) ^ inv_bits) | RD(TMP_REG1) | RN(src1) | RM(TM… in sljit_emit_shift_into()
1553 return push_inst(compiler, (ORR ^ inv_bits) | RD(src_dst) | RN(src_dst) | RM(TMP_REG1)); in sljit_emit_shift_into()
1556 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op_src(struct sljit_compiler *compiler, sljit_s32 op, in sljit_emit_op_src() argument
1560 CHECK(check_sljit_emit_op_src(compiler, op, src, srcw)); in sljit_emit_op_src()
1566 FAIL_IF(push_inst(compiler, ORR | RD(TMP_LR) | RN(TMP_ZERO) | RM(src))); in sljit_emit_op_src()
1568 FAIL_IF(emit_op_mem(compiler, WORD_SIZE, TMP_LR, src, srcw, TMP_REG1)); in sljit_emit_op_src()
1570 return push_inst(compiler, RET | RN(TMP_LR)); in sljit_emit_op_src()
1590 return emit_op_mem(compiler, WORD_SIZE | SIGNED, op, src, srcw, TMP_REG1); in sljit_emit_op_src()
1608 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op_custom(struct sljit_compiler *compiler, in sljit_emit_op_custom() argument
1613 CHECK(check_sljit_emit_op_custom(compiler, instruction, size)); in sljit_emit_op_custom()
1615 return push_inst(compiler, *(sljit_ins*)instruction); in sljit_emit_op_custom()
1622 static sljit_s32 emit_fop_mem(struct sljit_compiler *compiler, sljit_s32 flags, sljit_s32 reg, slji… in emit_fop_mem() argument
1635 return push_inst(compiler, STR_FR | type | VT(reg) in emit_fop_mem()
1638 …FAIL_IF(push_inst(compiler, ADD | RD(TMP_REG1) | RN(arg & REG_MASK) | RM(OFFS_REG(arg)) | ((sljit_… in emit_fop_mem()
1639 return push_inst(compiler, STR_FI | type | VT(reg) | RN(TMP_REG1)); in emit_fop_mem()
1645 FAIL_IF(load_immediate(compiler, TMP_REG1, argw & ~(0xfff << shift))); in emit_fop_mem()
1649 return push_inst(compiler, STR_FI | type | VT(reg) | RN(TMP_REG1) | ((sljit_ins)argw << 10)); in emit_fop_mem()
1654 … return push_inst(compiler, STR_FI | type | VT(reg) | RN(arg) | ((sljit_ins)argw << (10 - shift))); in emit_fop_mem()
1657 …FAIL_IF(push_inst(compiler, ADDI | (1 << 22) | RD(TMP_REG1) | RN(arg) | (((sljit_ins)argw >> 12) <… in emit_fop_mem()
1660 return push_inst(compiler, STR_FI | type | VT(reg) | RN(TMP_REG1) | ((sljit_ins)argw << 10)); in emit_fop_mem()
1665 …return push_inst(compiler, STUR_FI | type | VT(reg) | RN(arg) | (((sljit_ins)argw & 0x1ff) << 12)); in emit_fop_mem()
1667 FAIL_IF(load_immediate(compiler, TMP_REG1, argw)); in emit_fop_mem()
1668 return push_inst(compiler, STR_FR | type | VT(reg) | RN(arg) | RM(TMP_REG1)); in emit_fop_mem()
1671 static SLJIT_INLINE sljit_s32 sljit_emit_fop1_conv_sw_from_f64(struct sljit_compiler *compiler, slj… in sljit_emit_fop1_conv_sw_from_f64() argument
1682 emit_fop_mem(compiler, (op & SLJIT_32) ? INT_SIZE : WORD_SIZE, TMP_FREG1, src, srcw); in sljit_emit_fop1_conv_sw_from_f64()
1686 FAIL_IF(push_inst(compiler, (FCVTZS ^ inv_bits) | RD(dst_r) | VN(src))); in sljit_emit_fop1_conv_sw_from_f64()
1689 …return emit_op_mem(compiler, ((GET_OPCODE(op) == SLJIT_CONV_S32_FROM_F64) ? INT_SIZE : WORD_SIZE) … in sljit_emit_fop1_conv_sw_from_f64()
1693 static SLJIT_INLINE sljit_s32 sljit_emit_fop1_conv_f64_from_sw(struct sljit_compiler *compiler, slj… in sljit_emit_fop1_conv_f64_from_sw() argument
1704 …emit_op_mem(compiler, ((GET_OPCODE(op) == SLJIT_CONV_F64_FROM_S32) ? INT_SIZE : WORD_SIZE), TMP_RE… in sljit_emit_fop1_conv_f64_from_sw()
1710 FAIL_IF(load_immediate(compiler, TMP_REG1, srcw)); in sljit_emit_fop1_conv_f64_from_sw()
1714 FAIL_IF(push_inst(compiler, (SCVTF ^ inv_bits) | VD(dst_r) | RN(src))); in sljit_emit_fop1_conv_f64_from_sw()
1717 …return emit_fop_mem(compiler, ((op & SLJIT_32) ? INT_SIZE : WORD_SIZE) | STORE, TMP_FREG1, dst, ds… in sljit_emit_fop1_conv_f64_from_sw()
1721 static SLJIT_INLINE sljit_s32 sljit_emit_fop1_cmp(struct sljit_compiler *compiler, sljit_s32 op, in sljit_emit_fop1_cmp() argument
1729 emit_fop_mem(compiler, mem_flags, TMP_FREG1, src1, src1w); in sljit_emit_fop1_cmp()
1734 emit_fop_mem(compiler, mem_flags, TMP_FREG2, src2, src2w); in sljit_emit_fop1_cmp()
1738 return push_inst(compiler, (FCMP ^ inv_bits) | VN(src1) | VM(src2)); in sljit_emit_fop1_cmp()
1741 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fop1(struct sljit_compiler *compiler, sljit_s32 op, in sljit_emit_fop1() argument
1751 SELECT_FOP1_OPERATION_WITH_CHECKS(compiler, op, dst, dstw, src, srcw); in sljit_emit_fop1()
1757 …emit_fop_mem(compiler, (GET_OPCODE(op) == SLJIT_CONV_F64_FROM_F32) ? (mem_flags ^ 0x1) : mem_flags… in sljit_emit_fop1()
1765 FAIL_IF(push_inst(compiler, (FMOV ^ inv_bits) | VD(dst_r) | VN(src))); in sljit_emit_fop1()
1771 FAIL_IF(push_inst(compiler, (FNEG ^ inv_bits) | VD(dst_r) | VN(src))); in sljit_emit_fop1()
1774 FAIL_IF(push_inst(compiler, (FABS ^ inv_bits) | VD(dst_r) | VN(src))); in sljit_emit_fop1()
1777 …FAIL_IF(push_inst(compiler, FCVT | (sljit_ins)((op & SLJIT_32) ? (1 << 22) : (1 << 15)) | VD(dst_r… in sljit_emit_fop1()
1782 return emit_fop_mem(compiler, mem_flags | STORE, dst_r, dst, dstw); in sljit_emit_fop1()
1786 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fop2(struct sljit_compiler *compiler, sljit_s32 op, in sljit_emit_fop2() argument
1795 CHECK(check_sljit_emit_fop2(compiler, op, dst, dstw, src1, src1w, src2, src2w)); in sljit_emit_fop2()
1802 emit_fop_mem(compiler, mem_flags, TMP_FREG1, src1, src1w); in sljit_emit_fop2()
1806 emit_fop_mem(compiler, mem_flags, TMP_FREG2, src2, src2w); in sljit_emit_fop2()
1812 FAIL_IF(push_inst(compiler, (FADD ^ inv_bits) | VD(dst_r) | VN(src1) | VM(src2))); in sljit_emit_fop2()
1815 FAIL_IF(push_inst(compiler, (FSUB ^ inv_bits) | VD(dst_r) | VN(src1) | VM(src2))); in sljit_emit_fop2()
1818 FAIL_IF(push_inst(compiler, (FMUL ^ inv_bits) | VD(dst_r) | VN(src1) | VM(src2))); in sljit_emit_fop2()
1821 FAIL_IF(push_inst(compiler, (FDIV ^ inv_bits) | VD(dst_r) | VN(src1) | VM(src2))); in sljit_emit_fop2()
1827 return emit_fop_mem(compiler, mem_flags | STORE, TMP_FREG1, dst, dstw); in sljit_emit_fop2()
1834 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fast_enter(struct sljit_compiler *compiler, sljit_s32… in sljit_emit_fast_enter() argument
1837 CHECK(check_sljit_emit_fast_enter(compiler, dst, dstw)); in sljit_emit_fast_enter()
1841 return push_inst(compiler, ORR | RD(dst) | RN(TMP_ZERO) | RM(TMP_LR)); in sljit_emit_fast_enter()
1844 return emit_op_mem(compiler, WORD_SIZE | STORE, TMP_LR, dst, dstw, TMP_REG1); in sljit_emit_fast_enter()
1851 static sljit_ins get_cc(struct sljit_compiler *compiler, sljit_s32 type) in get_cc() argument
1867 if (compiler->status_flags_state & SLJIT_CURRENT_FLAGS_ADD) in get_cc()
1875 if (compiler->status_flags_state & SLJIT_CURRENT_FLAGS_ADD) in get_cc()
1910 if (!(compiler->status_flags_state & (SLJIT_CURRENT_FLAGS_ADD | SLJIT_CURRENT_FLAGS_SUB))) in get_cc()
1918 if (!(compiler->status_flags_state & (SLJIT_CURRENT_FLAGS_ADD | SLJIT_CURRENT_FLAGS_SUB))) in get_cc()
1938 SLJIT_API_FUNC_ATTRIBUTE struct sljit_label* sljit_emit_label(struct sljit_compiler *compiler) in sljit_emit_label() argument
1943 CHECK_PTR(check_sljit_emit_label(compiler)); in sljit_emit_label()
1945 if (compiler->last_label && compiler->last_label->size == compiler->size) in sljit_emit_label()
1946 return compiler->last_label; in sljit_emit_label()
1948 label = (struct sljit_label*)ensure_abuf(compiler, sizeof(struct sljit_label)); in sljit_emit_label()
1950 set_label(label, compiler); in sljit_emit_label()
1954 SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit_jump(struct sljit_compiler *compiler, sljit_… in sljit_emit_jump() argument
1959 CHECK_PTR(check_sljit_emit_jump(compiler, type)); in sljit_emit_jump()
1961 jump = (struct sljit_jump*)ensure_abuf(compiler, sizeof(struct sljit_jump)); in sljit_emit_jump()
1963 set_jump(jump, compiler, type & SLJIT_REWRITABLE_JUMP); in sljit_emit_jump()
1968 PTR_FAIL_IF(push_inst(compiler, B_CC | (6 << 5) | get_cc(compiler, type))); in sljit_emit_jump()
1973 PTR_FAIL_IF(emit_imm64_const(compiler, TMP_REG1, 0)); in sljit_emit_jump()
1974 jump->addr = compiler->size; in sljit_emit_jump()
1975 PTR_FAIL_IF(push_inst(compiler, ((type >= SLJIT_FAST_CALL) ? BLR : BR) | RN(TMP_REG1))); in sljit_emit_jump()
1980 SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit_call(struct sljit_compiler *compiler, sljit_… in sljit_emit_call() argument
1985 CHECK_PTR(check_sljit_emit_call(compiler, type, arg_types)); in sljit_emit_call()
1988 PTR_FAIL_IF(emit_stack_frame_release(compiler, 0)); in sljit_emit_call()
1992 SLJIT_SKIP_CHECKS(compiler); in sljit_emit_call()
1993 return sljit_emit_jump(compiler, type); in sljit_emit_call()
1996 static SLJIT_INLINE struct sljit_jump* emit_cmp_to0(struct sljit_compiler *compiler, sljit_s32 type, in emit_cmp_to0() argument
2005 jump = (struct sljit_jump*)ensure_abuf(compiler, sizeof(struct sljit_jump)); in emit_cmp_to0()
2007 set_jump(jump, compiler, type & SLJIT_REWRITABLE_JUMP); in emit_cmp_to0()
2011 …PTR_FAIL_IF(emit_op_mem(compiler, inv_bits ? INT_SIZE : WORD_SIZE, TMP_REG1, src, srcw, TMP_REG1)); in emit_cmp_to0()
2015 PTR_FAIL_IF(load_immediate(compiler, TMP_REG1, srcw)); in emit_cmp_to0()
2024 PTR_FAIL_IF(push_inst(compiler, (CBZ ^ inv_bits) | (6 << 5) | RT(src))); in emit_cmp_to0()
2025 PTR_FAIL_IF(emit_imm64_const(compiler, TMP_REG1, 0)); in emit_cmp_to0()
2026 jump->addr = compiler->size; in emit_cmp_to0()
2027 PTR_FAIL_IF(push_inst(compiler, BR | RN(TMP_REG1))); in emit_cmp_to0()
2031 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_ijump(struct sljit_compiler *compiler, sljit_s32 type… in sljit_emit_ijump() argument
2036 CHECK(check_sljit_emit_ijump(compiler, type, src, srcw)); in sljit_emit_ijump()
2041 FAIL_IF(emit_op_mem(compiler, WORD_SIZE, TMP_REG1, src, srcw, TMP_REG1)); in sljit_emit_ijump()
2044 return push_inst(compiler, ((type >= SLJIT_FAST_CALL) ? BLR : BR) | RN(src)); in sljit_emit_ijump()
2048 jump = (struct sljit_jump*)ensure_abuf(compiler, sizeof(struct sljit_jump)); in sljit_emit_ijump()
2050 set_jump(jump, compiler, JUMP_ADDR | ((type >= SLJIT_FAST_CALL) ? IS_BL : 0)); in sljit_emit_ijump()
2053 FAIL_IF(emit_imm64_const(compiler, TMP_REG1, 0)); in sljit_emit_ijump()
2054 jump->addr = compiler->size; in sljit_emit_ijump()
2055 return push_inst(compiler, ((type >= SLJIT_FAST_CALL) ? BLR : BR) | RN(TMP_REG1)); in sljit_emit_ijump()
2058 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_icall(struct sljit_compiler *compiler, sljit_s32 type, in sljit_emit_icall() argument
2064 CHECK(check_sljit_emit_icall(compiler, type, arg_types, src, srcw)); in sljit_emit_icall()
2068 FAIL_IF(emit_op_mem(compiler, WORD_SIZE, TMP_REG1, src, srcw, TMP_REG1)); in sljit_emit_icall()
2073 …if (src >= SLJIT_FIRST_SAVED_REG && src <= (SLJIT_S0 - SLJIT_KEPT_SAVEDS_COUNT(compiler->options))… in sljit_emit_icall()
2074 FAIL_IF(push_inst(compiler, ORR | RD(TMP_REG1) | RN(TMP_ZERO) | RM(src))); in sljit_emit_icall()
2078 FAIL_IF(emit_stack_frame_release(compiler, 0)); in sljit_emit_icall()
2082 SLJIT_SKIP_CHECKS(compiler); in sljit_emit_icall()
2083 return sljit_emit_ijump(compiler, type, src, srcw); in sljit_emit_icall()
2086 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op_flags(struct sljit_compiler *compiler, sljit_s32 o… in sljit_emit_op_flags() argument
2094 CHECK(check_sljit_emit_op_flags(compiler, op, dst, dstw, type)); in sljit_emit_op_flags()
2097 cc = get_cc(compiler, type); in sljit_emit_op_flags()
2101 FAIL_IF(push_inst(compiler, CSINC | (cc << 12) | RD(dst_r) | RN(TMP_ZERO) | RM(TMP_ZERO))); in sljit_emit_op_flags()
2105 return emit_op_mem(compiler, mem_flags, TMP_REG1, dst, dstw, TMP_REG2); in sljit_emit_op_flags()
2122 FAIL_IF(emit_op_mem(compiler, mem_flags, TMP_REG1, dst, dstw, TMP_REG1)); in sljit_emit_op_flags()
2126 FAIL_IF(push_inst(compiler, CSINC | (cc << 12) | RD(TMP_REG2) | RN(TMP_ZERO) | RM(TMP_ZERO))); in sljit_emit_op_flags()
2127 emit_op_imm(compiler, flags | GET_OPCODE(op), dst_r, src_r, TMP_REG2); in sljit_emit_op_flags()
2130 return emit_op_mem(compiler, mem_flags | STORE, TMP_REG1, dst, dstw, TMP_REG2); in sljit_emit_op_flags()
2134 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_cmov(struct sljit_compiler *compiler, sljit_s32 type, in sljit_emit_cmov() argument
2142 CHECK(check_sljit_emit_cmov(compiler, type, dst_reg, src, srcw)); in sljit_emit_cmov()
2147 FAIL_IF(load_immediate(compiler, TMP_REG1, srcw)); in sljit_emit_cmov()
2152 cc = get_cc(compiler, type & ~SLJIT_32); in sljit_emit_cmov()
2154 return push_inst(compiler, (CSEL ^ inv_bits) | (cc << 12) | RD(dst_reg) | RN(dst_reg) | RM(src)); in sljit_emit_cmov()
2157 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_mem(struct sljit_compiler *compiler, sljit_s32 type, in sljit_emit_mem() argument
2164 CHECK(check_sljit_emit_mem(compiler, type, reg, mem, memw)); in sljit_emit_mem()
2167 return sljit_emit_mem_unaligned(compiler, type, reg, mem, memw); in sljit_emit_mem()
2172 FAIL_IF(load_immediate(compiler, TMP_REG1, memw & ~0x1f8)); in sljit_emit_mem()
2177 …FAIL_IF(push_inst(compiler, ADD | RD(TMP_REG1) | RN(mem & REG_MASK) | RM(OFFS_REG(mem)) | ((sljit_… in sljit_emit_mem()
2190 …FAIL_IF(push_inst(compiler, LDRI | RD(REG_PAIR_SECOND(reg)) | RN(mem & REG_MASK) | ((sljit_ins)mem… in sljit_emit_mem()
2191 …return push_inst(compiler, LDRI | RD(REG_PAIR_FIRST(reg)) | RN(mem & REG_MASK) | ((sljit_ins)(memw… in sljit_emit_mem()
2196 …FAIL_IF(push_inst(compiler, inst | RD(REG_PAIR_FIRST(reg)) | RN(mem & REG_MASK) | ((sljit_ins)memw… in sljit_emit_mem()
2197 …return push_inst(compiler, inst | RD(REG_PAIR_SECOND(reg)) | RN(mem & REG_MASK) | ((sljit_ins)(mem… in sljit_emit_mem()
2201 FAIL_IF(push_inst(compiler, inst | RD(TMP_REG1) | RN(mem & REG_MASK) | ((sljit_ins)memw << 10))); in sljit_emit_mem()
2204 …FAIL_IF(push_inst(compiler, inst | (1 << 22) | RD(TMP_REG1) | RN(mem & REG_MASK) | (((sljit_ins)me… in sljit_emit_mem()
2207 …FAIL_IF(push_inst(compiler, inst | RD(TMP_REG1) | RN(TMP_REG1) | (((sljit_ins)memw & 0xfff) << 10)… in sljit_emit_mem()
2213 FAIL_IF(load_immediate(compiler, TMP_REG1, memw)); in sljit_emit_mem()
2214 …FAIL_IF(push_inst(compiler, (inst == ADDI ? ADD : SUB) | RD(TMP_REG1) | RN(mem & REG_MASK) | RM(TM… in sljit_emit_mem()
2225 …return push_inst(compiler, ((type & SLJIT_MEM_STORE) ? STP : LDP) | RT(REG_PAIR_FIRST(reg)) | RT2(… in sljit_emit_mem()
2228 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_mem_update(struct sljit_compiler *compiler, sljit_s32… in sljit_emit_mem_update() argument
2235 CHECK(check_sljit_emit_mem_update(compiler, type, reg, mem, memw)); in sljit_emit_mem_update()
2279 …return push_inst(compiler, inst | RT(reg) | RN(mem & REG_MASK) | (sljit_ins)((memw & 0x1ff) << 12)… in sljit_emit_mem_update()
2282 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fmem_update(struct sljit_compiler *compiler, sljit_s3… in sljit_emit_fmem_update() argument
2289 CHECK(check_sljit_emit_fmem_update(compiler, type, freg, mem, memw)); in sljit_emit_fmem_update()
2308 …return push_inst(compiler, inst | VT(freg) | RN(mem & REG_MASK) | (sljit_ins)((memw & 0x1ff) << 12… in sljit_emit_fmem_update()
2311 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_get_local_base(struct sljit_compiler *compiler, sljit_s32 … in sljit_get_local_base() argument
2317 CHECK(check_sljit_get_local_base(compiler, dst, dstw, offset)); in sljit_get_local_base()
2331 FAIL_IF(push_inst(compiler, ins | RD(dst_reg) | RN(SLJIT_SP) | (sljit_ins)(offset << 10))); in sljit_get_local_base()
2333 …FAIL_IF(push_inst(compiler, ins | RD(dst_reg) | RN(SLJIT_SP) | (sljit_ins)((offset & 0xfff000) >> … in sljit_get_local_base()
2337 FAIL_IF(push_inst(compiler, ins | RD(dst_reg) | RN(dst_reg) | (sljit_ins)(offset << 10))); in sljit_get_local_base()
2341 FAIL_IF(load_immediate (compiler, dst_reg, offset)); in sljit_get_local_base()
2343 FAIL_IF(push_inst(compiler, ADDE | (0x3 << 13) | RD(dst_reg) | RN(SLJIT_SP) | RM(dst_reg))); in sljit_get_local_base()
2347 return emit_op_mem(compiler, WORD_SIZE | STORE, dst_reg, dst, dstw, TMP_REG1); in sljit_get_local_base()
2351 SLJIT_API_FUNC_ATTRIBUTE struct sljit_const* sljit_emit_const(struct sljit_compiler *compiler, slji… in sljit_emit_const() argument
2357 CHECK_PTR(check_sljit_emit_const(compiler, dst, dstw, init_value)); in sljit_emit_const()
2360 const_ = (struct sljit_const*)ensure_abuf(compiler, sizeof(struct sljit_const)); in sljit_emit_const()
2362 set_const(const_, compiler); in sljit_emit_const()
2365 PTR_FAIL_IF(emit_imm64_const(compiler, dst_r, (sljit_uw)init_value)); in sljit_emit_const()
2368 PTR_FAIL_IF(emit_op_mem(compiler, WORD_SIZE | STORE, dst_r, dst, dstw, TMP_REG2)); in sljit_emit_const()
2372 …UTE struct sljit_put_label* sljit_emit_put_label(struct sljit_compiler *compiler, sljit_s32 dst, s… in sljit_emit_put_label() argument
2378 CHECK_PTR(check_sljit_emit_put_label(compiler, dst, dstw)); in sljit_emit_put_label()
2382 PTR_FAIL_IF(emit_imm64_const(compiler, dst_r, 0)); in sljit_emit_put_label()
2384 put_label = (struct sljit_put_label*)ensure_abuf(compiler, sizeof(struct sljit_put_label)); in sljit_emit_put_label()
2386 set_put_label(put_label, compiler, 1); in sljit_emit_put_label()
2389 PTR_FAIL_IF(emit_op_mem(compiler, WORD_SIZE | STORE, dst_r, dst, dstw, TMP_REG2)); in sljit_emit_put_label()