Lines Matching refs:compiler

210 static sljit_s32 push_inst16(struct sljit_compiler *compiler, sljit_ins inst)  in push_inst16()  argument
215 ptr = (sljit_u16*)ensure_buf(compiler, sizeof(sljit_u16)); in push_inst16()
218 compiler->size++; in push_inst16()
222 static sljit_s32 push_inst32(struct sljit_compiler *compiler, sljit_ins inst) in push_inst32() argument
224 sljit_u16 *ptr = (sljit_u16*)ensure_buf(compiler, sizeof(sljit_ins)); in push_inst32()
228 compiler->size += 2; in push_inst32()
232 static SLJIT_INLINE sljit_s32 emit_imm32_const(struct sljit_compiler *compiler, sljit_s32 dst, slji… in emit_imm32_const() argument
234 FAIL_IF(push_inst32(compiler, MOVW | RD4(dst) in emit_imm32_const()
236 return push_inst32(compiler, MOVT | RD4(dst) in emit_imm32_const()
370 SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compiler) in sljit_generate_code() argument
387 CHECK_PTR(check_sljit_generate_code(compiler)); in sljit_generate_code()
388 reverse_buf(compiler); in sljit_generate_code()
390 …code = (sljit_u16*)SLJIT_MALLOC_EXEC(compiler->size * sizeof(sljit_u16), compiler->exec_allocator_… in sljit_generate_code()
392 buf = compiler->buf; in sljit_generate_code()
399 label = compiler->labels; in sljit_generate_code()
400 jump = compiler->jumps; in sljit_generate_code()
401 const_ = compiler->consts; in sljit_generate_code()
402 put_label = compiler->put_labels; in sljit_generate_code()
454 SLJIT_ASSERT(code_ptr - code <= (sljit_sw)compiler->size); in sljit_generate_code()
456 jump = compiler->jumps; in sljit_generate_code()
462 put_label = compiler->put_labels; in sljit_generate_code()
468 compiler->error = SLJIT_ERR_COMPILED; in sljit_generate_code()
469 compiler->executable_offset = executable_offset; in sljit_generate_code()
470 compiler->executable_size = (sljit_uw)(code_ptr - code) * sizeof(sljit_u16); in sljit_generate_code()
557 static sljit_s32 load_immediate(struct sljit_compiler *compiler, sljit_s32 dst, sljit_uw imm) in load_immediate() argument
566 return push_inst32(compiler, MOV_WI | RD4(dst) | tmp); in load_immediate()
569 return push_inst32(compiler, MVN_WI | RD4(dst) | tmp); in load_immediate()
573 FAIL_IF(push_inst32(compiler, MOVW | RD4(dst) in load_immediate()
578 return push_inst32(compiler, MOVT | RD4(dst) in load_immediate()
589 static sljit_s32 emit_op_imm(struct sljit_compiler *compiler, sljit_s32 flags, sljit_s32 dst, sljit… in emit_op_imm() argument
600 FAIL_IF(load_immediate(compiler, TMP_REG1, arg1)); in emit_op_imm()
615 return load_immediate(compiler, dst, imm); in emit_op_imm()
618 return load_immediate(compiler, dst, ~imm); in emit_op_imm()
623 compiler->status_flags_state = SLJIT_CURRENT_FLAGS_ADD; in emit_op_imm()
627 return push_inst16(compiler, ADDSI3 | IMM3(imm) | RD3(dst) | RN3(reg)); in emit_op_imm()
629 return push_inst16(compiler, SUBSI3 | IMM3(nimm) | RD3(dst) | RN3(reg)); in emit_op_imm()
632 return push_inst16(compiler, ADDSI8 | IMM8(imm) | RDN3(dst)); in emit_op_imm()
634 return push_inst16(compiler, SUBSI8 | IMM8(nimm) | RDN3(dst)); in emit_op_imm()
639 return push_inst32(compiler, ADDWI | RD4(dst) | RN4(reg) | IMM12(imm)); in emit_op_imm()
641 return push_inst32(compiler, SUBWI | RD4(dst) | RN4(reg) | IMM12(nimm)); in emit_op_imm()
645 return push_inst32(compiler, ADD_WI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | nimm); in emit_op_imm()
648 return push_inst32(compiler, SUB_WI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | nimm); in emit_op_imm()
651 compiler->status_flags_state = SLJIT_CURRENT_FLAGS_ADD; in emit_op_imm()
654 return push_inst32(compiler, ADCI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | imm); in emit_op_imm()
657 compiler->status_flags_state = SLJIT_CURRENT_FLAGS_SUB; in emit_op_imm()
660 return push_inst16(compiler, RSBSI | RD3(dst) | RN3(reg)); in emit_op_imm()
663 return push_inst32(compiler, RSB_WI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | imm); in emit_op_imm()
668 return push_inst16(compiler, CMPI | IMM8(imm) | RDN3(reg)); in emit_op_imm()
671 return push_inst32(compiler, CMPI_W | RN4(reg) | nimm); in emit_op_imm()
674 return push_inst32(compiler, CMNI_W | RN4(reg) | nimm); in emit_op_imm()
680 return push_inst16(compiler, SUBSI3 | IMM3(imm) | RD3(dst) | RN3(reg)); in emit_op_imm()
682 return push_inst16(compiler, ADDSI3 | IMM3(nimm) | RD3(dst) | RN3(reg)); in emit_op_imm()
685 return push_inst16(compiler, SUBSI8 | IMM8(imm) | RDN3(dst)); in emit_op_imm()
687 return push_inst16(compiler, ADDSI8 | IMM8(nimm) | RDN3(dst)); in emit_op_imm()
692 return push_inst32(compiler, SUBWI | RD4(dst) | RN4(reg) | IMM12(imm)); in emit_op_imm()
694 return push_inst32(compiler, ADDWI | RD4(dst) | RN4(reg) | IMM12(nimm)); in emit_op_imm()
698 return push_inst32(compiler, SUB_WI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | nimm); in emit_op_imm()
701 return push_inst32(compiler, ADD_WI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | nimm); in emit_op_imm()
704 compiler->status_flags_state = SLJIT_CURRENT_FLAGS_SUB; in emit_op_imm()
709 return push_inst32(compiler, SBCI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | imm); in emit_op_imm()
714 …return push_inst32(compiler, ((flags & UNUSED_RETURN) ? TSTI : ANDI) | (flags & SET_FLAGS) | RD4(d… in emit_op_imm()
717 return push_inst32(compiler, BICI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | imm); in emit_op_imm()
722 return push_inst32(compiler, ORRI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | nimm); in emit_op_imm()
725 return push_inst32(compiler, ORNI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | imm); in emit_op_imm()
730 return push_inst32(compiler, EORI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | imm); in emit_op_imm()
740 return push_inst16(compiler, MOV | SET_REGS44(dst, reg)); in emit_op_imm()
742 return push_inst16(compiler, MOVS | RD3(dst) | RN3(reg)); in emit_op_imm()
743 return push_inst32(compiler, MOV_W | SET_FLAGS | RD4(dst) | RM4(reg)); in emit_op_imm()
748 return push_inst16(compiler, LSLSI | RD3(dst) | RN3(reg) | (imm << 6)); in emit_op_imm()
749 return push_inst32(compiler, LSL_WI | (flags & SET_FLAGS) | RD4(dst) | RM4(reg) | IMM5(imm)); in emit_op_imm()
752 return push_inst16(compiler, LSRSI | RD3(dst) | RN3(reg) | (imm << 6)); in emit_op_imm()
753 return push_inst32(compiler, LSR_WI | (flags & SET_FLAGS) | RD4(dst) | RM4(reg) | IMM5(imm)); in emit_op_imm()
756 return push_inst16(compiler, ASRSI | RD3(dst) | RN3(reg) | (imm << 6)); in emit_op_imm()
757 return push_inst32(compiler, ASR_WI | (flags & SET_FLAGS) | RD4(dst) | RM4(reg) | IMM5(imm)); in emit_op_imm()
767 FAIL_IF(load_immediate(compiler, (sljit_s32)arg2, imm)); in emit_op_imm()
772 FAIL_IF(load_immediate(compiler, (sljit_s32)arg1, imm)); in emit_op_imm()
788 return push_inst16(compiler, MOV | SET_REGS44(dst, arg2)); in emit_op_imm()
792 return push_inst16(compiler, UXTB | RD3(dst) | RN3(arg2)); in emit_op_imm()
793 return push_inst32(compiler, UXTB_W | RD4(dst) | RM4(arg2)); in emit_op_imm()
797 return push_inst16(compiler, SXTB | RD3(dst) | RN3(arg2)); in emit_op_imm()
798 return push_inst32(compiler, SXTB_W | RD4(dst) | RM4(arg2)); in emit_op_imm()
802 return push_inst16(compiler, UXTH | RD3(dst) | RN3(arg2)); in emit_op_imm()
803 return push_inst32(compiler, UXTH_W | RD4(dst) | RM4(arg2)); in emit_op_imm()
807 return push_inst16(compiler, SXTH | RD3(dst) | RN3(arg2)); in emit_op_imm()
808 return push_inst32(compiler, SXTH_W | RD4(dst) | RM4(arg2)); in emit_op_imm()
812 return push_inst16(compiler, MVNS | RD3(dst) | RN3(arg2)); in emit_op_imm()
813 return push_inst32(compiler, MVN_W | (flags & SET_FLAGS) | RD4(dst) | RM4(arg2)); in emit_op_imm()
816 FAIL_IF(push_inst32(compiler, CLZ | RN4(arg2) | RD4(dst) | RM4(arg2))); in emit_op_imm()
819 compiler->status_flags_state = SLJIT_CURRENT_FLAGS_ADD; in emit_op_imm()
821 return push_inst16(compiler, ADDS | RD3(dst) | RN3(arg1) | RM3(arg2)); in emit_op_imm()
823 return push_inst16(compiler, ADD | SET_REGS44(dst, arg2)); in emit_op_imm()
824 return push_inst32(compiler, ADD_W | (flags & SET_FLAGS) | RD4(dst) | RN4(arg1) | RM4(arg2)); in emit_op_imm()
826 compiler->status_flags_state = SLJIT_CURRENT_FLAGS_ADD; in emit_op_imm()
828 return push_inst16(compiler, ADCS | RD3(dst) | RN3(arg2)); in emit_op_imm()
829 return push_inst32(compiler, ADC_W | (flags & SET_FLAGS) | RD4(dst) | RN4(arg1) | RM4(arg2)); in emit_op_imm()
831 compiler->status_flags_state = SLJIT_CURRENT_FLAGS_SUB; in emit_op_imm()
834 return push_inst16(compiler, CMP | RD3(arg1) | RN3(arg2)); in emit_op_imm()
835 return push_inst16(compiler, CMP_X | SET_REGS44(arg1, arg2)); in emit_op_imm()
838 return push_inst16(compiler, SUBS | RD3(dst) | RN3(arg1) | RM3(arg2)); in emit_op_imm()
839 return push_inst32(compiler, SUB_W | (flags & SET_FLAGS) | RD4(dst) | RN4(arg1) | RM4(arg2)); in emit_op_imm()
841 compiler->status_flags_state = SLJIT_CURRENT_FLAGS_SUB; in emit_op_imm()
843 return push_inst16(compiler, SBCS | RD3(dst) | RN3(arg2)); in emit_op_imm()
844 return push_inst32(compiler, SBC_W | (flags & SET_FLAGS) | RD4(dst) | RN4(arg1) | RM4(arg2)); in emit_op_imm()
846 compiler->status_flags_state = 0; in emit_op_imm()
848 return push_inst32(compiler, MUL | RD4(dst) | RN4(arg1) | RM4(arg2)); in emit_op_imm()
850 FAIL_IF(push_inst32(compiler, SMULL | RT4(dst) | RD4(TMP_REG2) | RN4(arg1) | RM4(arg2))); in emit_op_imm()
852 return push_inst32(compiler, CMP_W | RN4(TMP_REG2) | 0x70e0 | RM4(dst)); in emit_op_imm()
855 return push_inst16(compiler, ANDS | RD3(dst) | RN3(arg2)); in emit_op_imm()
857 return push_inst16(compiler, TST | RD3(arg1) | RN3(arg2)); in emit_op_imm()
858 …return push_inst32(compiler, ((flags & UNUSED_RETURN) ? TST_W : AND_W) | (flags & SET_FLAGS) | RD4… in emit_op_imm()
861 return push_inst16(compiler, ORRS | RD3(dst) | RN3(arg2)); in emit_op_imm()
862 return push_inst32(compiler, ORR_W | (flags & SET_FLAGS) | RD4(dst) | RN4(arg1) | RM4(arg2)); in emit_op_imm()
865 return push_inst16(compiler, EORS | RD3(dst) | RN3(arg2)); in emit_op_imm()
866 return push_inst32(compiler, EOR_W | (flags & SET_FLAGS) | RD4(dst) | RN4(arg1) | RM4(arg2)); in emit_op_imm()
869 return push_inst16(compiler, LSLS | RD3(dst) | RN3(arg2)); in emit_op_imm()
870 return push_inst32(compiler, LSL_W | (flags & SET_FLAGS) | RD4(dst) | RN4(arg1) | RM4(arg2)); in emit_op_imm()
873 return push_inst16(compiler, LSRS | RD3(dst) | RN3(arg2)); in emit_op_imm()
874 return push_inst32(compiler, LSR_W | (flags & SET_FLAGS) | RD4(dst) | RN4(arg1) | RM4(arg2)); in emit_op_imm()
877 return push_inst16(compiler, ASRS | RD3(dst) | RN3(arg2)); in emit_op_imm()
878 return push_inst32(compiler, ASR_W | (flags & SET_FLAGS) | RD4(dst) | RN4(arg1) | RM4(arg2)); in emit_op_imm()
967 static sljit_s32 emit_set_delta(struct sljit_compiler *compiler, sljit_s32 dst, sljit_s32 reg, slji… in emit_set_delta() argument
973 return push_inst32(compiler, ADDWI | RD4(dst) | RN4(reg) | IMM12(value)); in emit_set_delta()
976 return push_inst32(compiler, ADD_WI | RD4(dst) | RN4(reg) | imm); in emit_set_delta()
981 return push_inst32(compiler, SUBWI | RD4(dst) | RN4(reg) | IMM12(value)); in emit_set_delta()
984 return push_inst32(compiler, SUB_WI | RD4(dst) | RN4(reg) | imm); in emit_set_delta()
989 static SLJIT_INLINE sljit_s32 emit_op_mem(struct sljit_compiler *compiler, sljit_s32 flags, sljit_s… in emit_op_mem() argument
1002 FAIL_IF(push_inst32(compiler, MOV_WI | RD4(tmp_reg) | tmp)); in emit_op_mem()
1003 …return push_inst32(compiler, sljit_mem32[flags] | MEM_IMM12 | RT4(reg) | RN4(tmp_reg) | (argw & 0x… in emit_op_mem()
1006 FAIL_IF(load_immediate(compiler, tmp_reg, (sljit_uw)argw)); in emit_op_mem()
1008 return push_inst16(compiler, sljit_mem16_imm5[flags] | RD3(reg) | RN3(tmp_reg)); in emit_op_mem()
1009 return push_inst32(compiler, sljit_mem32[flags] | MEM_IMM12 | RT4(reg) | RN4(tmp_reg)); in emit_op_mem()
1018 return push_inst16(compiler, sljit_mem16[flags] | RD3(reg) | RN3(arg) | RM3(other_r)); in emit_op_mem()
1019 …return push_inst32(compiler, sljit_mem32[flags] | RT4(reg) | RN4(arg) | RM4(other_r) | ((sljit_ins… in emit_op_mem()
1025 push_inst32(compiler, ADD_WI | RD4(tmp_reg) | RN4(arg) | tmp); in emit_op_mem()
1033 push_inst32(compiler, SUB_WI | RD4(tmp_reg) | RN4(arg) | tmp); in emit_op_mem()
1057 …return push_inst16(compiler, sljit_mem16_imm5[flags] | RD3(reg) | RN3(arg) | ((sljit_ins)argw << (… in emit_op_mem()
1061 …return push_inst16(compiler, STR_SP | (sljit_ins)((flags & STORE) ? 0 : 0x800) | RDN3(reg) | ((slj… in emit_op_mem()
1065 …return push_inst32(compiler, sljit_mem32[flags] | MEM_IMM12 | RT4(reg) | RN4(arg) | (sljit_ins)arg… in emit_op_mem()
1067 …return push_inst32(compiler, sljit_mem32[flags] | MEM_IMM8 | RT4(reg) | RN4(arg) | (sljit_ins)-arg… in emit_op_mem()
1071 FAIL_IF(load_immediate(compiler, tmp_reg, (sljit_uw)argw)); in emit_op_mem()
1073 return push_inst16(compiler, sljit_mem16[flags] | RD3(reg) | RN3(arg) | RM3(tmp_reg)); in emit_op_mem()
1074 return push_inst32(compiler, sljit_mem32[flags] | RT4(reg) | RN4(arg) | RM4(tmp_reg)); in emit_op_mem()
1081 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_enter(struct sljit_compiler *compiler, in sljit_emit_enter() argument
1097 …CHECK(check_sljit_emit_enter(compiler, options, arg_types, scratches, saveds, fscratches, fsaveds,… in sljit_emit_enter()
1098 set_emit_enter(compiler, options, arg_types, scratches, saveds, fscratches, fsaveds, local_size); in sljit_emit_enter()
1109 ? push_inst32(compiler, PUSH_W | (1 << 14) | imm) in sljit_emit_enter()
1110 : push_inst16(compiler, PUSH | (1 << 8) | imm)); in sljit_emit_enter()
1117 FAIL_IF(push_inst16(compiler, SUB_SP_I | (sizeof(sljit_sw) >> 2))); in sljit_emit_enter()
1122 …FAIL_IF(push_inst32(compiler, VPUSH | DD4(SLJIT_FS0) | ((sljit_uw)SLJIT_NUMBER_OF_SAVED_FLOAT_REGI… in sljit_emit_enter()
1125 FAIL_IF(push_inst32(compiler, VPUSH | DD4(SLJIT_FS0) | ((sljit_uw)fsaveds << 1))); in sljit_emit_enter()
1127 …FAIL_IF(push_inst32(compiler, VPUSH | DD4(fscratches) | ((sljit_uw)(fscratches - (SLJIT_FIRST_SAVE… in sljit_emit_enter()
1132 compiler->local_size = local_size; in sljit_emit_enter()
1150 …FAIL_IF(push_inst32(compiler, VMOV2 | (offset << 10) | ((offset + sizeof(sljit_sw)) << 14) | float… in sljit_emit_enter()
1152 FAIL_IF(push_inst32(compiler, VLDR_F32 | 0x800100 | RN4(SLJIT_SP) in sljit_emit_enter()
1159 FAIL_IF(push_inst32(compiler, VMOV | (float_arg_count << 16) | (offset << 10))); in sljit_emit_enter()
1161 FAIL_IF(push_inst32(compiler, VLDR_F32 | 0x800000 | RN4(SLJIT_SP) in sljit_emit_enter()
1179 FAIL_IF(push_inst16(compiler, MOV | RD3(tmp) | (offset << 1))); in sljit_emit_enter()
1181 FAIL_IF(push_inst16(compiler, LDR_SP | RDN3(tmp) in sljit_emit_enter()
1190 compiler->args_size = offset; in sljit_emit_enter()
1218 …FAIL_IF(push_inst16(compiler, MOV | SET_REGS44(SLJIT_S0 - saved_arg_count, SLJIT_R0 + word_arg_cou… in sljit_emit_enter()
1231 FAIL_IF(push_inst32(compiler, *(--remap_ptr))); in sljit_emit_enter()
1239 FAIL_IF(push_inst32(compiler, SUB_WI | RD4(SLJIT_SP) | RN4(SLJIT_SP) | imm)); in sljit_emit_enter()
1244 FAIL_IF(push_inst32(compiler, LDRI | 0x400 | RT4(TMP_REG1) | RN4(SLJIT_SP))); in sljit_emit_enter()
1245 FAIL_IF(push_inst32(compiler, SUB_WI | RD4(SLJIT_SP) | RN4(SLJIT_SP) | imm)); in sljit_emit_enter()
1248 FAIL_IF(push_inst32(compiler, LDRI | 0x400 | RT4(TMP_REG1) | RN4(SLJIT_SP))); in sljit_emit_enter()
1249 FAIL_IF(push_inst32(compiler, SUB_WI | RD4(SLJIT_SP) | RN4(SLJIT_SP) | imm)); in sljit_emit_enter()
1252 FAIL_IF(load_immediate(compiler, TMP_REG2, ((sljit_uw)local_size >> 12) - 1)); in sljit_emit_enter()
1253 FAIL_IF(push_inst32(compiler, LDRI | 0x400 | RT4(TMP_REG1) | RN4(SLJIT_SP))); in sljit_emit_enter()
1254 FAIL_IF(push_inst32(compiler, SUB_WI | RD4(SLJIT_SP) | RN4(SLJIT_SP) | imm)); in sljit_emit_enter()
1255 FAIL_IF(push_inst32(compiler, SUB_WI | SET_FLAGS | RD4(TMP_REG2) | RN4(TMP_REG2) | 1)); in sljit_emit_enter()
1256 FAIL_IF(push_inst16(compiler, BCC | (0x1 << 8) /* not-equal */ | (-8 & 0xff))); in sljit_emit_enter()
1259 FAIL_IF(push_inst32(compiler, LDRI | 0x400 | RT4(TMP_REG1) | RN4(SLJIT_SP))); in sljit_emit_enter()
1267 FAIL_IF(push_inst16(compiler, SUB_SP_I | ((sljit_uw)local_size >> 2))); in sljit_emit_enter()
1269 FAIL_IF(emit_op_imm(compiler, SLJIT_SUB | ARG2_IMM, SLJIT_SP, SLJIT_SP, (sljit_uw)local_size)); in sljit_emit_enter()
1271 FAIL_IF(push_inst32(compiler, LDRI | 0x400 | RT4(TMP_REG1) | RN4(SLJIT_SP))); in sljit_emit_enter()
1273 …FAIL_IF(push_inst32(compiler, LDRI | 0x500 | RT4(TMP_REG1) | RN4(SLJIT_SP) | (sljit_uw)local_size)… in sljit_emit_enter()
1277 FAIL_IF(push_inst16(compiler, SUB_SP_I | ((sljit_uw)local_size >> 2))); in sljit_emit_enter()
1279 FAIL_IF(emit_op_imm(compiler, SLJIT_SUB | ARG2_IMM, SLJIT_SP, SLJIT_SP, (sljit_uw)local_size)); in sljit_emit_enter()
1286 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_set_context(struct sljit_compiler *compiler, in sljit_set_context() argument
1293 …CHECK(check_sljit_set_context(compiler, options, arg_types, scratches, saveds, fscratches, fsaveds… in sljit_set_context()
1294 set_set_context(compiler, options, arg_types, scratches, saveds, fscratches, fsaveds, local_size); in sljit_set_context()
1301 compiler->local_size = ((size + local_size + 0x7) & ~0x7) - size; in sljit_set_context()
1305 static sljit_s32 emit_add_sp(struct sljit_compiler *compiler, sljit_uw imm) in emit_add_sp() argument
1311 return push_inst16(compiler, ADD_SP_I | (imm >> 2)); in emit_add_sp()
1314 return push_inst32(compiler, ADDWI | RD4(SLJIT_SP) | RN4(SLJIT_SP) | IMM12(imm)); in emit_add_sp()
1319 return push_inst32(compiler, ADD_WI | RD4(SLJIT_SP) | RN4(SLJIT_SP) | imm2); in emit_add_sp()
1321 FAIL_IF(load_immediate(compiler, TMP_REG2, imm)); in emit_add_sp()
1322 return push_inst16(compiler, ADD_SP | RN3(TMP_REG2)); in emit_add_sp()
1325 static sljit_s32 emit_stack_frame_release(struct sljit_compiler *compiler, sljit_s32 frame_size) in emit_stack_frame_release() argument
1333 local_size = compiler->local_size; in emit_stack_frame_release()
1334 fscratches = compiler->fscratches; in emit_stack_frame_release()
1335 fsaveds = compiler->fsaveds; in emit_stack_frame_release()
1339 FAIL_IF(emit_add_sp(compiler, (sljit_uw)local_size)); in emit_stack_frame_release()
1342 …FAIL_IF(push_inst32(compiler, VPOP | DD4(SLJIT_FS0) | ((sljit_uw)SLJIT_NUMBER_OF_SAVED_FLOAT_REGIS… in emit_stack_frame_release()
1345 …FAIL_IF(push_inst32(compiler, VPOP | DD4(fscratches) | ((sljit_uw)(fscratches - (SLJIT_FIRST_SAVED… in emit_stack_frame_release()
1347 FAIL_IF(push_inst32(compiler, VPOP | DD4(SLJIT_FS0) | ((sljit_uw)fsaveds << 1))); in emit_stack_frame_release()
1350 local_size = GET_SAVED_REGISTERS_SIZE(compiler->scratches, compiler->saveds, 1) & 0x7; in emit_stack_frame_release()
1360 tmp = SLJIT_S0 - compiler->saveds; in emit_stack_frame_release()
1364 for (i = compiler->scratches; i >= SLJIT_FIRST_SAVED_REG; i--) in emit_stack_frame_release()
1375 FAIL_IF(push_inst16(compiler, SUB_SP_I | ((sljit_uw)(frame_size - local_size) >> 2))); in emit_stack_frame_release()
1377 FAIL_IF(emit_add_sp(compiler, (sljit_uw)(local_size - frame_size))); in emit_stack_frame_release()
1382 if (compiler->saveds > 0) { in emit_stack_frame_release()
1393 return push_inst16(compiler, STR_SP | 0x800 | RDN3(lr_dst) | (sljit_uw)(frame_size >> 2)); in emit_stack_frame_release()
1395 return push_inst32(compiler, LDR | RT4(lr_dst) | RN4(SLJIT_SP) | (sljit_uw)frame_size); in emit_stack_frame_release()
1399 FAIL_IF(emit_add_sp(compiler, (sljit_uw)local_size)); in emit_stack_frame_release()
1408 FAIL_IF(push_inst16(compiler, POP | reg_list)); in emit_stack_frame_release()
1412 return push_inst32(compiler, 0xf85d0b04 | RT4(lr_dst)); in emit_stack_frame_release()
1420 FAIL_IF(push_inst32(compiler, POP_W | reg_list)); in emit_stack_frame_release()
1424 return push_inst16(compiler, SUB_SP_I | (((sljit_uw)frame_size - sizeof(sljit_sw)) >> 2)); in emit_stack_frame_release()
1428 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_return_void(struct sljit_compiler *compiler) in sljit_emit_return_void() argument
1431 CHECK(check_sljit_emit_return_void(compiler)); in sljit_emit_return_void()
1433 return emit_stack_frame_release(compiler, 0); in sljit_emit_return_void()
1462 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op0(struct sljit_compiler *compiler, sljit_s32 op) in sljit_emit_op0() argument
1470 CHECK(check_sljit_emit_op0(compiler, op)); in sljit_emit_op0()
1475 return push_inst16(compiler, BKPT); in sljit_emit_op0()
1477 return push_inst16(compiler, NOP); in sljit_emit_op0()
1480 return push_inst32(compiler, (op == SLJIT_LMUL_UW ? UMULL : SMULL) in sljit_emit_op0()
1485 FAIL_IF(push_inst16(compiler, MOV | SET_REGS44(TMP_REG1, SLJIT_R0))); in sljit_emit_op0()
1486 …FAIL_IF(push_inst32(compiler, (op == SLJIT_DIVMOD_UW ? UDIV : SDIV) | RD4(SLJIT_R0) | RN4(SLJIT_R0… in sljit_emit_op0()
1487 FAIL_IF(push_inst32(compiler, MUL | RD4(SLJIT_R1) | RN4(SLJIT_R0) | RM4(SLJIT_R1))); in sljit_emit_op0()
1488 return push_inst32(compiler, SUB_W | RD4(SLJIT_R1) | RN4(TMP_REG1) | RM4(SLJIT_R1)); in sljit_emit_op0()
1491 …return push_inst32(compiler, (op == SLJIT_DIV_UW ? UDIV : SDIV) | RD4(SLJIT_R0) | RN4(SLJIT_R0) | … in sljit_emit_op0()
1501 if (compiler->scratches >= 4) in sljit_emit_op0()
1503 if (compiler->scratches >= 3) in sljit_emit_op0()
1509 FAIL_IF(push_inst32(compiler, 0xf84d0d00 | (saved_reg_count >= 3 ? 16 : 8) in sljit_emit_op0()
1513 FAIL_IF(push_inst16(compiler, 0x9001 | (saved_reg_list[1] << 8) /* str rX, [sp, #4] */)); in sljit_emit_op0()
1517 FAIL_IF(push_inst16(compiler, 0x9002 | (saved_reg_list[2] << 8) /* str rX, [sp, #8] */)); in sljit_emit_op0()
1522 FAIL_IF(push_inst16(compiler, MOV | SET_REGS44(TMP_REG1, SLJIT_R0))); in sljit_emit_op0()
1523 FAIL_IF(push_inst16(compiler, MOV | SET_REGS44(SLJIT_R0, SLJIT_R1))); in sljit_emit_op0()
1524 FAIL_IF(push_inst16(compiler, MOV | SET_REGS44(SLJIT_R1, TMP_REG1))); in sljit_emit_op0()
1525 FAIL_IF(sljit_emit_ijump(compiler, SLJIT_FAST_CALL, SLJIT_IMM, in sljit_emit_op0()
1528 FAIL_IF(sljit_emit_ijump(compiler, SLJIT_FAST_CALL, SLJIT_IMM, in sljit_emit_op0()
1537 FAIL_IF(push_inst16(compiler, 0x9802 | (saved_reg_list[2] << 8) /* ldr rX, [sp, #8] */)); in sljit_emit_op0()
1541 FAIL_IF(push_inst16(compiler, 0x9801 | (saved_reg_list[1] << 8) /* ldr rX, [sp, #4] */)); in sljit_emit_op0()
1543 return push_inst32(compiler, 0xf85d0b00 | (saved_reg_count >= 3 ? 16 : 8) in sljit_emit_op0()
1556 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op1(struct sljit_compiler *compiler, sljit_s32 op, in sljit_emit_op1() argument
1564 CHECK(check_sljit_emit_op1(compiler, op, dst, dstw, src, srcw)); in sljit_emit_op1()
1607 FAIL_IF(emit_op_imm(compiler, SLJIT_MOV | ARG2_IMM, dst_r, TMP_REG2, (sljit_uw)srcw)); in sljit_emit_op1()
1609 FAIL_IF(emit_op_mem(compiler, flags, dst_r, src, srcw, TMP_REG1)); in sljit_emit_op1()
1612 return emit_op_imm(compiler, op, dst_r, TMP_REG2, (sljit_uw)src); in sljit_emit_op1()
1619 return emit_op_mem(compiler, flags | STORE, dst_r, dst, dstw, TMP_REG2); in sljit_emit_op1()
1625 FAIL_IF(emit_op_mem(compiler, WORD_SIZE, TMP_REG1, src, srcw, TMP_REG1)); in sljit_emit_op1()
1629 emit_op_imm(compiler, flags | op, dst_r, TMP_REG2, (sljit_uw)src); in sljit_emit_op1()
1632 return emit_op_mem(compiler, flags | STORE, dst_r, dst, dstw, TMP_REG2); in sljit_emit_op1()
1636 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op2(struct sljit_compiler *compiler, sljit_s32 op, in sljit_emit_op2() argument
1644 CHECK(check_sljit_emit_op2(compiler, op, 0, dst, dstw, src1, src1w, src2, src2w)); in sljit_emit_op2()
1658 emit_op_mem(compiler, WORD_SIZE, TMP_REG1, src1, src1w, TMP_REG1); in sljit_emit_op2()
1668 emit_op_mem(compiler, WORD_SIZE, src2_reg, src2, src2w, src2_reg); in sljit_emit_op2()
1674 emit_op_imm(compiler, flags | GET_OPCODE(op), dst_reg, (sljit_uw)src1w, (sljit_uw)src2w); in sljit_emit_op2()
1678 return emit_op_mem(compiler, WORD_SIZE | STORE, dst_reg, dst, dstw, TMP_REG2); in sljit_emit_op2()
1681 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op2u(struct sljit_compiler *compiler, sljit_s32 op, in sljit_emit_op2u() argument
1686 CHECK(check_sljit_emit_op2(compiler, op, 1, 0, 0, src1, src1w, src2, src2w)); in sljit_emit_op2u()
1690 compiler->skip_checks = 1; in sljit_emit_op2u()
1692 return sljit_emit_op2(compiler, op, TMP_REG1, 0, src1, src1w, src2, src2w); in sljit_emit_op2u()
1695 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op_src(struct sljit_compiler *compiler, sljit_s32 op, in sljit_emit_op_src() argument
1699 CHECK(check_sljit_emit_op_src(compiler, op, src, srcw)); in sljit_emit_op_src()
1707 FAIL_IF(push_inst16(compiler, MOV | SET_REGS44(TMP_REG2, src))); in sljit_emit_op_src()
1709 FAIL_IF(emit_op_mem(compiler, WORD_SIZE, TMP_REG2, src, srcw, TMP_REG2)); in sljit_emit_op_src()
1711 return push_inst16(compiler, BX | RN3(TMP_REG2)); in sljit_emit_op_src()
1718 return emit_op_mem(compiler, PRELOAD, TMP_PC, src, srcw, TMP_REG1); in sljit_emit_op_src()
1736 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op_custom(struct sljit_compiler *compiler, in sljit_emit_op_custom() argument
1740 CHECK(check_sljit_emit_op_custom(compiler, instruction, size)); in sljit_emit_op_custom()
1743 return push_inst16(compiler, *(sljit_u16*)instruction); in sljit_emit_op_custom()
1744 return push_inst32(compiler, *(sljit_ins*)instruction); in sljit_emit_op_custom()
1753 static sljit_s32 emit_fop_mem(struct sljit_compiler *compiler, sljit_s32 flags, sljit_s32 reg, slji… in emit_fop_mem() argument
1762 …FAIL_IF(push_inst32(compiler, ADD_W | RD4(TMP_REG1) | RN4(arg & REG_MASK) | RM4(OFFS_REG(arg)) | (… in emit_fop_mem()
1769 …return push_inst32(compiler, inst | 0x800000 | RN4(arg & REG_MASK) | DD4(reg) | ((sljit_uw)argw >>… in emit_fop_mem()
1771 return push_inst32(compiler, inst | RN4(arg & REG_MASK) | DD4(reg) | ((sljit_uw)-argw >> 2)); in emit_fop_mem()
1775 if (emit_set_delta(compiler, TMP_REG1, arg & REG_MASK, argw) != SLJIT_ERR_UNSUPPORTED) { in emit_fop_mem()
1776 FAIL_IF(compiler->error); in emit_fop_mem()
1777 return push_inst32(compiler, inst | 0x800000 | RN4(TMP_REG1) | DD4(reg)); in emit_fop_mem()
1782 FAIL_IF(push_inst32(compiler, ADD_WI | RD4(TMP_REG1) | RN4(arg & REG_MASK) | imm)); in emit_fop_mem()
1783 …return push_inst32(compiler, inst | 0x800000 | RN4(TMP_REG1) | DD4(reg) | (((sljit_uw)argw & 0x3fc… in emit_fop_mem()
1789 FAIL_IF(push_inst32(compiler, SUB_WI | RD4(TMP_REG1) | RN4(arg & REG_MASK) | imm)); in emit_fop_mem()
1790 return push_inst32(compiler, inst | RN4(TMP_REG1) | DD4(reg) | (((sljit_uw)argw & 0x3fc) >> 2)); in emit_fop_mem()
1794 FAIL_IF(load_immediate(compiler, TMP_REG1, (sljit_uw)argw)); in emit_fop_mem()
1796 FAIL_IF(push_inst16(compiler, ADD | SET_REGS44(TMP_REG1, (arg & REG_MASK)))); in emit_fop_mem()
1797 return push_inst32(compiler, inst | 0x800000 | RN4(TMP_REG1) | DD4(reg)); in emit_fop_mem()
1800 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
1807 FAIL_IF(emit_fop_mem(compiler, (op & SLJIT_32) | FPU_LOAD, TMP_FREG1, src, srcw)); in sljit_emit_fop1_conv_sw_from_f64()
1811 FAIL_IF(push_inst32(compiler, VCVT_S32_F32 | (op & SLJIT_32) | DD4(TMP_FREG1) | DM4(src))); in sljit_emit_fop1_conv_sw_from_f64()
1814 return push_inst32(compiler, VMOV | (1 << 20) | RT4(dst) | DN4(TMP_FREG1)); in sljit_emit_fop1_conv_sw_from_f64()
1817 return emit_fop_mem(compiler, 0, TMP_FREG1, dst, dstw); in sljit_emit_fop1_conv_sw_from_f64()
1820 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
1829 FAIL_IF(push_inst32(compiler, VMOV | RT4(src) | DN4(TMP_FREG1))); in sljit_emit_fop1_conv_f64_from_sw()
1832 FAIL_IF(emit_fop_mem(compiler, FPU_LOAD, TMP_FREG1, src, srcw)); in sljit_emit_fop1_conv_f64_from_sw()
1835 FAIL_IF(load_immediate(compiler, TMP_REG1, (sljit_uw)srcw)); in sljit_emit_fop1_conv_f64_from_sw()
1836 FAIL_IF(push_inst32(compiler, VMOV | RT4(TMP_REG1) | DN4(TMP_FREG1))); in sljit_emit_fop1_conv_f64_from_sw()
1839 FAIL_IF(push_inst32(compiler, VCVT_F32_S32 | (op & SLJIT_32) | DD4(dst_r) | DM4(TMP_FREG1))); in sljit_emit_fop1_conv_f64_from_sw()
1842 return emit_fop_mem(compiler, (op & SLJIT_32), TMP_FREG1, dst, dstw); in sljit_emit_fop1_conv_f64_from_sw()
1846 static SLJIT_INLINE sljit_s32 sljit_emit_fop1_cmp(struct sljit_compiler *compiler, sljit_s32 op, in sljit_emit_fop1_cmp() argument
1853 emit_fop_mem(compiler, (op & SLJIT_32) | FPU_LOAD, TMP_FREG1, src1, src1w); in sljit_emit_fop1_cmp()
1858 emit_fop_mem(compiler, (op & SLJIT_32) | FPU_LOAD, TMP_FREG2, src2, src2w); in sljit_emit_fop1_cmp()
1862 FAIL_IF(push_inst32(compiler, VCMP_F32 | (op & SLJIT_32) | DD4(src1) | DM4(src2))); in sljit_emit_fop1_cmp()
1863 return push_inst32(compiler, VMRS); in sljit_emit_fop1_cmp()
1866 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fop1(struct sljit_compiler *compiler, sljit_s32 op, in sljit_emit_fop1() argument
1875 SELECT_FOP1_OPERATION_WITH_CHECKS(compiler, op, dst, dstw, src, srcw); in sljit_emit_fop1()
1883 emit_fop_mem(compiler, (op & SLJIT_32) | FPU_LOAD, dst_r, src, srcw); in sljit_emit_fop1()
1891 FAIL_IF(push_inst32(compiler, VMOV_F32 | (op & SLJIT_32) | DD4(dst_r) | DM4(src))); in sljit_emit_fop1()
1897 FAIL_IF(push_inst32(compiler, VNEG_F32 | (op & SLJIT_32) | DD4(dst_r) | DM4(src))); in sljit_emit_fop1()
1900 FAIL_IF(push_inst32(compiler, VABS_F32 | (op & SLJIT_32) | DD4(dst_r) | DM4(src))); in sljit_emit_fop1()
1903 FAIL_IF(push_inst32(compiler, VCVT_F64_F32 | (op & SLJIT_32) | DD4(dst_r) | DM4(src))); in sljit_emit_fop1()
1909 return emit_fop_mem(compiler, (op & SLJIT_32), dst_r, dst, dstw); in sljit_emit_fop1()
1913 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fop2(struct sljit_compiler *compiler, sljit_s32 op, in sljit_emit_fop2() argument
1921 CHECK(check_sljit_emit_fop2(compiler, op, dst, dstw, src1, src1w, src2, src2w)); in sljit_emit_fop2()
1930 emit_fop_mem(compiler, (op & SLJIT_32) | FPU_LOAD, TMP_FREG1, src1, src1w); in sljit_emit_fop2()
1934 emit_fop_mem(compiler, (op & SLJIT_32) | FPU_LOAD, TMP_FREG2, src2, src2w); in sljit_emit_fop2()
1940 FAIL_IF(push_inst32(compiler, VADD_F32 | (op & SLJIT_32) | DD4(dst_r) | DN4(src1) | DM4(src2))); in sljit_emit_fop2()
1943 FAIL_IF(push_inst32(compiler, VSUB_F32 | (op & SLJIT_32) | DD4(dst_r) | DN4(src1) | DM4(src2))); in sljit_emit_fop2()
1946 FAIL_IF(push_inst32(compiler, VMUL_F32 | (op & SLJIT_32) | DD4(dst_r) | DN4(src1) | DM4(src2))); in sljit_emit_fop2()
1949 FAIL_IF(push_inst32(compiler, VDIV_F32 | (op & SLJIT_32) | DD4(dst_r) | DN4(src1) | DM4(src2))); in sljit_emit_fop2()
1955 return emit_fop_mem(compiler, (op & SLJIT_32), TMP_FREG1, dst, dstw); in sljit_emit_fop2()
1964 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fast_enter(struct sljit_compiler *compiler, sljit_s32… in sljit_emit_fast_enter() argument
1967 CHECK(check_sljit_emit_fast_enter(compiler, dst, dstw)); in sljit_emit_fast_enter()
1973 return push_inst16(compiler, MOV | SET_REGS44(dst, TMP_REG2)); in sljit_emit_fast_enter()
1976 return emit_op_mem(compiler, WORD_SIZE | STORE, TMP_REG2, dst, dstw, TMP_REG1); in sljit_emit_fast_enter()
1983 static sljit_uw get_cc(struct sljit_compiler *compiler, sljit_s32 type) in get_cc() argument
1995 if (compiler->status_flags_state & SLJIT_CURRENT_FLAGS_ADD) in get_cc()
2004 if (compiler->status_flags_state & SLJIT_CURRENT_FLAGS_ADD) in get_cc()
2033 if (!(compiler->status_flags_state & (SLJIT_CURRENT_FLAGS_ADD | SLJIT_CURRENT_FLAGS_SUB))) in get_cc()
2041 if (!(compiler->status_flags_state & (SLJIT_CURRENT_FLAGS_ADD | SLJIT_CURRENT_FLAGS_SUB))) in get_cc()
2054 SLJIT_API_FUNC_ATTRIBUTE struct sljit_label* sljit_emit_label(struct sljit_compiler *compiler) in sljit_emit_label() argument
2059 CHECK_PTR(check_sljit_emit_label(compiler)); in sljit_emit_label()
2061 if (compiler->last_label && compiler->last_label->size == compiler->size) in sljit_emit_label()
2062 return compiler->last_label; in sljit_emit_label()
2064 label = (struct sljit_label*)ensure_abuf(compiler, sizeof(struct sljit_label)); in sljit_emit_label()
2066 set_label(label, compiler); in sljit_emit_label()
2070 SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit_jump(struct sljit_compiler *compiler, sljit_… in sljit_emit_jump() argument
2076 CHECK_PTR(check_sljit_emit_jump(compiler, type)); in sljit_emit_jump()
2078 jump = (struct sljit_jump*)ensure_abuf(compiler, sizeof(struct sljit_jump)); in sljit_emit_jump()
2080 set_jump(jump, compiler, type & SLJIT_REWRITABLE_JUMP); in sljit_emit_jump()
2083 PTR_FAIL_IF(emit_imm32_const(compiler, TMP_REG1, 0)); in sljit_emit_jump()
2086 cc = get_cc(compiler, type); in sljit_emit_jump()
2088 PTR_FAIL_IF(push_inst16(compiler, IT | (cc << 4) | 0x8)); in sljit_emit_jump()
2091 jump->addr = compiler->size; in sljit_emit_jump()
2093 PTR_FAIL_IF(push_inst16(compiler, BX | RN3(TMP_REG1))); in sljit_emit_jump()
2096 PTR_FAIL_IF(push_inst16(compiler, BLX | RN3(TMP_REG1))); in sljit_emit_jump()
2104 static sljit_s32 softfloat_call_with_args(struct sljit_compiler *compiler, sljit_s32 arg_types, slj… in softfloat_call_with_args() argument
2146 if (offset > 4 * sizeof(sljit_sw) && (!is_tail_call || offset > compiler->args_size)) { in softfloat_call_with_args()
2156 FAIL_IF(emit_stack_frame_release(compiler, (sljit_s32)offset)); in softfloat_call_with_args()
2158 FAIL_IF(push_inst16(compiler, SUB_SP_I | (offset >> 2))); in softfloat_call_with_args()
2161 FAIL_IF(emit_stack_frame_release(compiler, -1)); in softfloat_call_with_args()
2178 FAIL_IF(push_inst16(compiler, MOV | (src_offset << 1) | 4 | (1 << 7))); in softfloat_call_with_args()
2181 …FAIL_IF(push_inst32(compiler, VMOV2 | 0x100000 | (offset << 10) | ((offset + sizeof(sljit_sw)) << … in softfloat_call_with_args()
2183 FAIL_IF(push_inst32(compiler, VSTR_F32 | 0x800100 | RN4(SLJIT_SP) in softfloat_call_with_args()
2192 FAIL_IF(push_inst16(compiler, MOV | (src_offset << 1) | 4 | (1 << 7))); in softfloat_call_with_args()
2195 FAIL_IF(push_inst32(compiler, VMOV | 0x100000 | (float_arg_count << 16) | (offset << 10))); in softfloat_call_with_args()
2197 FAIL_IF(push_inst32(compiler, VSTR_F32 | 0x800000 | RN4(SLJIT_SP) in softfloat_call_with_args()
2209 FAIL_IF(push_inst16(compiler, MOV | (src_offset << 1) | 4 | (1 << 7))); in softfloat_call_with_args()
2216 FAIL_IF(push_inst16(compiler, MOV | (offset >> 2) | (word_arg_offset << 1))); in softfloat_call_with_args()
2218 …FAIL_IF(push_inst16(compiler, STR_SP | (word_arg_offset << 6) | ((offset - 4 * sizeof(sljit_sw)) >… in softfloat_call_with_args()
2229 static sljit_s32 softfloat_post_call_with_args(struct sljit_compiler *compiler, sljit_s32 arg_types) in softfloat_post_call_with_args() argument
2232 FAIL_IF(push_inst32(compiler, VMOV2 | (1 << 16) | (0 << 12) | 0)); in softfloat_post_call_with_args()
2234 FAIL_IF(push_inst32(compiler, VMOV | (0 << 16) | (0 << 12))); in softfloat_post_call_with_args()
2241 static sljit_s32 hardfloat_call_with_args(struct sljit_compiler *compiler, sljit_s32 arg_types) in hardfloat_call_with_args() argument
2254 FAIL_IF(push_inst32(compiler, VMOV_F32 | SLJIT_32 | DD4(new_offset) | DM4(offset))); in hardfloat_call_with_args()
2261 FAIL_IF(push_inst32(compiler, VMOV_F32 | 0x400000 | DD4(f32_offset) | DM4(offset))); in hardfloat_call_with_args()
2265 FAIL_IF(push_inst32(compiler, VMOV_F32 | 0x400000 | DD4(new_offset) | DM4(offset))); in hardfloat_call_with_args()
2280 SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit_call(struct sljit_compiler *compiler, sljit_… in sljit_emit_call() argument
2289 CHECK_PTR(check_sljit_emit_call(compiler, type, arg_types)); in sljit_emit_call()
2292 PTR_FAIL_IF(softfloat_call_with_args(compiler, arg_types, NULL, &extra_space)); in sljit_emit_call()
2300 compiler->skip_checks = 1; in sljit_emit_call()
2303 jump = sljit_emit_jump(compiler, type); in sljit_emit_call()
2308 PTR_FAIL_IF(push_inst32(compiler, LDR | RT4(TMP_REG2) in sljit_emit_call()
2311 PTR_FAIL_IF(push_inst16(compiler, ADD_SP_I | (extra_space >> 2))); in sljit_emit_call()
2314 PTR_FAIL_IF(push_inst16(compiler, BX | RN3(TMP_REG2))); in sljit_emit_call()
2320 PTR_FAIL_IF(softfloat_post_call_with_args(compiler, arg_types)); in sljit_emit_call()
2325 PTR_FAIL_IF(emit_stack_frame_release(compiler, -1)); in sljit_emit_call()
2329 PTR_FAIL_IF(hardfloat_call_with_args(compiler, arg_types)); in sljit_emit_call()
2333 compiler->skip_checks = 1; in sljit_emit_call()
2336 return sljit_emit_jump(compiler, type); in sljit_emit_call()
2340 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_ijump(struct sljit_compiler *compiler, sljit_s32 type… in sljit_emit_ijump() argument
2345 CHECK(check_sljit_emit_ijump(compiler, type, src, srcw)); in sljit_emit_ijump()
2353 return push_inst16(compiler, (type <= SLJIT_JUMP ? BX : BLX) | RN3(src)); in sljit_emit_ijump()
2356 …FAIL_IF(emit_op_mem(compiler, WORD_SIZE, type <= SLJIT_JUMP ? TMP_PC : TMP_REG1, src, srcw, TMP_RE… in sljit_emit_ijump()
2358 return push_inst16(compiler, BLX | RN3(TMP_REG1)); in sljit_emit_ijump()
2362 jump = (struct sljit_jump*)ensure_abuf(compiler, sizeof(struct sljit_jump)); in sljit_emit_ijump()
2364 set_jump(jump, compiler, JUMP_ADDR | ((type >= SLJIT_FAST_CALL) ? IS_BL : 0)); in sljit_emit_ijump()
2367 FAIL_IF(emit_imm32_const(compiler, TMP_REG1, 0)); in sljit_emit_ijump()
2368 jump->addr = compiler->size; in sljit_emit_ijump()
2369 return push_inst16(compiler, (type <= SLJIT_JUMP ? BX : BLX) | RN3(TMP_REG1)); in sljit_emit_ijump()
2372 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_icall(struct sljit_compiler *compiler, sljit_s32 type, in sljit_emit_icall() argument
2381 CHECK(check_sljit_emit_icall(compiler, type, arg_types, src, srcw)); in sljit_emit_icall()
2384 FAIL_IF(emit_op_mem(compiler, WORD_SIZE, TMP_REG1, src, srcw, TMP_REG1)); in sljit_emit_icall()
2389 FAIL_IF(push_inst16(compiler, MOV | SET_REGS44(TMP_REG1, src))); in sljit_emit_icall()
2394 FAIL_IF(softfloat_call_with_args(compiler, arg_types, &src, &extra_space)); in sljit_emit_icall()
2402 compiler->skip_checks = 1; in sljit_emit_icall()
2405 FAIL_IF(sljit_emit_ijump(compiler, type, src, srcw)); in sljit_emit_icall()
2409 FAIL_IF(push_inst32(compiler, LDR | RT4(TMP_REG2) in sljit_emit_icall()
2412 FAIL_IF(push_inst16(compiler, ADD_SP_I | (extra_space >> 2))); in sljit_emit_icall()
2415 return push_inst16(compiler, BX | RN3(TMP_REG2)); in sljit_emit_icall()
2419 return softfloat_post_call_with_args(compiler, arg_types); in sljit_emit_icall()
2423 FAIL_IF(emit_stack_frame_release(compiler, -1)); in sljit_emit_icall()
2427 FAIL_IF(hardfloat_call_with_args(compiler, arg_types)); in sljit_emit_icall()
2431 compiler->skip_checks = 1; in sljit_emit_icall()
2434 return sljit_emit_ijump(compiler, type, src, srcw); in sljit_emit_icall()
2438 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op_flags(struct sljit_compiler *compiler, sljit_s32 o… in sljit_emit_op_flags() argument
2446 CHECK(check_sljit_emit_op_flags(compiler, op, dst, dstw, type)); in sljit_emit_op_flags()
2450 cc = get_cc(compiler, type & 0xff); in sljit_emit_op_flags()
2454 FAIL_IF(push_inst16(compiler, IT | (cc << 4) | (((cc & 0x1) ^ 0x1) << 3) | 0x4)); in sljit_emit_op_flags()
2456 FAIL_IF(push_inst32(compiler, MOV_WI | RD4(dst_r) | 1)); in sljit_emit_op_flags()
2457 FAIL_IF(push_inst32(compiler, MOV_WI | RD4(dst_r) | 0)); in sljit_emit_op_flags()
2460 FAIL_IF(push_inst16(compiler, MOVSI | RDN3(dst_r) | 1)); in sljit_emit_op_flags()
2461 FAIL_IF(push_inst16(compiler, MOVSI | RDN3(dst_r) | 0)); in sljit_emit_op_flags()
2465 return emit_op_mem(compiler, WORD_SIZE | STORE, TMP_REG1, dst, dstw, TMP_REG2); in sljit_emit_op_flags()
2469 FAIL_IF(emit_op_mem(compiler, WORD_SIZE, TMP_REG1, dst, dstw, TMP_REG2)); in sljit_emit_op_flags()
2472 FAIL_IF(push_inst16(compiler, IT | (cc << 4) | (((cc & 0x1) ^ 0x1) << 3) | 0x4)); in sljit_emit_op_flags()
2473 FAIL_IF(push_inst32(compiler, ANDI | RN4(dst_r) | RD4(dst_r) | 1)); in sljit_emit_op_flags()
2474 FAIL_IF(push_inst32(compiler, ANDI | RN4(dst_r) | RD4(dst_r) | 0)); in sljit_emit_op_flags()
2477 FAIL_IF(push_inst16(compiler, IT | (cc << 4) | 0x8)); in sljit_emit_op_flags()
2478 FAIL_IF(push_inst32(compiler, ((op == SLJIT_OR) ? ORRI : EORI) | RN4(dst_r) | RD4(dst_r) | 1)); in sljit_emit_op_flags()
2482 FAIL_IF(emit_op_mem(compiler, WORD_SIZE | STORE, TMP_REG1, dst, dstw, TMP_REG2)); in sljit_emit_op_flags()
2488 return push_inst32(compiler, MOV_W | SET_FLAGS | RD4(TMP_REG1) | RM4(dst_r)); in sljit_emit_op_flags()
2491 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_cmov(struct sljit_compiler *compiler, sljit_s32 type, in sljit_emit_cmov() argument
2498 CHECK(check_sljit_emit_cmov(compiler, type, dst_reg, src, srcw)); in sljit_emit_cmov()
2502 cc = get_cc(compiler, type & 0xff); in sljit_emit_cmov()
2505 FAIL_IF(push_inst16(compiler, IT | (cc << 4) | 0x8)); in sljit_emit_cmov()
2506 return push_inst16(compiler, MOV | SET_REGS44(dst_reg, src)); in sljit_emit_cmov()
2513 FAIL_IF(push_inst16(compiler, IT | (cc << 4) | 0x8)); in sljit_emit_cmov()
2514 return push_inst32(compiler, MOVW | RD4(dst_reg) in sljit_emit_cmov()
2520 FAIL_IF(push_inst16(compiler, IT | (cc << 4) | 0x8)); in sljit_emit_cmov()
2521 return push_inst32(compiler, MOV_WI | RD4(dst_reg) | tmp); in sljit_emit_cmov()
2526 FAIL_IF(push_inst16(compiler, IT | (cc << 4) | 0x8)); in sljit_emit_cmov()
2527 return push_inst32(compiler, MVN_WI | RD4(dst_reg) | tmp); in sljit_emit_cmov()
2530 FAIL_IF(push_inst16(compiler, IT | (cc << 4) | ((cc & 0x1) << 3) | 0x4)); in sljit_emit_cmov()
2533 FAIL_IF(push_inst32(compiler, MOVW | RD4(dst_reg) in sljit_emit_cmov()
2535 return push_inst32(compiler, MOVT | RD4(dst_reg) in sljit_emit_cmov()
2539 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_mem(struct sljit_compiler *compiler, sljit_s32 type, in sljit_emit_mem() argument
2547 CHECK(check_sljit_emit_mem(compiler, type, reg, mem, memw)); in sljit_emit_mem()
2594 return push_inst32(compiler, inst | RT4(reg) | RN4(mem & REG_MASK) | (sljit_ins)memw); in sljit_emit_mem()
2597 SLJIT_API_FUNC_ATTRIBUTE struct sljit_const* sljit_emit_const(struct sljit_compiler *compiler, slji… in sljit_emit_const() argument
2603 CHECK_PTR(check_sljit_emit_const(compiler, dst, dstw, init_value)); in sljit_emit_const()
2606 const_ = (struct sljit_const*)ensure_abuf(compiler, sizeof(struct sljit_const)); in sljit_emit_const()
2608 set_const(const_, compiler); in sljit_emit_const()
2611 PTR_FAIL_IF(emit_imm32_const(compiler, dst_r, (sljit_uw)init_value)); in sljit_emit_const()
2614 PTR_FAIL_IF(emit_op_mem(compiler, WORD_SIZE | STORE, dst_r, dst, dstw, TMP_REG2)); in sljit_emit_const()
2618 …UTE struct sljit_put_label* sljit_emit_put_label(struct sljit_compiler *compiler, sljit_s32 dst, s… in sljit_emit_put_label() argument
2624 CHECK_PTR(check_sljit_emit_put_label(compiler, dst, dstw)); in sljit_emit_put_label()
2627 put_label = (struct sljit_put_label*)ensure_abuf(compiler, sizeof(struct sljit_put_label)); in sljit_emit_put_label()
2629 set_put_label(put_label, compiler, 0); in sljit_emit_put_label()
2632 PTR_FAIL_IF(emit_imm32_const(compiler, dst_r, 0)); in sljit_emit_put_label()
2635 PTR_FAIL_IF(emit_op_mem(compiler, WORD_SIZE | STORE, dst_r, dst, dstw, TMP_REG2)); in sljit_emit_put_label()